14#include "arcane/core/CartesianMeshAllocateBuildInfo.h"
15#include "arcane/core/internal/CartesianMeshAllocateBuildInfoInternal.h"
17#include "arcane/utils/CheckedConvert.h"
18#include "arcane/utils/Vector3.h"
19#include "arcane/utils/Vector2.h"
20#include "arcane/utils/Array.h"
21#include "arcane/utils/ITraceMng.h"
22#include "arcane/utils/FatalErrorException.h"
23#include "arcane/utils/FixedArray.h"
25#include "arcane/core/IPrimaryMesh.h"
26#include "arcane/core/ItemTypeId.h"
27#include "arcane/core/IMeshInitialAllocator.h"
45 m_internal.m_p =
this;
51 Int32 m_mesh_dimension = -1;
52 Int32 m_face_builder_version = -1;
53 Int32 m_edge_builder_version = -1;
56 Int64x3 m_global_nb_cells = {};
57 Int32x3 m_own_nb_cells = {};
58 Int64x3 m_first_own_cell_offset;
59 Int64 m_cell_unique_id_offset = -1;
60 Int64 m_node_unique_id_offset = -1;
69Int32 CartesianMeshAllocateBuildInfoInternal::
72 return m_p->m_mesh_dimension;
81 m_p->m_face_builder_version = version;
90 return m_p->m_face_builder_version;
99 m_p->m_edge_builder_version = version;
108 return m_p->m_edge_builder_version;
114const Int64x3& CartesianMeshAllocateBuildInfoInternal::
117 return m_p->m_global_nb_cells;
123const Int32x3& CartesianMeshAllocateBuildInfoInternal::
126 return m_p->m_own_nb_cells;
132const Int64x3& CartesianMeshAllocateBuildInfoInternal::
133firstOwnCellOffset()
const
135 return m_p->m_first_own_cell_offset;
141Int64 CartesianMeshAllocateBuildInfoInternal::
142cellUniqueIdOffset()
const
144 return m_p->m_cell_unique_id_offset;
150Int64 CartesianMeshAllocateBuildInfoInternal::
151nodeUniqueIdOffset()
const
153 return m_p->m_node_unique_id_offset;
162CartesianMeshAllocateBuildInfo::
171CartesianMeshAllocateBuildInfo::
172~CartesianMeshAllocateBuildInfo()
181setInfos2D(std::array<Int64, 2> global_nb_cells,
182 std::array<Int32, 2> own_nb_cells,
183 Int64 cell_unique_id_offset,
184 Int64 node_unique_id_offset)
186 setInfos2D(global_nb_cells, own_nb_cells, { 0, 0 }, cell_unique_id_offset);
187 m_p->m_node_unique_id_offset = node_unique_id_offset;
195 const Int32x2& own_nb_cells,
196 const Int64x2& first_own_cell_offset,
197 Int64 cell_unique_id_offset)
199 m_p->m_mesh_dimension = 2;
200 m_p->m_global_nb_cells = { global_nb_cells.x, global_nb_cells.y, 0 };
201 m_p->m_own_nb_cells = { own_nb_cells.x, own_nb_cells.y, 0 };
202 m_p->m_first_own_cell_offset = { first_own_cell_offset.x, first_own_cell_offset.y, 0 };
203 m_p->m_cell_unique_id_offset = cell_unique_id_offset;
204 m_p->m_node_unique_id_offset = 0;
211setInfos3D(std::array<Int64, 3> global_nb_cells,
212 std::array<Int32, 3> own_nb_cells,
213 Int64 cell_unique_id_offset,
214 Int64 node_unique_id_offset)
216 setInfos3D(Int64x3(global_nb_cells), Int32x3(own_nb_cells), { 0, 0, 0 }, cell_unique_id_offset);
217 m_p->m_node_unique_id_offset = node_unique_id_offset;
225 const Int32x3& own_nb_cells,
226 const Int64x3& first_own_cell_offset,
227 Int64 cell_unique_id_offset)
229 m_p->m_mesh_dimension = 3;
230 m_p->m_global_nb_cells = global_nb_cells;
231 m_p->m_own_nb_cells = own_nb_cells;
232 m_p->m_first_own_cell_offset = first_own_cell_offset;
233 m_p->m_cell_unique_id_offset = cell_unique_id_offset;
234 m_p->m_node_unique_id_offset = 0;
247 ARCANE_FATAL(
"Mesh implementation has no IMeshInitialAllocator");
250 if (!specific_allocator)
251 ARCANE_FATAL(
"Mesh does not support 'ICartesianMeshInitialAllocator'");
253 pm->
traceMng()->
info() <<
"Allocate mesh from CartesianMeshAllocateBuildInfo";
254 specific_allocator->allocate(*
this);
263 return &m_p->m_internal;
#define ARCANE_FATAL(...)
Macro envoyant une exception FatalErrorException.
Partie interne de CartesianMeshAllocateBuildInfo.
void setEdgeBuilderVersion(Int32 version)
Positionne la version utilisée pour le calcul des uniqueId() des arêtes.
void setFaceBuilderVersion(Int32 version)
Positionne la version utilisée pour le calcul des uniqueId() des faces.
Int32 faceBuilderVersion() const
Version utilisée pour le calcul des des uniqueId() des faces.
Int32 edgeBuilderVersion() const
Version utilisée pour le calcul des uniqueId() des arêtes.
void allocateMesh()
Alloue le maillage.
void setInfos3D(std::array< Int64, 3 > global_nb_cells, std::array< Int32, 3 > own_nb_cells, Int64 cell_unique_id_offset, Int64 node_unique_id_offset)
Positionne les informations pour un maillage 3D.
CartesianMeshAllocateBuildInfoInternal * _internal()
Partie interne réservée à Arcane.
void setInfos2D(std::array< Int64, 2 > global_nb_cells, std::array< Int32, 2 > own_nb_cells, Int64 cell_unique_id_offset, Int64 node_unique_id_offset)
Positionne les informations pour un maillage 2D.
Allocateur pour les maillages cartésiens.
virtual ITraceMng * traceMng()=0
Gestionnaire de message associé
Interface d'allocation des entités du maillage.
virtual IMeshInitialAllocator * initialAllocator()
Allocateur initial spécifique.
virtual TraceMessage info()=0
Flot pour un message d'information.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
std::int64_t Int64
Type entier signé sur 64 bits.
std::int32_t Int32
Type entier signé sur 32 bits.