TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Joint.cpp
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#include <Joint.h>
17#include <Domaine.h>
18
19Implemente_instanciable_32_64(Joint_32_64,"Joint_32_64",Frontiere);
20
21// ***************************************************************
22// Implementation de la classe Joint_32_64
23// ***************************************************************
24
25/*! @brief Ecrit le joint sur un flot de sortie.
26 *
27 * On ecrit:
28 * - la frontiere
29 * - le PE voisin
30 * - l'epaisseur
31 * - les sommets
32 *
33 */
34template <typename _SIZE_>
36{
37 Frontiere_t::printOn(s) ;
38 s << "format_joint_250507" << finl;
39 s << PEvoisin_ << finl;
40 s << epaisseur_ << finl;
41 s << joint_item(JOINT_ITEM::SOMMET).items_communs() << finl;
42 s << joint_item(JOINT_ITEM::ELEMENT).items_distants() << finl;
43 return s ;
44}
45
46/*! @brief Lit un joint a partir d'un flot d'entree.
47 *
48 */
49template <typename _SIZE_>
51{
52 Frontiere_t::readOn(s) ;
53 Nom format;
54 s >> format;
55 if (format!="format_joint_250507")
56 {
58 {
59 Cerr << "The format of .Zones is not recognized because probably too old." << finl;
60 Cerr << "Split your mesh with an executable which is more recent" << finl;
61 Cerr << "than the version 1.5.2 build 240507." << finl;
62 }
64 }
65 s >> PEvoisin_;
66 s >> epaisseur_;
67 s >> set_joint_item(JOINT_ITEM::SOMMET).set_items_communs();
68 s >> set_joint_item(JOINT_ITEM::ELEMENT).set_items_distants();
69 return s ;
70}
71
72/*! @brief
73 *
74 */
75template <typename _SIZE_>
77{
78 this->faces().dimensionner(i);
79 this->faces().voisins() = -1;
80 this->faces().les_sommets() = -1;
81}
82
83
84/*! @brief Ajoute des faces a la frontiere (au joint) voir Frontiere::ajouter_faces(const IntTab&)
85 *
86 * @param (IntTab& sommets) tableau contenant les numeros des sommets des face a ajouter
87 */
88template <typename _SIZE_>
90{
91 this->faces().ajouter(sommets);
92 this->faces().voisins() = -1;
93}
94
95/*! @brief Renvoie les informations de joint pour un type d'item geometrique donne, pour remplissage des structures.
96 *
97 * Ces structures
98 * sont generalement remplies par la classe Scatter. Exceptions notables:
99 * Domaine_VDF et Domaine_VF pour la renumerotation des faces.
100 *
101 */
102template <typename _SIZE_>
104{
105 switch(item)
106 {
107 case JOINT_ITEM::SOMMET:
108 return joint_sommets_;
109 case JOINT_ITEM::ELEMENT:
110 return joint_elements_;
111 case JOINT_ITEM::FACE:
112 return joint_faces_;
113 case JOINT_ITEM::ARETE:
114 return joint_aretes_;
115 case JOINT_ITEM::FACE_FRONT:
116 return joint_faces_front_;
117 default:
118 Cerr << "Error in Joint_32_64<_SIZE_>::set_joint_item, invalid item number : " << (int)item << finl;
120 }
121 return joint_sommets_; // never arrive here
122}
123
124/*! @brief Renvoie les informations de joint pour le type demande.
125 *
126 */
127template <typename _SIZE_>
129{
130 switch(item)
131 {
132 case JOINT_ITEM::SOMMET:
133 return joint_sommets_;
134 case JOINT_ITEM::ELEMENT:
135 return joint_elements_;
136 case JOINT_ITEM::FACE:
137 return joint_faces_;
138 case JOINT_ITEM::ARETE:
139 return joint_aretes_;
140 case JOINT_ITEM::FACE_FRONT:
141 return joint_faces_front_;
142 default:
143 Cerr << "Error in Joint_32_64<_SIZE_>::set_joint_item, invalid item number : " << (int)item << finl;
145 }
146 return joint_sommets_; // never arrive here
147}
148
149
150template class Joint_32_64<int>;
151#if INT_is_64_ == 2
152template class Joint_32_64<trustIdType>;
153#endif
154
155
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
const Faces_t & faces() const
Definition Frontiere.h:54
La classe Joint est une Frontiere qui contient les faces et les sommets de joint avec le domaine PEvo...
Definition Joint.h:34
const Joint_Items_t & joint_item(JOINT_ITEM type) const
Renvoie les informations de joint pour le type demande.
Definition Joint.cpp:128
Joint_Items_32_64< _SIZE_ > Joint_Items_t
Definition Joint.h:44
void dimensionner(int)
Definition Joint.cpp:76
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< _SIZE_ > IntTab_t
Definition Joint.h:42
void ajouter_faces(const IntTab_t &)
Ajoute des faces a la frontiere (au joint) voir Frontiere::ajouter_faces(const IntTab&).
Definition Joint.cpp:89
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:293
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
static int je_suis_maitre()
renvoie 1 si on est sur le processeur maitre du groupe courant (c'est a dire me() == 0),...
Definition Process.cpp:86
Classe de base des flux de sortie.
Definition Sortie.h:52