TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Decouper.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 Decouper_included
17#define Decouper_included
18
19#include <Partitionneur_base.h>
20#include <TRUST_Deriv.h>
21#include <Interprete_geometrique_base.h>
22#include <TRUST_Ref.h>
23#include <vector>
24#include <Domaine_forward.h>
25
26enum class DomainesFileOutputType { BINARY_MULTIPLE, HDF5_SINGLE };
27
28/*! @brief Interprete Decouper.
29 *
30 * Aucun algorithme ici, uniquement lecture de parametres dans le fichier .data et execution du partitionneur
31 * et du decoupeur. Voir la methode interprete()
32 *
33 */
34template <typename _SIZE_>
36{
37 Declare_instanciable_32_64(Decouper_32_64);
38public:
39 // Those two classes are tightly related and are just easier to code if they are allowed to access members directly:
40 friend class Decouper_multi;
41 friend class Decouper_etendu; // For STT
42
43 using int_t = _SIZE_;
44 using BigIntVect_t = TRUSTVect<int, _SIZE_>; // always storing 'int' (=proc num) but might have a lot of entries
45 using IntTab_t = IntTab_T<_SIZE_>;
49
50 Entree& lire(Entree& is); //lecture des parametres
51 int lire_motcle_non_standard(const Motcle&, Entree&) override;
52 Entree& interpreter(Entree& is) override;
53
54 /** Ecriture d'une partition elem_part donnee
55 * som_raccord (optionnel) : som_raccord[s] -> process auxquels est raccorde le sommet s par un raccord a un autre domaine
56 */
57 void ecrire(const Static_Int_Lists_t *som_raccord=nullptr);
58
59 // Whether to be more verbose:
61
62protected:
63 // The actual tool used for partitioning (Metis, Tranche, etc.):
64 OWN_PTR(Partitionneur_base_t) deriv_partitionneur_;
65 int nb_parts_tot_ = -1;
66 // Result of the partitionning process:
68
69 // Parametres du decoupage (remplis par lire()):
77 DomainesFileOutputType format_ = DomainesFileOutputType::BINARY_MULTIPLE;
78 int reorder_ = 0;
79
80private:
81 // Does nothing, we directly override interpreter():
82 Entree& interpreter_(Entree& is) override { return is; }
83
84 void lire_partitionneur(Entree& is);
85 void ecrire_fichier_decoupage() const;
86 void ecrire_fichier_decoupage_som() const;
87 void postraiter_decoupage(const Nom& nom_fichier) const;
88 void ecrire_sous_domaines(const int nb_parties, const Static_Int_Lists_t* som_raccord) const;
89
90};
91
92using Decouper = Decouper_32_64<int>;
93using Decouper_64 = Decouper_32_64<trustIdType>;
94
95#endif
Interprete Decouper.
Definition Decouper.h:36
void ecrire(const Static_Int_Lists_t *som_raccord=nullptr)
Definition Decouper.cpp:320
_SIZE_ int_t
Definition Decouper.h:43
static int print_more_infos_
Definition Decouper.h:60
Domaine_32_64< _SIZE_ > Domaine_t
Definition Decouper.h:46
BigIntVect_t elem_part_
Definition Decouper.h:67
Entree & lire(Entree &is)
Definition Decouper.cpp:277
Partitionneur_base_32_64< _SIZE_ > Partitionneur_base_t
Definition Decouper.h:47
IntTab_T< _SIZE_ > IntTab_t
Definition Decouper.h:45
Entree & interpreter(Entree &is) override
Definition Decouper.cpp:259
friend class Decouper_etendu
Definition Decouper.h:41
TRUSTVect< int, _SIZE_ > BigIntVect_t
Definition Decouper.h:44
friend class Decouper_multi
Definition Decouper.h:40
Static_Int_Lists_32_64< _SIZE_ > Static_Int_Lists_t
Definition Decouper.h:48
DomainesFileOutputType format_
Definition Decouper.h:77
Nom nom_fichier_decoupage_sommets_
Definition Decouper.h:74
int lire_motcle_non_standard(const Motcle &, Entree &) override
Lecture des parametres de type non simple d'un objet_U a partir d'un flot d'entree.
Definition Decouper.cpp:409
OWN_PTR(Partitionneur_base_t) deriv_partitionneur_
classe Domaine_32_64 un Domaine est un maillage compose d'un ensemble d'elements geometriques de meme...
Definition Domaine.h:62
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
classe Interprete_geometrique_base .
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
Classe de base des partitionneurs de domaine (pour decouper un maillage avant un calcul parallele).
Cette classe permet de stocker des listes d'entiers accessibles en temps constant.