TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Joint_Items.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_Items.h>
17
18// **********************************************************
19// Implementation of the Joint_Items_32_64 class
20// **********************************************************
21
22/*! @brief default constructor
23 *
24 */
25template <typename _SIZE_>
27{
28 nb_items_virtuels_ = -1;
29 nb_items_reels_ = -1;
30 flags_init_ = 0;
31}
32
33/*! @brief Resets to the initial state obtained after the default constructor.
34 *
35 */
36template <typename _SIZE_>
38{
39 nb_items_virtuels_ = -1;
40 nb_items_reels_ = -1;
41 flags_init_ = 0;
42 items_communs_.reset();
43 items_distants_.reset();
44 renum_items_communs_.reset();
45}
46
47
48/*! @brief Returns the items_communs_ array for filling.
49 *
50 * @note (BM: this array is not yet filled)
51 * @return Reference to the items_communs_ array.
52 */
53template <typename _SIZE_>
55{
56 flags_init_ |= 1;
57 return items_communs_;
58}
59
60/*! @brief Returns the items_distants_ array (read-only). See items_distants_.
61 *
62 * @return Const reference to the items_distants_ array.
63 */
64template <typename _SIZE_>
66{
67 assert(flags_init_ & 2);
68 return items_distants_;
69}
70
71/*! @brief Returns the items_distants_ array for filling.
72 *
73 * @sa Scatter::calculer_espace_distant,
74 * Scatter::calculer_espace_distant_faces_frontieres,
75 * Scatter::calculer_espace_distant_elements
76 * @return Reference to the items_distants_ array.
77 */
78template <typename _SIZE_>
80{
81 flags_init_ |= 2;
82 return items_distants_;
83}
84
85/*! @brief Sets the number of virtual items. See nb_items_virtuels_.
86 *
87 * @sa Scatter::calculer_nb_items_virtuels
88 * @param n Number of virtual items received from the neighboring domain.
89 */
90template <typename _SIZE_>
92{
93 flags_init_ |= 4;
94 nb_items_virtuels_ = n;
95}
96
97/*! @brief Returns the number of virtual items. See nb_items_virtuels_.
98 *
99 * @return Number of virtual items received from the neighboring domain.
100 */
101template <typename _SIZE_>
103{
104 assert(flags_init_ & 4);
105 return nb_items_virtuels_;
106}
107
108/*! @brief Returns the renum_items_communs_ array for filling. See renum_items_communs_.
109 *
110 * @sa Scatter::calculer_colonne0_renum_faces_communes,
111 * Scatter::construire_correspondance_sommets_par_coordonnees
112 * @return Reference to the renum_items_communs_ array.
113 */
114template <typename _SIZE_>
116{
117 flags_init_ |= 8;
118 return renum_items_communs_;
119}
120
121/*! @brief Returns the renum_items_communs_ array (read-only). See renum_items_communs_.
122 *
123 * @return Const reference to the renum_items_communs_ array.
124 */
125template <typename _SIZE_>
127{
128 assert(flags_init_ & 8);
129 return renum_items_communs_;
130}
131
132/*! @brief Sets the number of real items. Not yet used.
133 *
134 * @param n Number of real items.
135 */
136template <typename _SIZE_>
138{
139 assert(n >= 0);
140 flags_init_ |= 16;
141 nb_items_reels_ = n;
142}
143
144/*! @brief Returns the number of real items. Not yet used.
145 *
146 * Intended to facilitate creation of distributed arrays, but joints are not
147 * the right place to store this value: it must be storable even when there
148 * is no neighboring processor.
149 * @return Number of real items.
150 */
151template <typename _SIZE_>
153{
154 assert(flags_init_ & 16);
155 return nb_items_reels_;
156}
157
158
159template class Joint_Items_32_64<int>;
160#if INT_is_64_ == 2
161template class Joint_Items_32_64<trustIdType>;
162#endif
163
164
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_.
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.