14#include "arcane/core/UnstructuredMeshAllocateBuildInfo.h"
15#include "arcane/core/internal/UnstructuredMeshAllocateBuildInfoInternal.h"
17#include "arcane/utils/Array.h"
18#include "arcane/utils/ITraceMng.h"
19#include "arcane/utils/FatalErrorException.h"
21#include "arcane/core/IPrimaryMesh.h"
22#include "arcane/core/ItemTypeId.h"
23#include "arcane/core/IMeshInitialAllocator.h"
41 m_internal.m_p =
this;
46 m_cells_infos.add(type_id);
47 m_cells_infos.add(cell_uid);
48 m_cells_infos.addRange(nodes_uid);
55 Int32 m_mesh_dimension = -1;
58 UnstructuredMeshAllocateBuildInfoInternal m_internal;
70 return m_p->m_cells_infos;
76Int32 UnstructuredMeshAllocateBuildInfoInternal::
79 return m_p->m_mesh_dimension;
85Int32 UnstructuredMeshAllocateBuildInfoInternal::
88 return m_p->m_nb_cell;
97UnstructuredMeshAllocateBuildInfo::
106UnstructuredMeshAllocateBuildInfo::
107~UnstructuredMeshAllocateBuildInfo()
118 m_p->m_mesh_dimension = v;
127 m_p->addCell(type_id, cell_uid, nodes_uid);
140 ARCANE_FATAL(
"Mesh implementation has no IMeshInitialAllocator");
143 if (!specific_allocator)
144 ARCANE_FATAL(
"Mesh does not support 'IUnstructuredMeshInitialAllocator'");
146 pm->
traceMng()->
info() <<
"Allocate mesh from UnstructuredMeshAllocateBuildInfo";
147 specific_allocator->allocate(*
this);
156 m_p->m_cells_infos.reserve((nb_cell * 2) + nb_connectivity_node);
165 return &m_p->m_internal;
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
Constant view of an array of type T.
virtual ITraceMng * traceMng()=0
Associated message manager.
Interface for allocating mesh entities.
virtual IUnstructuredMeshInitialAllocator * unstructuredMeshAllocator()
Allocator for unstructured meshes.
virtual IMeshInitialAllocator * initialAllocator()
Specific initial allocator.
virtual TraceMessage info()=0
Stream for an information message.
Allocator for unstructured meshes.
Type of an entity (Item).
View of an array of elements of type T.
1D data vector with value semantics (STL style).
void allocateMesh()
Allocates the mesh with the cells added during the call to addCell().
UnstructuredMeshAllocateBuildInfoInternal * _internal()
Internal part reserved for Arcane.
void setMeshDimension(Int32 v)
Sets the mesh dimension.
void preAllocate(Int32 nb_cell, Int64 nb_connectivity_node)
Pre-allocate the memory.
void addCell(ItemTypeId type_id, Int64 cell_uid, SmallSpan< const Int64 > nodes_uid)
Adds a cell to the mesh.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int64_t Int64
Signed integer type of 64 bits.
std::int32_t Int32
Signed integer type of 32 bits.