TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Sous_Domaine.h
1/****************************************************************************
2* Copyright (c) 2025, 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 Sous_Domaine_included
17#define Sous_Domaine_included
18
19#include <TRUST_List.h>
20#include <TRUSTVect.h>
21#include <TRUST_Ref.h>
22#include <Domaine_forward.h>
23
24/*! @brief Sous_Domaine represents a volumic sub-domain i.e. a sub set of elements of a Domaine
25 *
26 * It bears a reference to the Domaine it subdivides
27 *
28 * @sa Domaine Sous_Domaines
29 */
30template <typename _SIZE_>
32{
33
34 Declare_instanciable_32_64(Sous_Domaine_32_64);
35
36public :
37 void build(Entree& is);
38
39 using int_t = _SIZE_;
40 using ArrOfInt_t = ArrOfInt_T<_SIZE_>;
41 using IntVect_t = IntVect_T<_SIZE_>;
42 using IntTab_t = IntTab_T<_SIZE_>;
43 using SmallArrOfTID_t = SmallArrOfTID_T<_SIZE_>;
44 using ArrOfDouble_t= ArrOfDouble_T<_SIZE_>;
45 using DoubleVect_t = DoubleVect_T<_SIZE_>;
46 using DoubleTab_t = DoubleTab_T<_SIZE_>;
47 using DoubleTabs_t = DoubleTabs_T<_SIZE_>;
48
50
51 int lire_motcle_non_standard(const Motcle&, Entree&) override { return 0; }
52 inline const Nom& le_nom() const override { return nom_; }
53 inline int_t operator()(int_t i) const { return les_elems_[i]; }
54 inline int_t operator[](int_t i) const { return les_elems_[i]; }
55 // Returns the subdomaine number of elements (real+virtual elements in parallel)
56 inline int_t nb_elem_tot() const { return les_elems_.size(); }
57 void associer_domaine(const Domaine_t& d) { le_dom_=d; }
58 int associer_(Objet_U&) override;
59 void nommer(const Nom& nom) override { nom_=nom; }
60 void add_elem(const int_t poly);
61 inline const IntVect_t& les_elems() const { return les_elems_; }
62 inline IntVect_t& les_elems() { return les_elems_; }
63
64 Domaine_t& domaine() { return le_dom_.valeur(); }
65 const Domaine_t& domaine() const { return le_dom_.valeur(); }
66
67protected :
68
72};
73
74using Sous_Domaine = Sous_Domaine_32_64<int>;
75using Sous_Domaine_64 = Sous_Domaine_32_64<trustIdType>;
76
77#endif
78
class Domaine_32_64 A Domain is a mesh composed of a set of geometric elements of the same type.
Definition Domaine.h:62
A character string (Nom) in uppercase.
Definition Motcle.h:26
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
friend class Entree
Definition Objet_U.h:71
Objet_U()
Default constructor: assigns a unique identifier to the object (object_id_) and registers the object ...
Definition Objet_U.cpp:54
Sous_Domaine represents a volumic sub-domain i.e. a sub set of elements of a Domaine.
IntTab_T< int > IntTab_t
const Domaine_t & domaine() const
void nommer(const Nom &nom) override
Assigns a name to the Objet_U. Virtual method to override.
int_t operator[](int_t i) const
void add_elem(const int_t poly)
Adds a polyhedron to the subdomain.
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
ArrOfDouble_T< int > ArrOfDouble_t
void associer_domaine(const Domaine_t &d)
int_t operator()(int_t i) const
DoubleTab_T< int > DoubleTab_t
IntVect_t & les_elems()
const Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
ArrOfInt_T< int > ArrOfInt_t
DoubleTabs_T< int > DoubleTabs_t
OBS_PTR(Domaine_t) le_dom_
int_t nb_elem_tot() const
Domaine_32_64< int > Domaine_t
Domaine_t & domaine()
int associer_(Objet_U &) override
Associates an Objet_U with the subdomain.
SmallArrOfTID_T< int > SmallArrOfTID_t
const IntVect_t & les_elems() const
IntVect_T< int > IntVect_t
void build(Entree &is)
DoubleVect_T< int > DoubleVect_t