TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Scatter.h
1/****************************************************************************
2* Copyright (c) 2026, CEA
3* All rights reserved.
4*
5* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9*
10* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
12* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13*
14*****************************************************************************/
15
16#ifndef Scatter_included
17#define Scatter_included
18
19#include <TRUSTTabs_forward.h>
20#include <Interprete.h>
21#include <TRUST_Ref.h>
22#include <Joint.h>
23#include <Domaine_forward.h>
24
25class Domaine_VF;
26
27class Scatter : public Interprete
28{
29 Declare_instanciable(Scatter);
30public:
31 Entree& interpreter(Entree&) override;
32 virtual void lire_domaine(Nom& fil);
33 Domaine& domaine();
34
35 static int Chercher_Correspondance(const DoubleTab& sommets1, const DoubleTab& sommets2, ArrOfInt& correspondance, const double epsilon);
36 static void construire_correspondance_sommets_par_coordonnees(Domaine& dom, bool allow_resize=false);
38 static void construire_correspondance_items_par_coordonnees(Joints& joints, const JOINT_ITEM type_item, const DoubleTab& coord_items, bool allow_resize=false);
39
40 static void construire_structures_paralleles(Domaine& dom);
41
42 //static void rechercher_elems_joints(Domaine & domaine);
43
44 static void calculer_espace_distant(Domaine& domaine,
45 const int nb_items_reels,
46 const ArrsOfInt& items_to_send,
47 const JOINT_ITEM type_item);
48
49 static void calculer_nb_items_virtuels(Joints& joints,
50 const JOINT_ITEM type_item);
51
52 static void calculer_renum_items_communs(Joints& joints, const JOINT_ITEM type_item);
53 static void calculer_espace_distant_faces(Domaine& domaine, const int nb_faces_reelles, const IntTab& elem_faces);
54 static void calculer_espace_distant_aretes(Domaine& domaine, const int nb_aretes_reelles, const IntTab& elem_aretes);
55
56 static void calculer_espace_distant_elements(Domaine& dom);
57 static void corriger_espace_distant_elements_perio(Domaine& dom);
58
59 static void calculer_espace_distant_sommets(Domaine& dom);
60 static void construire_espace_virtuel_traduction(const MD_Vector& md_indice, const MD_Vector& md_valeur, IntTab& tableau, const int error_is_fatal = 1);
61
62 static void reordonner_faces_de_joint(Domaine& dom);
63 static void ajouter_joints(Domaine& domaine, ArrOfInt& pe_voisins);
64
65 static void trier_les_joints(Joints& joints);
66 static void construire_md_vector(const Domaine&, int nb_items_reels, const JOINT_ITEM, MD_Vector&);
67
68 static void check_consistancy_remote_items( Domaine& dom, const ArrOfInt& mergedDomaines );
69
70 // Although Scatter is never meant to be used in 64b, those two methods are needed by both configurations:
71 template <typename _SIZE_>
73 template <typename _SIZE_>
75
76
77protected:
78 OBS_PTR(Domaine) le_domaine;
79
80 void read_domain_no_comm(Entree& fic, bool& read_perio);
81};
82
83#endif
class Domaine_32_64 A Domain is a mesh composed of a set of geometric elements of the same type.
Definition Domaine.h:62
class Domaine_VF
Definition Domaine_VF.h:44
Base class for "interpreter" objects.
Definition Interprete.h:38
: This class is an OWN_PTR but the pointed object is shared among multiple
Definition MD_Vector.h:48
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
friend class Entree
Definition Objet_U.h:71
static void reordonner_faces_de_joint(Domaine &dom)
Reorders joint faces so that they appear in the same order on each pair of neighboring processors.
Definition Scatter.cpp:1675
static int Chercher_Correspondance(const DoubleTab &sommets1, const DoubleTab &sommets2, ArrOfInt &correspondance, const double epsilon)
Builds the "correspondance" array such that for 0 <= i < sommets2.
Definition Scatter.cpp:2366
static void ajouter_joints(Domaine &domaine, ArrOfInt &pe_voisins)
Adds joints with all PEs in pe_voisins.
Definition Scatter.cpp:1028
static void init_sequential_domain(Domaine_32_64< _SIZE_ > &dom)
Create parallel descriptors for the vertex and element arrays of the domain (necessary because Scatte...
Definition Scatter.cpp:2739
static void construire_espace_virtuel_traduction(const MD_Vector &md_indice, const MD_Vector &md_valeur, IntTab &tableau, const int error_is_fatal=1)
Builds the items_communs + virtual space structure of an array containing indices of geometric items,...
Definition Scatter.cpp:1621
static void calculer_espace_distant_sommets(Domaine &dom)
Based on the remote space of elements, computes the remote space of vertices.
Definition Scatter.cpp:1155
Entree & interpreter(Entree &) override
Reads and completes a parallel domain according to the keywords read in the data set.
Definition Scatter.cpp:129
static void calculer_espace_distant_aretes(Domaine &domaine, const int nb_aretes_reelles, const IntTab &elem_aretes)
Same as Scatter::calculer_espace_distant_sommets for edges.
Definition Scatter.cpp:1199
static void calculer_espace_distant_elements(Domaine &dom)
Fills the "espace_distant()" array of elements in the joints.
Definition Scatter.cpp:2058
static void calculer_espace_distant(Domaine &domaine, const int nb_items_reels, const ArrsOfInt &items_to_send, const JOINT_ITEM type_item)
Determines the distant items from a list of items to send and lists of common items.
Definition Scatter.cpp:819
static void construire_correspondance_items_par_coordonnees(Joints &joints, const JOINT_ITEM type_item, const DoubleTab &coord_items, bool allow_resize=false)
Generic method to build geometrical item correspondance between the local and the remote processor ar...
Definition Scatter.cpp:2482
static void construire_structures_paralleles(Domaine &dom)
Builds the parallel structures of the domain (determination of distant elements as a function of join...
Definition Scatter.cpp:673
static void calculer_nb_items_virtuels(Joints &joints, const JOINT_ITEM type_item)
For a geometric item "type_item", fills the nb_items_virtuels_ field of joints based on the number of...
Definition Scatter.cpp:2695
OBS_PTR(Domaine) le_domaine
void read_domain_no_comm(Entree &fic, bool &read_perio)
Does the exact same thing as the readOn of the class Domaine but without collective communication.
Definition Scatter.cpp:395
static void calculer_renum_items_communs(Joints &joints, const JOINT_ITEM type_item)
Assumes that each joint[i].joint_item(type_item).items_communs() contains the local indices of common...
Definition Scatter.cpp:1220
static void construire_correspondance_sommets_par_coordonnees(Domaine &dom, bool allow_resize=false)
Builds the joint_item(JOINT_ITEM::SOMMET).items_communs arrays for all joints of the domain dom.
Definition Scatter.cpp:2674
static void construire_md_vector(const Domaine &, int nb_items_reels, const JOINT_ITEM, MD_Vector &)
Builds an MD_Vector_std from the joint information of the domain for the requested item type.
Definition Scatter.cpp:1277
static void check_consistancy_remote_items(Domaine &dom, const ArrOfInt &mergedDomaines)
Merged domains receive joint information from their neighbours to ensure that their common items (ver...
Definition Scatter.cpp:271
static void corriger_espace_distant_elements_perio(Domaine &dom)
Current periodic algorithms (P1B assembler, OpDivElem P1B) require that for each virtual periodic fac...
Definition Scatter.cpp:1908
Domaine & domaine()
Returns the associated domain.
Definition Scatter.cpp:74
static void trier_les_joints(Joints &joints)
Sort joints by increasing neighbor proc number.
Definition Scatter.cpp:712
static void calculer_espace_distant_faces(Domaine &domaine, const int nb_faces_reelles, const IntTab &elem_faces)
Same as Scatter::calculer_espace_distant_sommets for faces.
Definition Scatter.cpp:1180
virtual void lire_domaine(Nom &fil)
Reads the domain from the file named "nomentree", of type LecFicDistribueBin or LecFicDistribue.
Definition Scatter.cpp:469
static void uninit_sequential_domain(Domaine_32_64< _SIZE_ > &dom)
Method used by interpreters that modify the domain (sequential), destroys the descriptors of vertices...
Definition Scatter.cpp:2754
static void construire_correspondance_aretes_par_coordonnees(Domaine_VF &zvf)
Builds the joint_item(JOINT_ITEM::ARETE).items_communs arrays for all joints of the domain.
Definition Scatter.cpp:2683