TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Partitionneur_Tranche.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#ifndef Partitionneur_Tranche_included
16#define Partitionneur_Tranche_included
17
18#include <Partitionneur_base.h>
19#include <TRUSTTabs_forward.h>
20#include <TRUST_Ref.h>
21
22#include <Domaine_forward.h>
23
24/*! @brief Partitionneur de domaine en tranches paralleles aux directions de l'espace.
25 *
26 * Voir construire_partition
27 *
28 */
29template <typename _SIZE_>
31{
32 Declare_instanciable_with_param_32_64(Partitionneur_Tranche_32_64);
33
34protected:
35 void validate_params() const override;
36
37public:
38 using int_t = _SIZE_;
39 using ArrOfInt_t = ArrOfInt_T<_SIZE_>;
40 using IntVect_t = IntVect_T<_SIZE_>;
41 using IntTab_t = IntTab_T<_SIZE_>;
43
44 using BigIntVect_ = TRUSTVect<int, _SIZE_>; // always int as value type, will hold proc/partition number.
45
46 void associer_domaine(const Domaine_t& domaine) override;
47 void initialiser(const ArrOfInt& nb_tranches);
48 void construire_partition(BigIntVect_& elem_part, int& nb_parts_tot) const override;
49 static void chercher_direction_perio(const Domaine_t& domaine, ArrOfInt& directions_perio);
50
51private:
52 // Parametres du partitionneur
53 OBS_PTR(Domaine_t) ref_domaine_;
54
55 // Pour chaque dimension d'espace, 2 ou 3, nombre de tranches
56 // a creer dans cette direction (>=1)
57 ArrOfInt nb_tranches_;
58};
59
60using Partitionneur_Tranche = Partitionneur_Tranche_32_64<int>;
61using Partitionneur_Tranche_64 = Partitionneur_Tranche_32_64<trustIdType>;
62
63#endif
classe Domaine_32_64 un Domaine est un maillage compose d'un ensemble d'elements geometriques de meme...
Definition Domaine.h:62
Partitionneur de domaine en tranches paralleles aux directions de l'espace.
void validate_params() const override
La syntaxe est { Tranches nx ny [ nz ] }.
static void chercher_direction_perio(const Domaine_t &domaine, ArrOfInt &directions_perio)
Remplissage du tableau directions perio a partir des noms des bords periodiques.
void associer_domaine(const Domaine_t &domaine) override
Premiere etape d'initialisation du partitionneur: on associe un domaine.
Domaine_32_64< _SIZE_ > Domaine_t
void construire_partition(BigIntVect_ &elem_part, int &nb_parts_tot) const override
void initialiser(const ArrOfInt &nb_tranches)
Deuxieme etape d'initialisation: on definit le nombre de tranches.
TRUSTVect< int, _SIZE_ > BigIntVect_
Classe de base des partitionneurs de domaine (pour decouper un maillage avant un calcul parallele).