TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Joint_Items.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_Items_included
17#define Joint_Items_included
18
19#include <TRUSTTab.h>
20
21/*! @brief Joint_Items holds the parallel distribution information for a particular geometric item type
22 * with a particular neighboring domain (item = vertex, element, face, etc.)
23 *
24 * These structures are initialised in Scatter and are then used, for example, to create a
25 * distributed array indexed by geometric item indices.
26 *
27 * @sa class Joint
28 */
29template <typename _SIZE_>
31{
32public:
33
34 using int_t = _SIZE_;
35 using ArrOfInt_t = ArrOfInt_T<_SIZE_>;
36 using IntTab_t = IntTab_T<_SIZE_>;
37
39 void reset();
40
41 // To use these accessors, the structures must have been previously
42 // initialised with set_xxx.
43 int nb_items_reels() const;
44 const ArrOfInt_t& items_communs() const { return items_communs_; }
45 const ArrOfInt_t& items_distants() const;
46 int nb_items_virtuels() const;
48
49 // Initialisation methods for the structures
50 void set_nb_items_reels(int n);
55
56private:
57 // Number of real items (allows building a distributed array)
58 // using only the joint information.
59 int nb_items_reels_;
60
61 // List of items shared with the neighboring domain (the list is
62 // ordered in the same way on the local domain and on the neighboring
63 // domain => items_communs[i] on joint_j of domain_k represents the same
64 // geometric entity as items_communs[i] on joint_k of domain_j)
65 ArrOfInt_t items_communs_;
66
67 // List of remote items to send to the neighboring domain
68 // (the order of items in this list determines the order of appearance
69 // of these items in the virtual space of the neighbor)
70 ArrOfInt_t items_distants_;
71
72 // Number of virtual items received from the neighboring domain.
73 // we have "nb_items_virtuels_ on joint_j of domain_k"
74 // = "items_distants.size_array() on joint_k of domain_j"
75 int nb_items_virtuels_;
76
77 // Correspondence between the local index of a shared item and the index
78 // of the same item on the neighboring domain:
79 // column 0 = index on the neighboring domain,
80 // column 1 = index on the local domain
81 // dimension(0) is equal to items_communs.size_array()
82 // The order of items in the array is not specified
83 IntTab_t renum_items_communs_;
84
85 // What has been initialised?
86 int flags_init_;
87};
88
89using Joint_Items = Joint_Items_32_64<int>;
90using Joint_Items_64 = Joint_Items_32_64<trustIdType>;
91
92#endif
Joint_Items holds the parallel distribution information for a particular geometric item type with a p...
Definition Joint_Items.h:31
const ArrOfInt_t & items_communs() const
Definition Joint_Items.h:44
const IntTab_t & renum_items_communs() const
Returns the renum_items_communs_ array (read-only). See renum_items_communs_.
Joint_Items_32_64()
default constructor
IntTab_T< _SIZE_ > IntTab_t
Definition Joint_Items.h:36
IntTab_t & set_renum_items_communs()
Returns the renum_items_communs_ array for filling. See renum_items_communs_.
ArrOfInt_t & set_items_communs()
Returns the items_communs_ array for filling.
int nb_items_virtuels() const
Returns the number of virtual items. See nb_items_virtuels_.
void set_nb_items_virtuels(int n)
Sets the number of virtual items. See nb_items_virtuels_.
const ArrOfInt_t & items_distants() const
Returns the items_distants_ array (read-only). See items_distants_.
ArrOfInt_t & set_items_distants()
Returns the items_distants_ array for filling.
void reset()
Resets to the initial state obtained after the default constructor.
ArrOfInt_T< _SIZE_ > ArrOfInt_t
Definition Joint_Items.h:35
void set_nb_items_reels(int n)
Sets the number of real items. Not yet used.
int nb_items_reels() const
Returns the number of real items. Not yet used.