Arcane  v3.16.0.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
ItemSharedInfo.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* ItemSharedInfo.h (C) 2000-2024 */
9/* */
10/* Informations communes à plusieurs entités. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_ITEMSHAREDINFO_H
13#define ARCANE_CORE_ITEMSHAREDINFO_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
19#include "arcane/core/ItemTypeInfo.h"
20#include "arcane/core/MeshItemInternalList.h"
21
22/*---------------------------------------------------------------------------*/
23/*---------------------------------------------------------------------------*/
24
25namespace Arcane::mesh
26{
27class ItemFamily;
28class ItemSharedInfoWithType;
29class DynamicMeshKindInfos;
30}
31
32namespace Arcane
33{
34
35/*---------------------------------------------------------------------------*/
36/*---------------------------------------------------------------------------*/
37
38class ItemInternal;
41
42/*---------------------------------------------------------------------------*/
43/*---------------------------------------------------------------------------*/
44/*!
45 * \internal
46 * \brief Structure interne partagée d'une entité de maillage.
47 *
48 * Cette classe renferme des informations communes à plusieurs entités.
49 *
50 * Comme une instance de cette classe est partagée par plusieurs entités, il
51 * ne faut en cas la modifier directement. C'est à l'implémentation (Mesh)
52 * de fournir un mécanisme gérant les instances de cette classe.
53 */
54class ARCANE_CORE_EXPORT ItemSharedInfo
55{
56 friend class ItemBase;
57 friend class MutableItemBase;
58 friend class Item;
59 friend class ItemGenericInfoListView;
60 friend class ItemInternal;
61 friend class ItemInfoListView;
62 friend class mesh::ItemFamily;
63 friend class mesh::DynamicMeshKindInfos;
64 friend class mesh::ItemSharedInfoWithType;
65 friend class ItemInternalVectorView;
66 friend class ItemVectorViewConstIterator;
67 friend class ItemConnectedListViewConstIterator;
68 friend class ItemVectorView;
69 friend class ItemEnumeratorBase;
70 friend class ItemInternalCompatibility;
71 friend class SimdItemBase;
72 friend class SimdItemEnumeratorBase;
73 template<int Extent> friend class ItemConnectedListView;
74
75 public:
76
77 static const Int32 NULL_INDEX = static_cast<Int32>(-1);
78
79 public:
80
81 // TODO: Rendre privé. Il faut passer maintenant passer par nullInstance()
82 //! Pour l'entité nulle
83 static ItemSharedInfo nullItemSharedInfo;
84
85 private:
86
87 static ItemSharedInfo* nullItemSharedInfoPointer;
88
89 public:
90
91 static ItemSharedInfo* nullInstance() { return nullItemSharedInfoPointer; }
92
93 public:
94
96
97 private:
98
99 // Seule ItemFamily peut créer des instances de cette classe autre que l'instance nulle.
101 ItemInternalConnectivityList* connectivity);
102
103 public:
104
105 eItemKind itemKind() const { return m_item_kind; }
106 IItemFamily* itemFamily() const { return m_item_family; }
107 Int32 nbParent() const { return m_nb_parent; }
108 ItemTypeInfo* typeInfoFromId(Int32 type_id) const;
109
110 ARCANE_DEPRECATED_REASON("Y2022: This method always return 0")
111 constexpr Int32 nbNode() const { return 0; }
112 ARCANE_DEPRECATED_REASON("Y2020: This method always return 0")
113 constexpr Int32 nbEdge() const { return 0; }
114 ARCANE_DEPRECATED_REASON("Y2020: This method always return 0")
115 constexpr Int32 nbFace() const { return 0; }
116 ARCANE_DEPRECATED_REASON("Y2020: This method always return 0")
117 constexpr Int32 nbCell() const { return 0; }
118 ARCANE_DEPRECATED_REASON("Y2020: This method always return 0")
119 constexpr Int32 nbHParent() const { return 0; }
120 ARCANE_DEPRECATED_REASON("Y2020: This method always return 0")
121 constexpr Int32 nbHChildren() const { return 0; }
122
123 ARCANE_DEPRECATED_REASON("Y2022: This method always throws an exception. Use ItemInternal::typeId() instead")
124 Int32 typeId() const;
125
126 ARCANE_DEPRECATED_REASON("Y2022: This method always return 0")
127 Int32 firstNode() const { return 0; }
128 ARCANE_DEPRECATED_REASON("Y2022: This method always return 0")
129 Int32 firstEdge() const { return 0; }
130 ARCANE_DEPRECATED_REASON("Y2022: This method always return 0")
131 Int32 firstFace() const { return 0; }
132 ARCANE_DEPRECATED_REASON("Y2022: This method always return 0")
133 Int32 firstCell() const { return 0; }
134 ARCANE_DEPRECATED_REASON("Y2022: This method always return 0")
135 Int32 firstParent() const { return 0; }
136 ARCANE_DEPRECATED_REASON("Y2022: This method always return 0")
137 Int32 firstHParent() const { return 0; }
138 ARCANE_DEPRECATED_REASON("Y2022: This method always return 0")
139 Int32 firstHChild() const { return 0; }
140
141 ARCANE_DEPRECATED_REASON("Y2022: This method always return 0")
142 constexpr Int32 neededMemory() const { return 0; }
143 ARCANE_DEPRECATED_REASON("Y2022: This method always return 0")
144 constexpr Int32 minimumNeededMemory() const { return 0; }
145 ARCCORE_DEPRECATED_2021("This method always return 'false'")
146 constexpr bool hasLegacyConnectivity() const { return false; }
147
148 void updateMeshItemInternalList();
149
150 public:
151
152 void print(std::ostream& o) const;
153
154 public:
155
156 ARCANE_DEPRECATED_REASON("Y2022: This list is always empty")
157 ItemInternalVectorView nodes(Int32) const;
158
159 ARCANE_DEPRECATED_REASON("Y2020: This list is always empty")
160 ItemInternalVectorView edges(Int32) const;
161
162 ARCANE_DEPRECATED_REASON("Y2020: This list is always empty")
163 ItemInternalVectorView faces(Int32) const;
164
165 ARCANE_DEPRECATED_REASON("Y2020: This list is always empty")
166 ItemInternalVectorView cells(Int32) const;
167
168 ARCANE_DEPRECATED_REASON("Y2020: This list is always empty")
169 ItemInternalVectorView hChildren(Int32) const;
170
171 public:
172
173 ARCANE_DEPRECATED_REASON("Y2022: This method always throws an exception. Use _parentV2() instead")
174 ItemInternal* parent(Integer,Integer) const;
175
176 private:
177
178 ItemInternal* _parentV2(Int32 local_id,[[maybe_unused]] Integer aindex) const
179 {
180 // Actuellement un seul parent est supporté donc \a aindex doit valoir 0.
181 ARCANE_ASSERT((aindex==0),("Only one parent access implemented"));
182 return _parent(m_parent_item_ids[local_id]);
183 }
184 Int32 _parentLocalIdV2(Int32 local_id,[[maybe_unused]] Integer aindex) const
185 {
186 // Actuellement un seul parent est supporté donc \a aindex doit valoir 0.
187 ARCANE_ASSERT((aindex==0),("Only one parent access implemented"));
188 return m_parent_item_ids[local_id];
189 }
190 void _setParentV2(Int32 local_id,Integer aindex,Int32 parent_local_id);
191 Int32* _parentPtr(Int32 local_id);
192
193 public:
194
195 ARCANE_DEPRECATED_REASON("Y2020: This method always return 'nullptr'")
196 ItemInternal* node(Int32,Int32) const { return nullptr; }
197 ARCANE_DEPRECATED_REASON("Y2020: This method always return 'nullptr'")
198 ItemInternal* edge(Int32,Int32) const { return nullptr; }
199 ARCANE_DEPRECATED_REASON("Y2020: This method always return 'nullptr'")
200 ItemInternal* face(Int32,Int32) const { return nullptr; }
201 ARCANE_DEPRECATED_REASON("Y2020: This method always return 'nullptr'")
202 ItemInternal* cell(Int32,Int32) const { return nullptr; }
203 ARCANE_DEPRECATED_REASON("Y2020: This method always return 'nullptr'")
204 ItemInternal* hParent(Integer,Integer) const { return nullptr; }
205 ARCANE_DEPRECATED_REASON("Y2020: This method always return 'nullptr'")
206 ItemInternal* hChild(Int32,Int32) const { return nullptr; }
207
208 public:
209
210 ARCANE_DEPRECATED_REASON("Y2020: This method always return 'NULL_ITEM_LOCAL_ID'")
211 Int32 nodeLocalId(Int32,Int32) const { return NULL_ITEM_LOCAL_ID; }
212 ARCANE_DEPRECATED_REASON("Y2020: This method always return 'NULL_ITEM_LOCAL_ID'")
213 Int32 edgeLocalId(Int32,Int32) const { return NULL_ITEM_LOCAL_ID; }
214 ARCANE_DEPRECATED_REASON("Y2020: This method always return 'NULL_ITEM_LOCAL_ID'")
215 Int32 faceLocalId(Int32,Int32) const { return NULL_ITEM_LOCAL_ID; }
216 ARCANE_DEPRECATED_REASON("Y2020: This method always return 'NULL_ITEM_LOCAL_ID'")
217 Int32 cellLocalId(Int32,Int32) const { return NULL_ITEM_LOCAL_ID; }
218 ARCANE_DEPRECATED_REASON("Y2020: This method always return 'NULL_ITEM_LOCAL_ID'")
219 Integer parentLocalId(Integer,Integer) const { return NULL_ITEM_LOCAL_ID; }
220 ARCANE_DEPRECATED_REASON("Y2020: This method always return 'NULL_ITEM_LOCAL_ID'")
221 Int32 hParentLocalId(Integer,Integer) const { return NULL_ITEM_LOCAL_ID; }
222 ARCANE_DEPRECATED_REASON("Y2020: This method always return 'NULL_ITEM_LOCAL_ID'")
223 Int32 hChildLocalId(Integer,Integer) const { return NULL_ITEM_LOCAL_ID; }
224
225 public:
226
227 ARCANE_DEPRECATED_REASON("Y2022: This method always throws an exception.")
228 void setNode(Int32,Int32,Int32) const;
229 ARCANE_DEPRECATED_REASON("Y2022: This method always throws an exception.")
230 void setEdge(Int32,Int32,Int32) const;
231 ARCANE_DEPRECATED_REASON("Y2022: This method always throws an exception.")
232 void setFace(Int32,Int32,Int32) const;
233 ARCANE_DEPRECATED_REASON("Y2022: This method always throws an exception.")
234 void setCell(Int32,Int32,Int32) const;
235 ARCANE_DEPRECATED_REASON("Y2022: This method always throws an exception.")
236 void setHParent(Int32,Int32,Int32) const;
237 ARCANE_DEPRECATED_REASON("Y2022: This method always throws an exception.")
238 void setHChild(Int32,Int32,Int32) const;
239
240 ARCANE_DEPRECATED_REASON("Y2022: This method always throws an exception. Use _setParentV2() instead")
241 void setParent(Integer,Integer,Integer) const;
242
243 public:
244
245 ARCANE_DEPRECATED_REASON("Y2022: This method always return 0")
246 constexpr Int32 edgeAllocated() const { return 0; }
247 ARCANE_DEPRECATED_REASON("Y2022: This method always return 0")
248 constexpr Int32 faceAllocated() const { return 0; }
249 ARCANE_DEPRECATED_REASON("Y2022: This method always return 0")
250 constexpr Int32 cellAllocated() const { return 0; }
251 ARCANE_DEPRECATED_REASON("Y2022: This method always return 0")
252 constexpr Int32 hParentAllocated() const { return 0; }
253 ARCANE_DEPRECATED_REASON("Y2022: This method always return 0")
254 constexpr Int32 hChildAllocated() const { return 0; }
255
256 public:
257
258 ARCANE_DEPRECATED_REASON("Y2022: This method always returns 'nullptr'")
259 const Int32* _infos() const { return nullptr; }
260 ARCANE_DEPRECATED_REASON("Y2022: This method always throws an exception.")
261 void _setInfos(Int32* ptr);
262
263 private:
264
265 // ATTENTION:
266 // Toute modification de la liste ou du type des champs doit être
267 // reportée dans le wrapper C# (tools/wrapper/core/csharp) et
268 // dans le proxy pour totalview (src/arcane/totalview)
269 MeshItemInternalList* m_items = nullptr;
270 ItemInternalConnectivityList* m_connectivity;
271 IItemFamily* m_item_family = nullptr;
272 ItemTypeMng* m_item_type_mng = nullptr;
273 Int64ArrayView m_unique_ids;
274 Int32ArrayView m_parent_item_ids;
275 Int32ArrayView m_owners;
276 Int32ArrayView m_flags;
277 Int16ArrayView m_type_ids;
278 eItemKind m_item_kind = IK_Unknown;
279 Int32 m_nb_parent = 0;
280 ConstArrayView<ItemInternal*> m_items_internal; //!< ItemInternal des entités
281
282 public:
283
284 ARCANE_DEPRECATED_REASON("Y2022: This method always throws an exception. Use _ownerV2() instead")
285 Int32 owner(Int32) const;
286 ARCANE_DEPRECATED_REASON("Y2022: This method always throws an exception. Use _setOwnerV2() instead")
287 void setOwner(Int32,Int32) const;
288 ARCANE_DEPRECATED_REASON("Y2022: This method always throws an exception. Use _flagsV2() instead")
289 Int32 flags(Int32) const;
290 ARCANE_DEPRECATED_REASON("Y2022: This method always throws an exception. Use _setFlagsV2() instead")
291 void setFlags(Int32,Int32) const;
292
293 private:
294
295 Int32 _ownerV2(Int32 local_id) const { return m_owners[local_id]; }
296 void _setOwnerV2(Int32 local_id,Int32 aowner) { m_owners[local_id] = aowner; }
297 Int32 _flagsV2(Int32 local_id) const { return m_flags[local_id]; }
298 void _setFlagsV2(Int32 local_id,Int32 f) { m_flags[local_id] = f; }
299
300 Int16 _typeId(Int32 local_id) const { return m_type_ids[local_id]; }
301 void _setTypeId(Int32 local_id,Int16 v) { m_type_ids[local_id] = v; }
302
303 public:
304
305 // TODO: a supprimer
306 ARCANE_DEPRECATED_REASON("Y2022: COMMON_BASE_MEMORY is always 0")
307 static const Int32 COMMON_BASE_MEMORY = 0;
308
309 private:
310
311 void _init(eItemKind ik);
312 //! Version non optimisée mais robuste d'accès à l'ItemInternalArrayView parent
313 ItemInternal* _parent(Int32 id) const;
314};
315
316/*---------------------------------------------------------------------------*/
317/*---------------------------------------------------------------------------*/
318
319inline std::ostream&
320operator<<(std::ostream& o,const ItemSharedInfo& isi)
321{
322 isi.print(o);
323 return o;
324}
325
326/*---------------------------------------------------------------------------*/
327/*---------------------------------------------------------------------------*/
328
329} // End namespace Arcane
330
331/*---------------------------------------------------------------------------*/
332/*---------------------------------------------------------------------------*/
333
334#endif
Déclarations des types généraux de Arcane.
Déclarations de types sur les entités.
Interface d'une famille d'entités.
Definition IItemFamily.h:84
static ItemSharedInfo nullItemSharedInfo
Pour l'entité nulle.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
eItemKind
Genre d'entité de maillage.
std::int32_t Int32
Type entier signé sur 32 bits.