TrioCFD 1.9.9_beta
TrioCFD documentation
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 * No algorithm here, only reading of parameters from the .data file and execution of the partitioner
31 * and the cutter. See the interprete() method.
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); //reading of parameters
51 int lire_motcle_non_standard(const Motcle&, Entree&) override;
52 Entree& interpreter(Entree& is) override;
53
54 /** Writing of a given elem_part partition.
55 * som_raccord (optional) : som_raccord[s] -> processes to which vertex s is connected by a connector to another domain.
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 // Splitting parameters (filled by 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
Reads non-simple-type parameters of an Objet_U from an input stream.
Definition Decouper.cpp:409
OWN_PTR(Partitionneur_base_t) deriv_partitionneur_
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 defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Class Interprete_geometrique_base.
A character string (Nom) in uppercase.
Definition Motcle.h:26
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
Base class for domain partitioners (for splitting a mesh before a parallel computation).
This class allows storing lists of integers accessible in constant time.