TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Joint.h
1/****************************************************************************
2* Copyright (c) 2024, 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 Joint_included
17#define Joint_included
18
19#include <Frontiere.h>
20#include <Joint_Items.h>
21
22enum class JOINT_ITEM { SOMMET, ELEMENT, FACE, ARETE, FACE_FRONT };
23
24/*! @brief La classe Joint est une Frontiere qui contient les faces et les sommets de joint avec le
25 * domaine PEvoisin() (pour les maillages distribues en parallele).
26 *
27 * Elle porte en plus dans les Joint_Items les informations permettant de construire les tableaux
28 * distribues indexes par les items geometriques (sommets, faces, elements, aretes, faces_frontieres)
29 *
30 * @sa Scatter Joint_Item
31 */
32template <typename _SIZE_>
33class Joint_32_64 : public Frontiere_32_64<_SIZE_>
34{
35
36 Declare_instanciable_32_64(Joint_32_64);
37
38public:
39
40 using int_t = _SIZE_;
41 using ArrOfInt_t = ArrOfInt_T<_SIZE_>;
42 using IntTab_t = IntTab_T<_SIZE_>;
43
46
47 void affecte_PEvoisin(int num) { PEvoisin_ = num; }
48 void affecte_epaisseur(int ep) { epaisseur_ = ep; }
49 int PEvoisin() const { return PEvoisin_; }
50 int epaisseur() const { return epaisseur_; }
51
52 void dimensionner(int);
53 void ajouter_faces(const IntTab_t&);
54
55 // Accesseurs pour compatibilite avec la version precedente
56 // (supprimes bientot)
57 const IntTab_t& renum_virt_loc() const { return joint_item(JOINT_ITEM::SOMMET).renum_items_communs(); }
58 const ArrOfInt_t& esp_dist_elems() const { return joint_item(JOINT_ITEM::ELEMENT).items_distants(); }
59 const ArrOfInt_t& esp_dist_sommets() const { return joint_item(JOINT_ITEM::SOMMET).items_distants(); }
60 const ArrOfInt_t& esp_dist_faces() const { return joint_item(JOINT_ITEM::FACE).items_distants(); }
61
62 // Nouvelle interface pour acceder aux donnees de joint:
63 Joint_Items_t& set_joint_item(JOINT_ITEM type);
64 const Joint_Items_t& joint_item(JOINT_ITEM type) const;
65
66private:
67 // Numero du PEvoisin correspondant au joint
68 int PEvoisin_=-1;
69
70 // Epaisseur de joint, utilise par Scatter::calculer_espace_distant_elements
71 int epaisseur_=-1;
72
73 Joint_Items_t joint_sommets_;
74 Joint_Items_t joint_elements_;
75 Joint_Items_t joint_faces_;
76 Joint_Items_t joint_faces_front_;
77 Joint_Items_t joint_aretes_;
78};
79
80using Joint = Joint_32_64<int>;
81using Joint_64 = Joint_32_64<trustIdType>;
82
83#endif
Classe Frontiere.
Definition Frontiere.h:32
La classe Joint est une Frontiere qui contient les faces et les sommets de joint avec le domaine PEvo...
Definition Joint.h:34
void affecte_epaisseur(int ep)
Definition Joint.h:48
const ArrOfInt_t & esp_dist_faces() const
Definition Joint.h:60
const Joint_Items_t & joint_item(JOINT_ITEM type) const
Renvoie les informations de joint pour le type demande.
Definition Joint.cpp:128
ArrOfInt_T< int > ArrOfInt_t
Definition Joint.h:41
void affecte_PEvoisin(int num)
Definition Joint.h:47
Joint_Items_32_64< int > Joint_Items_t
Definition Joint.h:44
Frontiere_32_64< int > Frontiere_t
Definition Joint.h:45
void dimensionner(int)
Definition Joint.cpp:76
const ArrOfInt_t & esp_dist_sommets() const
Definition Joint.h:59
Joint_Items_t & set_joint_item(JOINT_ITEM type)
Renvoie les informations de joint pour un type d'item geometrique donne, pour remplissage des structu...
Definition Joint.cpp:103
IntTab_T< int > IntTab_t
Definition Joint.h:42
const IntTab_t & renum_virt_loc() const
Definition Joint.h:57
int epaisseur() const
Definition Joint.h:50
const ArrOfInt_t & esp_dist_elems() const
Definition Joint.h:58
void ajouter_faces(const IntTab_t &)
Ajoute des faces a la frontiere (au joint) voir Frontiere::ajouter_faces(const IntTab&).
Definition Joint.cpp:89
int PEvoisin() const
Definition Joint.h:49
Joint_Items contient les informations de distribution parallele d'un item geometrique particulier ave...
Definition Joint_Items.h:31
const IntTab_t & renum_items_communs() const
Voir renum_items_communs_.
const ArrOfInt_t & items_distants() const
Voir items_distants_.