TrioCFD 1.9.9_beta
TrioCFD documentation
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 The Joint class is a Frontiere that contains the joint faces and vertices with the
25 * neighboring domain PEvoisin() (for meshes distributed in parallel).
26 *
27 * It additionally carries in the Joint_Items the information needed to build
28 * distributed arrays indexed by geometric items (vertices, faces, elements, edges, boundary faces).
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 // Accessors for compatibility with the previous version
56 // (to be removed soon)
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 // New interface to access joint data:
63 Joint_Items_t& set_joint_item(JOINT_ITEM type);
64 const Joint_Items_t& joint_item(JOINT_ITEM type) const;
65
66private:
67 // Index of the neighboring PE corresponding to this joint
68 int PEvoisin_=-1;
69
70 // Joint thickness, used by 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
Class Frontiere.
Definition Frontiere.h:32
The Joint class is a Frontiere that contains the joint faces and vertices with the neighboring domain...
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
Returns the joint information for the requested type (read-only).
Definition Joint.cpp:131
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)
Returns the joint information for a given geometric item type, for filling the structures.
Definition Joint.cpp:104
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 &)
Adds faces to the boundary (to the joint). See Frontiere::ajouter_faces(const IntTab&).
Definition Joint.cpp:89
int PEvoisin() const
Definition Joint.h:49
Joint_Items holds the parallel distribution information for a particular geometric item type with a p...
Definition Joint_Items.h:31
const IntTab_t & renum_items_communs() const
Returns the renum_items_communs_ array (read-only). See renum_items_communs_.
const ArrOfInt_t & items_distants() const
Returns the items_distants_ array (read-only). See items_distants_.