14#include "arcane/mesh/DynamicMesh.h"
16#include "arcane/utils/ValueConvert.h"
17#include "arcane/utils/StringBuilder.h"
18#include "arcane/utils/ITraceMng.h"
19#include "arcane/utils/PlatformUtils.h"
20#include "arcane/utils/ArgumentException.h"
21#include "arcane/utils/ScopedPtr.h"
23#include "arcane/core/ISubDomain.h"
24#include "arcane/core/ITimeStats.h"
25#include "arcane/core/IVariableMng.h"
26#include "arcane/core/Properties.h"
27#include "arcane/core/SharedVariable.h"
28#include "arcane/core/IParallelMng.h"
29#include "arcane/core/ICaseDocument.h"
31#include "arcane/core/Timer.h"
32#include "arcane/core/ItemPrinter.h"
33#include "arcane/core/IPropertyMng.h"
34#include "arcane/core/CommonVariables.h"
35#include "arcane/core/MeshStats.h"
36#include "arcane/core/IMeshFactory.h"
37#include "arcane/core/IMeshPartitionConstraintMng.h"
38#include "arcane/core/IMeshWriter.h"
39#include "arcane/core/IMeshUtilities.h"
40#include "arcane/core/Connectivity.h"
41#include "arcane/core/FactoryService.h"
42#include "arcane/core/AbstractService.h"
43#include "arcane/core/ServiceBuilder.h"
44#include "arcane/core/MeshToMeshTransposer.h"
45#include "arcane/core/IItemFamilyCompactPolicy.h"
46#include "arcane/core/IItemFamilyExchanger.h"
47#include "arcane/core/IItemFamilySerializer.h"
48#include "arcane/core/IItemFamilyPolicyMng.h"
49#include "arcane/core/IMeshExchanger.h"
50#include "arcane/core/IMeshCompacter.h"
51#include "arcane/core/MeshVisitor.h"
52#include "arcane/core/IVariableSynchronizer.h"
53#include "arcane/core/IParallelReplication.h"
54#include "arcane/core/IMeshMng.h"
55#include "arcane/core/MeshBuildInfo.h"
56#include "arcane/core/ICaseMng.h"
58#include "arcane/core/internal/UnstructuredMeshAllocateBuildInfoInternal.h"
59#include "arcane/core/internal/IItemFamilyInternal.h"
60#include "arcane/core/internal/IVariableMngInternal.h"
61#include "arcane/core/internal/IMeshInternal.h"
62#include "arcane/core/internal/IMeshModifierInternal.h"
64#include "arcane/mesh/ExtraGhostCellsBuilder.h"
65#include "arcane/mesh/ExtraGhostParticlesBuilder.h"
67#include "arcane/mesh/MeshPartitionConstraintMng.h"
68#include "arcane/mesh/ItemGroupsSynchronize.h"
69#include "arcane/mesh/DynamicMeshIncrementalBuilder.h"
70#include "arcane/mesh/OneMeshItemAdder.h"
71#include "arcane/mesh/DynamicMeshChecker.h"
72#include "arcane/mesh/GhostLayerMng.h"
73#include "arcane/mesh/MeshUniqueIdMng.h"
74#include "arcane/mesh/ItemGroupDynamicMeshObserver.h"
75#include "arcane/mesh/ParticleFamily.h"
76#include "arcane/mesh/MeshExchange.h"
77#include "arcane/mesh/UnstructuredMeshUtilities.h"
78#include "arcane/mesh/TiedInterfaceMng.h"
79#include "arcane/mesh/MeshCompactMng.h"
80#include "arcane/mesh/MeshExchangeMng.h"
81#include "arcane/mesh/DynamicMeshMerger.h"
82#include "arcane/mesh/ItemFamilyNetwork.h"
83#include "arcane/mesh/IncrementalItemConnectivity.h"
84#include "arcane/mesh/MeshExchanger.h"
85#include "arcane/mesh/IndexedIncrementalItemConnectivityMng.h"
86#include "arcane/mesh/NodeFamily.h"
87#include "arcane/mesh/EdgeFamily.h"
88#include "arcane/mesh/FaceFamily.h"
89#include "arcane/mesh/CellFamily.h"
90#include "arcane/mesh/DoFFamily.h"
93#include "arcane/mesh/MeshRefinement.h"
94#include "arcane/mesh/FaceReorienter.h"
95#include "arcane/mesh/NewItemOwnerBuilder.h"
97#include "arcane/mesh/IncrementalItemConnectivity.h"
98#include "arcane/mesh/ItemConnectivityMng.h"
100#include "arcane/mesh/internal/DynamicMeshInternal.h"
111const char* PROPERTY_SORT =
"sort";
112const char* PROPERTY_COMPACT =
"compact";
113const char* PROPERTY_COMPACT_AFTER_ALLOCATE =
"compact-after-allocate";
114const char* PROPERTY_DUMP =
"dump";
115const char* PROPERTY_DISPLAY_STATS =
"display-stats";
118const char* PROPERTY_MESH_VERSION =
"mesh-version";
127extern "C++" ARCANE_MESH_EXPORT IItemFamilyPolicyMng*
130extern "C++" ARCANE_MESH_EXPORT IItemFamilyPolicyMng*
133extern "C++" ARCANE_MESH_EXPORT IItemFamilyPolicyMng*
136extern "C++" ARCANE_MESH_EXPORT IItemFamilyPolicyMng*
139extern "C++" ARCANE_MESH_EXPORT IItemFamilyPolicyMng*
140createParticleFamilyPolicyMng(
ItemFamily* family);
142extern "C++" ARCANE_MESH_EXPORT IItemFamilyPolicyMng*
145extern "C++" ARCANE_MESH_EXPORT
void
146allocateCartesianMesh(
DynamicMesh* mesh, CartesianMeshAllocateBuildInfo& build_info);
154#ifdef ARCANE_DEBUG_LOAD_BALANCING
155static bool arcane_debug_load_balancing =
true;
157static bool arcane_debug_load_balancing =
false;
160#ifdef ACTIVATE_PERF_COUNTER
161const std::string DynamicMesh::PerfCounter::m_names[] = {
176DynamicMesh(ISubDomain* sub_domain,
const MeshBuildInfo& mbi,
bool is_submesh)
178, TraceAccessor(mbi.parallelMngRef()->traceMng())
179, m_sub_domain(sub_domain)
180, m_mesh_mng(sub_domain->meshMng())
181, m_mesh_handle(m_mesh_mng->findMeshHandle(mbi.name()))
182, m_parallel_mng(mbi.parallelMngRef().get())
183, m_variable_mng(sub_domain->variableMng())
184, m_properties(new Properties(sub_domain->propertyMng(), String(
"ArcaneMeshProperties_") + mbi.name()))
186, m_is_allocated(false)
189, m_factory_name(mbi.factoryName())
190, m_need_compact(true)
191, m_node_family(nullptr)
192, m_edge_family(nullptr)
193, m_face_family(nullptr)
194, m_cell_family(nullptr)
195, m_parent_mesh(nullptr)
196, m_parent_group(nullptr)
197, m_mesh_utilities(nullptr)
198, m_mesh_builder(nullptr)
199, m_mesh_checker(nullptr)
200, m_submesh_tools(nullptr)
202, m_mesh_refinement(nullptr)
203, m_new_item_owner_builder(nullptr)
204, m_extra_ghost_cells_builder(nullptr)
205, m_extra_ghost_particles_builder(nullptr)
206, m_initial_allocator(this)
209, m_amr_type(mbi.meshKind().meshAMRKind())
211, m_tied_interface_mng(nullptr)
212, m_is_sub_connectivity_set(false)
213, m_tied_interface_need_prepare_dump(true)
214, m_partition_constraint_mng(nullptr)
215, m_ghost_layer_mng(new
GhostLayerMng(m_parallel_mng->traceMng()))
220, m_mesh_part_info(makeMeshPartInfoFromParallelMng(m_parallel_mng))
221, m_item_type_mng(new ItemTypeMng())
223, m_mesh_kind(mbi.meshKind())
225 m_node_family =
new NodeFamily(
this,
"Node");
226 m_edge_family =
new EdgeFamily(
this,
"Edge");
227 m_face_family =
new FaceFamily(
this,
"Face");
228 m_cell_family =
new CellFamily(
this,
"Cell");
230 _addFamily(m_node_family);
231 _addFamily(m_edge_family);
232 _addFamily(m_face_family);
233 _addFamily(m_cell_family);
235 m_properties->setBool(PROPERTY_SORT,
true);
236 m_properties->setBool(PROPERTY_COMPACT,
true);
237 m_properties->setBool(PROPERTY_COMPACT_AFTER_ALLOCATE,
true);
238 m_properties->setBool(PROPERTY_DUMP,
true);
239 m_properties->setBool(PROPERTY_DISPLAY_STATS,
true);
240 m_properties->setInt32(PROPERTY_MESH_VERSION, 1);
242 m_item_internal_list.mesh =
this;
243 m_item_internal_list._internalSetNodeSharedInfo(m_node_family->commonItemSharedInfo());
244 m_item_internal_list._internalSetEdgeSharedInfo(m_edge_family->commonItemSharedInfo());
245 m_item_internal_list._internalSetFaceSharedInfo(m_face_family->commonItemSharedInfo());
246 m_item_internal_list._internalSetCellSharedInfo(m_cell_family->commonItemSharedInfo());
248 info() <<
"Is AMR Activated? = " << m_is_amr_activated
249 <<
" AMR type = " << m_amr_type
250 <<
" allow_loose_items=" << m_mesh_kind.isNonManifold();
252 _printConnectivityPolicy();
255 if (_connectivityPolicy() == InternalConnectivityPolicy::NewWithDependenciesAndLegacy && !is_submesh && !m_is_amr_activated) {
256 m_use_mesh_item_family_dependencies =
true;
257 m_item_family_network =
new ItemFamilyNetwork(traceMng());
258 _addDependency(m_cell_family, m_node_family);
259 _addDependency(m_cell_family, m_face_family);
260 _addDependency(m_cell_family, m_edge_family);
261 _addDependency(m_face_family, m_node_family);
262 _addDependency(m_edge_family, m_node_family);
263 _addRelation(m_face_family, m_edge_family);
264 _addRelation(m_face_family, m_face_family);
265 _addRelation(m_face_family, m_cell_family);
266 _addRelation(m_edge_family, m_cell_family);
267 _addRelation(m_edge_family, m_face_family);
268 _addRelation(m_node_family, m_cell_family);
269 _addRelation(m_node_family, m_face_family);
270 _addRelation(m_node_family, m_edge_family);
276 m_family_modifiers.add(m_cell_family);
277 m_family_modifiers.add(m_face_family);
278 m_family_modifiers.add(m_node_family);
279 m_family_modifiers.add(m_edge_family);
283 String s = platform::getEnvironmentVariable(
"ARCANE_GRAPH_CONNECTIVITY_POLICY");
284#ifdef USE_GRAPH_CONNECTIVITY_POLICY
288 m_item_family_network =
new ItemFamilyNetwork(traceMng());
289 info() <<
"Graph connectivity is activated";
290 m_family_modifiers.add(m_cell_family);
291 m_family_modifiers.add(m_face_family);
292 m_family_modifiers.add(m_node_family);
293 m_family_modifiers.add(m_edge_family);
297 m_extra_ghost_cells_builder =
new ExtraGhostCellsBuilder(
this);
298 m_extra_ghost_particles_builder =
new ExtraGhostParticlesBuilder(
this);
303 if (
auto v = Convert::Type<Int32>::tryParseFromEnvironment(
"ARCANE_NO_SAVE_NEED_COMPACT",
true))
304 m_do_not_save_need_compact = v.value();
308 if (
auto v = Convert::Type<Int32>::tryParseFromEnvironment(
"ARCANE_GENERATE_UNIQUE_ID_FROM_NODES",
true)) {
309 bool is_generate = (v.value() != 0);
312 if (!is_generate && meshKind().isNonManifold())
314 m_mesh_unique_id_mng->setUseNodeUniqueIdToGenerateEdgeAndFaceUniqueId(is_generate);
326 if (m_extra_ghost_cells_builder->hasBuilder())
327 info() <<
"WARNING: pending ExtraGhostCellsBuilder reference";
328 if (m_extra_ghost_particles_builder->hasBuilder())
329 info() <<
"WARNING: pending ExtraGhostParticlesBuilder reference";
331 m_indexed_connectivity_mng =
nullptr;
332 delete m_mesh_compact_mng;
333 delete m_mesh_exchange_mng;
334 delete m_extra_ghost_cells_builder;
335 delete m_extra_ghost_particles_builder;
336 delete m_mesh_unique_id_mng;
337 delete m_ghost_layer_mng;
338 delete m_tied_interface_mng;
339 delete m_partition_constraint_mng;
340 delete m_mesh_utilities;
341 delete m_mesh_builder;
342 delete m_mesh_checker;
345 delete m_submesh_tools;
346 delete m_new_item_owner_builder;
357 m_properties->destroy();
360 delete m_cell_family;
361 delete m_face_family;
362 delete m_edge_family;
363 delete m_node_family;
365 delete m_item_type_mng;
376 info() <<
"Building DynamicMesh name=" <<
name()
377 <<
" ItemInternalMapImpl=" << ItemInternalMap::UseNewImpl;
379 m_item_type_mng->build(
this);
387 _buildAndInitFamily(family);
393 m_observer_pool.addObserver(
this,
398 m_observer_pool.addObserver(
this,
408 m_submesh_tools =
new SubMeshTools(
this, m_mesh_builder);
412 this->
properties()->setBool(PROPERTY_COMPACT,
true);
413 this->
properties()->setBool(PROPERTY_SORT,
true);
454 m_internal_api->build();
463 return m_parallel_mng;
473 ARCANE_FATAL(
"INTERNAL: DynamicMesh: invalid use of a null entity");
492 info() <<
"Reloading the mesh " <<
name();
493 m_is_allocated =
true;
498 m_mesh_checker->checkMeshFromReferenceFile();
500 info() <<
"Time to reallocate the mesh structures (direct method) (unit: second): "
510 m_mesh_checker->setCheckLevel(level);
519 return m_mesh_checker->checkLevel();
530 m_mesh_checker->checkValidMesh();
541 m_mesh_checker->checkValidMeshFull();
548checkValidConnectivity()
550 m_mesh_checker->checkValidConnectivity();
560 family->destroyGroups();
572 group = family->findGroup(
name);
587 return family->
findGroup(name, create_if_needed);
598 ARCANE_CHECK_PTR(family);
605ItemGroup DynamicMesh::
606createGroup(
const String& name,
const ItemGroup& parent)
608 IItemFamily* family = parent.itemFamily();
609 ARCANE_CHECK_PTR(family);
610 return family->createGroup(name, parent);
617_computeSynchronizeInfos()
619 _computeFamilySynchronizeInfos();
620 _computeGroupSynchronizeInfos();
627_computeFamilySynchronizeInfos()
629 info() <<
"Computing family synchronization information for " << name();
630 for (IItemFamily* family : m_item_families) {
631 family->computeSynchronizeInfos();
635 if (!platform::getEnvironmentVariable(
"ARCANE_DUMP_VARIABLE_SYNCHRONIZER_TOPOLOGY").null()) {
636 auto* var_syncer = cellFamily()->allItemsSynchronizer();
637 Int32 iteration = subDomain()->commonVariables().globalIteration();
638 String file_name = String::format(
"{0}_sync_topology_iter{1}.json", name(), iteration);
639 mesh_utils::dumpSynchronizerTopologyJSON(var_syncer, file_name);
647_computeGroupSynchronizeInfos()
649 auto action = [](ItemGroup& group) {
650 if (group.hasSynchronizer())
651 group.synchronizer()->compute();
654 info() <<
"Computing group synchronization information for " << name();
655 meshvisitor::visitGroups(
this, action);
678initializeVariables(
const XmlNode& init_node)
686 items_owner[iitem] = item.
owner();
695 bool has_error =
false;
698 for (
const auto& i : child_list) {
699 String var_name = i.attrValue(
"nom");
702 error() <<
"Failed to initialize the variable '" << var_name
703 <<
"' : no variable with that name exists";
715 error() <<
"Variable '" << var->
name() <<
"' has no family";
718 String grp_name = i.attrValue(
"groupe");
722 error() <<
"Failed to initialize the variable '" << var_name
723 <<
"' on the group `" << grp_name <<
"' : "
724 <<
"No group with that name exists for family '" << family->
name() <<
"'\n";
728 debug() <<
"Read value variable `" << grp_name
729 <<
"' `" << var_name <<
"' " << var;
730 String val_str = i.attrValue(
"valeur");
733 error() <<
"Failed to initialized the variable '" << var_name
734 <<
"' on the group `" << grp_name <<
"'";
758 m_mesh_builder->resetAfterDeallocate();
760 m_is_allocated =
false;
770 ARCANE_FATAL_IF(m_is_allocated,
"mesh has already been allocated (via endAllocate() or allocateCells())");
771 if (mesh_nb_cell == 0 && !cells_infos.
empty())
772 ARCANE_FATAL(
"Can not dynamically compute the number of cells");
776 setEstimatedCells(mesh_nb_cell);
781 _allocateCells(mesh_nb_cell, cells_infos);
785 info() <<
"Time to build the mesh structures (indirect method) (unit: second): "
795 ARCANE_FATAL_IF(m_is_allocated,
"mesh has already been allocated (via endAllocate() or allocateCells())");
800 _checkConnectivity();
802 bool print_stats =
true;
806 info() <<
"Begin compute face unique ids";
809 m_mesh_builder->computeFacesUniqueIds();
811 info() <<
"Begin compute ghost layer";
814 m_mesh_builder->addGhostLayers(
true);
816 info() <<
"Begin compact items";
819 _allocateCells2(m_mesh_builder);
821 if (m_properties->getBool(PROPERTY_COMPACT_AFTER_ALLOCATE))
822 _compactItems(
true,
false);
824 _compactItemInternalReferences();
826 family->_internalApi()->endAllocate();
831#ifdef ARCANE_DEBUG_DYNAMIC_MESH
833 String file_name(
"mesh-end-allocate");
836 file_name += m_mesh_rank;
843 m_mesh_checker->checkMeshFromReferenceFile();
852 info() <<
"** Set owners from cells";
853 _setOwnersFromCells();
859 _notifyEndUpdateForFamilies();
863 m_is_allocated =
true;
878_allocateCells(
Integer mesh_nb_cell,
881 bool allow_build_face)
885 _checkConnectivity();
886 Int32 rank = meshRank();
887 if (m_use_mesh_item_family_dependencies)
888 m_mesh_builder->addCells3(mesh_nb_cell, cells_infos, rank, cells, allow_build_face);
890 m_mesh_builder->addCells(mesh_nb_cell, cells_infos, rank, cells, allow_build_face);
901 const bool allow_build_face = (m_parallel_mng->commSize() == 1);
902 _allocateCells(nb_cell, cells_infos, cells, allow_build_face);
911 bool allow_build_face = args.isAllowBuildFaces();
915 if (m_parallel_mng->commSize() > 1)
916 allow_build_face =
false;
917 _allocateCells(args.nbCell(), args.cellInfos(), args.cellLocalIds(), allow_build_face);
926 _addCells(buffer, 0);
935 _addCells(buffer, &cells_local_id);
946 _checkConnectivity();
947 if (!itemFamilyNetwork() ||
948 !(itemFamilyNetwork() && itemFamilyNetwork()->isActivated()) ||
949 !IItemFamilyNetwork::plug_serializer) {
952 cell_serializer->deserializeItems(buffer, cells_local_id);
955 _deserializeItems(buffer, cells_local_id, m_cell_family);
963allocate(UnstructuredMeshAllocateBuildInfo& build_info)
965 auto* x = build_info._internal();
966 setDimension(x->meshDimension());
967 allocateCells(x->nbCell(), x->cellsInfos(),
true);
974allocate(CartesianMeshAllocateBuildInfo& build_info)
978 allocateCartesianMesh(
this, build_info);
989 _checkConnectivity();
992 !IItemFamilyNetwork::plug_serializer) {
994 buffer->
setMode(ISerializer::ModeReserve);
995 cell_serializer->serializeItems(buffer, cells_local_id);
998 cell_serializer->serializeItems(buffer, cells_local_id);
1001 _serializeItems(buffer, cells_local_id, m_cell_family);
1014 using FamilyLidMap = std::map<String, Int32UniqueArray>;
1015 FamilyLidMap serialized_items;
1016 serialized_items[item_family->
name()] = item_local_ids;
1017 for (
const auto& connectivity :
mesh()->itemFamilyNetwork()->getChildDependencies(item_family)) {
1020 auto& connected_family_serialized_items = serialized_items[connectivity->targetFamily()->name()];
1021 connected_family_serialized_items.addRange(connectivity_accessor.connectedItems(
ItemLocalId(item)).localIds());
1025 buffer->
setMode(ISerializer::ModeReserve);
1026 _fillSerializer(buffer, serialized_items);
1028 buffer->
setMode(ISerializer::ModePut);
1029 _fillSerializer(buffer, serialized_items);
1036_deserializeItems(ISerializer* buffer, Int32Array* item_local_ids, IItemFamily* item_family)
1038 ARCANE_UNUSED(item_family);
1039 buffer->setMode(ISerializer::ModeGet);
1040 mesh()->itemFamilyNetwork()->schedule([item_local_ids, buffer](IItemFamily* family) {
1041 auto family_serializer = std::unique_ptr<IItemFamilySerializer>{ family->policyMng()->createSerializer() };
1042 family_serializer->deserializeItems(buffer, item_local_ids);
1044 IItemFamilyNetwork::InverseTopologicalOrder);
1045 mesh()->itemFamilyNetwork()->schedule([item_local_ids, buffer](IItemFamily* family) {
1046 auto family_serializer = std::unique_ptr<IItemFamilySerializer>{ family->policyMng()->createSerializer() };
1047 family_serializer->deserializeItemRelations(buffer, item_local_ids);
1049 IItemFamilyNetwork::InverseTopologicalOrder);
1056_fillSerializer(ISerializer* buffer, std::map<String, Int32UniqueArray>& serialized_items)
1058 mesh()->itemFamilyNetwork()->schedule([&serialized_items, buffer](IItemFamily* family) {
1059 auto family_serializer = std::unique_ptr<IItemFamilySerializer>{ family->policyMng()->createSerializer() };
1060 auto& serialized_items_local_ids = serialized_items[family->name()];
1061 family_serializer->serializeItems(buffer, serialized_items_local_ids);
1063 IItemFamilyNetwork::InverseTopologicalOrder);
1064 mesh()->itemFamilyNetwork()->schedule([&serialized_items, buffer](IItemFamily* family) {
1065 auto family_serializer = std::unique_ptr<IItemFamilySerializer>{ family->policyMng()->createSerializer() };
1066 auto& serialized_items_local_ids = serialized_items[family->name()];
1067 family_serializer->serializeItemRelations(buffer, serialized_items_local_ids);
1069 IItemFamilyNetwork::InverseTopologicalOrder);
1076addParentCells(ItemVectorView& items)
1078 Trace::Setter mci(traceMng(), _className());
1080 _checkConnectivity();
1081 m_mesh_builder->addParentCells(items);
1092 _checkConnectivity();
1093 bool allow_build_face =
false ;
1094 m_mesh_builder->addHChildrenCells(parent_cell, nb_cell, cells_infos, meshRank(), cells, allow_build_face);
1101addParentCellToCell(
Cell child,
Cell parent)
1105 _checkConnectivity();
1107 m_cell_family->_addParentCellToCell(child, parent);
1114addChildCellToCell(
Cell parent,
Cell child)
1118 _checkConnectivity();
1120 m_cell_family->_addChildCellToCell2(parent, child);
1127addParentFaceToFace(Face child, Face parent)
1129 Trace::Setter mci(traceMng(), _className());
1131 _checkConnectivity();
1133 m_face_family->_addParentFaceToFace(parent, child);
1140addChildFaceToFace(Face parent, Face child)
1142 Trace::Setter mci(traceMng(), _className());
1144 _checkConnectivity();
1146 m_face_family->_addChildFaceToFace(parent, child);
1153addParentNodeToNode(Node child, Node parent)
1155 Trace::Setter mci(traceMng(), _className());
1157 _checkConnectivity();
1159 m_node_family->_addParentNodeToNode(parent, child);
1166addChildNodeToNode(Node parent, Node child)
1168 Trace::Setter mci(traceMng(), _className());
1170 _checkConnectivity();
1172 m_node_family->_addChildNodeToNode(parent, child);
1182 _checkConnectivity();
1183 Int32 rank = meshRank();
1184 if (m_use_mesh_item_family_dependencies)
1185 m_mesh_builder->addFaces3(nb_face, face_infos, rank, faces);
1187 m_mesh_builder->addFaces(nb_face, face_infos, rank, faces);
1196 addFaces(args.nbFace(), args.faceInfos(), args.faceLocalIds());
1206 _checkConnectivity();
1207 Int32 rank = meshRank();
1208 if (m_use_mesh_item_family_dependencies)
1209 m_mesh_builder->addEdges3(nb_edge, edge_infos, rank, edges);
1211 m_mesh_builder->addEdges(nb_edge, edge_infos, rank, edges);
1221 _checkConnectivity();
1222 Int32 rank = meshRank();
1223 if (m_use_mesh_item_family_dependencies)
1224 m_mesh_builder->addNodes2(nodes_uid, rank, nodes);
1226 m_mesh_builder->addNodes(nodes_uid, rank, nodes);
1235 ARCANE_UNUSED(update_graph);
1237 if (m_use_mesh_item_family_dependencies)
1238 removeItems(m_cell_family, cells_local_id);
1240 m_cell_family->internalRemoveItems(cells_local_id);
1242 if (m_item_family_network) {
1243 m_item_family_network->removeConnectedDoFsFromCells(cells_local_id);
1251removeItems(IItemFamily* item_family, Int32ConstArrayView cells_local_id)
1253 ARCANE_UNUSED(item_family);
1254 ARCANE_ASSERT((itemFamilyNetwork()), (
"Cannot call DynamicMesh::removeItems if no ItemFamilyNetwork available"))
1256 if (cells_local_id.empty())
1260 ItemDataList item_data_list;
1261 ItemData& cell_data = item_data_list.itemData(Integer(m_cell_family->itemKind()),
1262 cells_local_id.size(), cells_local_id.size(), Int32ArrayView(),
1263 m_cell_family, (IItemFamilyModifier*)(m_cell_family), m_parallel_mng->commRank());
1265 for (auto local_id : cells_local_id) {
1267 cell_data.itemInfos()[i++] = (Int64)local_id;
1269 itemFamilyNetwork()->schedule([&item_data_list](IItemFamily* family) {
1271 family->removeItems2(item_data_list);
1273 IItemFamilyNetwork::TopologicalOrder);
1283 if (m_use_mesh_item_family_dependencies)
1284 m_cell_family->detachCells2(cells_local_id);
1287 for (
Integer i = 0, is = cells_local_id.
size(); i < is; ++i)
1288 m_cell_family->detachCell(cells[cells_local_id[i]]);
1299 if (m_use_mesh_item_family_dependencies)
1300 removeItems(m_cell_family, cells_local_id);
1303 for (
Integer i = 0, is = cells_local_id.
size(); i < is; ++i)
1304 m_cell_family->removeDetachedCell(cells[cells_local_id[i]]);
1328 m_mesh_refinement->flagCellToCoarsen(lids);
1339 _checkConnectivity();
1341 m_mesh_refinement->refineItems(
true);
1349 Trace::Setter mci(traceMng(), _className());
1351 _checkConnectivity();
1353 m_mesh_refinement->coarsenItems(
true);
1360coarsenItemsV2(
bool update_parent_flag)
1362 Trace::Setter mci(traceMng(), _className());
1364 _checkConnectivity();
1366 if (m_amr_type != eMeshAMRKind::Cell) {
1367 ARCANE_FATAL(
"This method is not compatible with Cartesian Mesh Patch AMR");
1369 m_mesh_refinement->coarsenItemsV2(update_parent_flag);
1378 Trace::Setter mci(traceMng(), _className());
1380 _checkConnectivity();
1382 if (m_mesh_refinement->needUpdate())
1383 m_mesh_refinement->update();
1384 return m_mesh_refinement->refineAndCoarsenItems(
true);
1393 _compactItems(
false,
true);
1400registerCallBack(IAMRTransportFunctor* f)
1402 Trace::Setter mci(traceMng(), _className());
1404 m_mesh_refinement->registerCallBack(f);
1410unRegisterCallBack(IAMRTransportFunctor* f)
1412 Trace::Setter mci(traceMng(), _className());
1414 m_mesh_refinement->unRegisterCallBack(f);
1421_allocateCells2(DynamicMeshIncrementalBuilder* mib)
1423 Trace::Setter mci(traceMng(), _className());
1425 _finalizeMeshChanged();
1429#ifdef ARCANE_DEBUG_DYNAMIC_MESH
1430 OCStringStream ostr;
1432 info() << ostr.str();
1440_writeMesh(
const String& base_name)
1442 StringBuilder file_name(base_name);
1444 IParallelMng* pm = m_parallel_mng;
1445 bool is_parallel = pm->isParallel();
1446 Int32 rank = meshRank();
1448 file_name += subDomain()->commonVariables().globalIteration();
1452 mesh_utils::writeMeshConnectivity(
this, file_name.toString());
1454 auto writer(ServiceBuilder<IMeshWriter>::createReference(subDomain(),
"Lima"));
1456 String mesh_file_name = file_name.toString() +
".mli";
1457 writer->writeMeshToFile(
this, mesh_file_name);
1465_printMesh(std::ostream& ostr)
1467 ostr <<
"----------- Mesh\n";
1468 ostr <<
" Nodes: " << nbNode() <<
'\n';
1469 ostr <<
" Edges: " << nbEdge() <<
'\n';
1470 ostr <<
" Faces: " << nbFace() <<
'\n';
1471 ostr <<
" Cells: " << nbCell() <<
'\n';
1472 mesh_utils::printItems(ostr,
"Nodes", allNodes());
1473 mesh_utils::printItems(ostr,
"Edges", allEdges());
1474 mesh_utils::printItems(ostr,
"Faces", allFaces());
1475 mesh_utils::printItems(ostr,
"Cells", allCells());
1486 info(4) <<
"DynamicMesh::_saveProperties() name=" <<
name()
1489 auto p = m_properties;
1490 p->setInt32(
"nb-ghostlayer",
ghostLayerMng()->nbGhostLayer());
1491 p->setInt32(
"ghostlayer-builder-version",
ghostLayerMng()->builderVersion());
1492 p->setInt32(
"part-info-part-rank", m_mesh_part_info.partRank());
1493 p->setInt32(
"part-info-nb-part", m_mesh_part_info.nbPart());
1494 p->setInt32(
"part-info-replication-rank", m_mesh_part_info.replicationRank());
1495 p->setInt32(
"part-info-nb-replication", m_mesh_part_info.nbReplication());
1496 p->setBool(
"has-itemsharedinfo-variables",
true);
1497 p->setInt64(
"mesh-timestamp", m_timestamp);
1498 if (!m_do_not_save_need_compact)
1499 p->setBool(
"need-compact", m_need_compact);
1510 auto p = m_properties;
1512 info(4) <<
"DynamicMesh::_readProperties() name=" <<
name()
1513 <<
" mesh-version=" << p->getInt32WithDefault(PROPERTY_MESH_VERSION, -1);
1518 if (p->get(
"nb-ghostlayer", x))
1520 if (p->get(
"ghostlayer-builder-version", x))
1522 if (p->get(
"part-info-part-rank", x))
1523 m_mesh_part_info.setPartRank(x);
1524 if (p->get(
"part-info-nb-part", x))
1525 m_mesh_part_info.setNbPart(x);
1526 if (p->get(
"part-info-replication-rank", x))
1527 m_mesh_part_info.setReplicationRank(x);
1528 if (p->get(
"part-info-nb-replication", x))
1529 m_mesh_part_info.setNbReplication(x);
1530 if (!m_do_not_save_need_compact) {
1532 if (p->get(
"need-compact", xb))
1533 m_need_compact = xb;
1536 if (p->get(
"mesh-timestamp", x2))
1549 bool want_dump = m_properties->getBool(PROPERTY_DUMP);
1550 info(4) <<
"DynamicMesh::prepareForDump() name=" <<
name()
1551 <<
" need_compact?=" << m_need_compact
1552 <<
" want_dump?=" << want_dump
1553 <<
" timestamp=" << m_timestamp;
1557 m_mesh_events.eventObservable(t).notify(
MeshEventArgs(
this, t));
1572 m_mesh_events.eventObservable(t).notify(
MeshEventArgs(
this, t));
1582_prepareForDumpReal()
1584 if (m_need_compact) {
1587 _compactItems(
true,
true);
1592 if (m_parent_mesh) {
1593 ARCANE_ASSERT((m_parent_group != NULL), (
"Unexpected NULL parent group"));
1598 ARCANE_ASSERT((m_parent_group == NULL), (
"Unexpected non-NULL parent group"));
1602 const Integer n_sub_mesh = m_child_meshes.size();
1604 for (
Integer i = 0; i < n_sub_mesh; ++i)
1622 family->prepareForDump();
1625 if (m_tied_interface_need_prepare_dump) {
1626 m_tied_interface_mng->prepareTiedInterfacesForDump();
1627 m_tied_interface_need_prepare_dump =
false;
1639 ARCANE_FATAL(
"Attempting to create a family that already exists '{0}'",
name);
1641 debug() <<
"Creating the entities family "
1647 _buildAndInitFamily(family);
1672 ARCANE_FATAL(
"Attempting to create an ItemFamily with an unknown item kind.");
1680IItemFamilyPolicyMng* DynamicMesh::
1681_createFamilyPolicyMng(ItemFamily* family)
1683 eItemKind kind = family->itemKind();
1686 return createNodeFamilyPolicyMng(family);
1688 return createEdgeFamilyPolicyMng(family);
1690 return createFaceFamilyPolicyMng(family);
1692 return createCellFamilyPolicyMng(family);
1694 return createParticleFamilyPolicyMng(family);
1696 return createDoFFamilyPolicyMng(family);
1698 ARCANE_FATAL(
"Attempting to create an ItemFamily with an unknown item kind.");
1707_buildAndInitFamily(IItemFamily* family)
1711 IItemFamilyPolicyMng* policy_mng = _createFamilyPolicyMng(true_family);
1712 true_family->setPolicyMng(policy_mng);
1719_addFamily(ItemFamily* family)
1721 m_item_families.add(family);
1722 m_true_item_families.add(family);
1730 bool register_modifier_if_created)
1733 if (family->name() ==
name && family->itemKind() == ik)
1735 if (create_if_needed) {
1737 if (register_modifier_if_created) {
1751findItemFamily(
const String&
name,
bool throw_exception)
1754 if (family->name() ==
name)
1756 if (throw_exception)
1780_exchangeItems(
bool do_compact)
1789 if (!nb_exchange_str.
null()) {
1790 bool is_bad = builtInGetValue(nb_exchange, nb_exchange_str);
1796 if (!exchange_version_str.
null()) {
1797 builtInGetValue(exchange_version, exchange_version_str);
1800 info() <<
"DynamicMesh::_echangeItems() do_compact?=" << do_compact
1801 <<
" nb_exchange=" << nb_exchange <<
" version=" << exchange_version;
1803 if (nb_exchange > 1) {
1804 _multipleExchangeItems(nb_exchange, exchange_version, do_compact);
1807 _exchangeItemsNew();
1812 if (ghostLayerMng()->nbGhostLayer() > 1 && !m_use_mesh_item_family_dependencies)
1813 updateGhostLayers(
true);
1814 String check_exchange = platform::getEnvironmentVariable(
"ARCANE_CHECK_EXCHANGE");
1815 if (!check_exchange.null()) {
1816 m_mesh_checker->checkGhostCells();
1817 pwarning() <<
"CHECKING SYNCHRONISATION !";
1818 m_mesh_checker->checkVariablesSynchronization();
1819 m_mesh_checker->checkItemGroupsSynchronization();
1821 if (checkLevel() >= 2)
1822 m_mesh_checker->checkValidMesh();
1823 else if (checkLevel() >= 1)
1824 m_mesh_checker->checkValidConnectivity();
1859_multipleExchangeItems(
Integer nb_exchange,
Integer version,
bool do_compact)
1861 if (version < 1 || version > 2)
1862 ARCANE_FATAL(
"Invalid value '{0}' for version. Valid values are 1 or 2", version);
1864 info() <<
"** ** MULTIPLE EXCHANGE ITEM version=" << version <<
" nb_exchange=" << nb_exchange;
1876 Int32 new_owner = cells_new_owner[icell];
1877 if (current_owner == new_owner)
1881 phase = (new_owner % nb_exchange);
1882 else if (version == 1)
1883 phase = icell.index() / nb_cell;
1884 cells_to_exchange_new_owner[phase].
add(new_owner);
1885 cells_to_exchange_uid[phase].
add(cell.
uniqueId().asInt64());
1891 cells_new_owner[icell] = cell.
owner();
1897 for (
Integer i = 0; i < nb_exchange; ++i) {
1901 info() <<
"MultipleExchange current_exchange=" << i <<
" nb_cell=" << nb_cell;
1902 uids_to_lids.
resize(nb_cell);
1907 for (
Integer z = 0; z < nb_cell; ++z)
1908 cells_new_owner[cells[uids_to_lids[z]]] = new_owners[z];
1909 cells_new_owner.synchronize();
1910 mesh()->utilities()->changeOwnersFromCells();
1911 _exchangeItemsNew();
1915 Timer::Action ts_action1(m_sub_domain,
"CompactItems",
true);
1916 bool do_sort = m_properties->getBool(PROPERTY_SORT);
1917 _compactItems(do_sort,
true);
1927 _exchangeItems(m_properties->getBool(PROPERTY_COMPACT));
1937 family->clearItems();
1944class ItemsExchangeInfo2List
1948 ~ItemsExchangeInfo2List()
1970 Trace::Setter mci(traceMng(), _className());
1975 m_need_compact =
true;
1977 if (arcane_debug_load_balancing) {
1980 m_node_family->itemsNewOwner().checkIfSync(10);
1981 m_edge_family->itemsNewOwner().checkIfSync(10);
1982 m_face_family->itemsNewOwner().checkIfSync(10);
1983 m_cell_family->itemsNewOwner().checkIfSync(10);
1988 typedef Collection<DynamicMesh*> DynamicMeshCollection;
1989 DynamicMeshCollection all_cascade_meshes = List<DynamicMesh*>();
1990 all_cascade_meshes.add(
this);
1991 for (Integer i = 0; i < m_child_meshes.size(); ++i)
1992 all_cascade_meshes.add(m_child_meshes[i]);
1994 IMeshExchanger* iexchanger = m_mesh_exchange_mng->beginExchange();
1995 MeshExchanger* mesh_exchanger =
ARCANE_CHECK_POINTER(
dynamic_cast<MeshExchanger*
>(iexchanger));
1998 if (mesh_exchanger->computeExchangeInfos()) {
1999 info() <<
"No load balance is performed";
2000 m_mesh_exchange_mng->endExchange();
2005 mesh_exchanger->processExchange();
2008 mesh_exchanger->removeNeededItems();
2014 auto action = [](ItemGroup& group) {
2018 if (group.internal()->hasComputeFunctor() || group.isLocalToSubDomain())
2021 group.internal()->removeSuppressedItems();
2023 for (DynamicMesh* mesh : all_cascade_meshes) {
2024 meshvisitor::visitGroups(mesh, action);
2036 for (DynamicMesh* child_mesh : m_child_meshes)
2037 child_mesh->m_submesh_tools->removeDeadGhostCells();
2039 for (Integer i_child_mesh = 0; i_child_mesh < m_child_meshes.size(); ++i_child_mesh)
2040 m_child_meshes[i_child_mesh]->m_submesh_tools->removeDeadGhostCells();
2044 mesh_exchanger->allocateReceivedItems();
2048 for (DynamicMesh* mesh : all_cascade_meshes)
2049 mesh->_internalEndUpdateInit(
true);
2051 mesh_exchanger->updateItemGroups();
2054 for (DynamicMesh* mesh : all_cascade_meshes)
2055 mesh->_computeGroupSynchronizeInfos();
2058 mesh_exchanger->updateVariables();
2061 for (DynamicMesh* mesh : all_cascade_meshes) {
2063 bool print_info = (mesh ==
this);
2064 mesh->_internalEndUpdateFinal(print_info);
2070 mesh_exchanger->finalizeExchange();
2073 m_mesh_exchange_mng->endExchange();
2081 if (m_extra_ghost_cells_builder->hasBuilder() || m_extra_ghost_particles_builder->hasBuilder())
2082 this->endUpdate(
true,
false);
2093 m_extra_ghost_cells_builder->addExtraGhostCellsBuilder(builder);
2102 m_extra_ghost_cells_builder->removeExtraGhostCellsBuilder(builder);
2111 m_extra_ghost_particles_builder->addExtraGhostParticlesBuilder(builder);
2120 m_extra_ghost_particles_builder->removeExtraGhostParticlesBuilder(builder);
2127_computeExtraGhostCells()
2129 m_extra_ghost_cells_builder->computeExtraGhostCells();
2136_computeExtraGhostParticles()
2138 m_extra_ghost_particles_builder->computeExtraGhostParticles();
2147 const Int32 sid = meshRank();
2152 UniqueArray<Int32> cells_to_remove;
2153 cells_to_remove.reserve(1000);
2155 ItemInternalMap& cells_map = m_cell_family->itemsMap();
2156 cells_map.eachItem([&](Item cell) {
2157 if (cell.owner() != sid)
2158 cells_to_remove.add(cell.localId());
2161 info() <<
"Number of cells to remove: " << cells_to_remove.size();
2162 m_cell_family->removeCells(cells_to_remove);
2165 _updateGroupsAfterRemove();
2174_updateGroupsAfterRemove()
2176 auto action = [&](
const ItemGroup& group) { group.itemFamily()->partialEndUpdateGroup(group); };
2177 meshvisitor::visitGroups(
this, action);
2193updateGhostLayers(
bool remove_old_ghost)
2202 _internalUpdateGhost(
true, remove_old_ghost);
2203 _internalEndUpdateInit(
true);
2204 _synchronizeGroups();
2205 _computeGroupSynchronizeInfos();
2206 _internalEndUpdateResizeVariables();
2207 _synchronizeVariables();
2208 _internalEndUpdateFinal(
true);
2211 for (
Integer i = 0; i < m_child_meshes.size(); ++i) {
2212 m_child_meshes[i]->endUpdate(
true, remove_old_ghost);
2219_removeGhostChildItems()
2221 const Int32 sid = meshRank();
2224 UniqueArray<Int32> cells_to_remove;
2225 cells_to_remove.reserve(1000);
2227 ItemInternalMap& cells_map = m_cell_family->itemsMap();
2228 Integer max_level = 0;
2229 cells_map.eachItem([&](impl::ItemBase cell) {
2230 if ((cell.owner() != sid) && (cell.level() != 0))
2231 max_level = math::max(cell.level(), max_level);
2237 cells_map.eachItem([&](impl::ItemBase cell) {
2238 if ((cell.owner() != sid) && (cell.level() == max_level)) {
2239 cells_to_remove.add(cell.localId());
2243 info() <<
"Number of cells to remove: " << cells_to_remove.size();
2244 m_cell_family->removeCells(cells_to_remove);
2247 _updateGroupsAfterRemove();
2254_removeGhostChildItems2(Array<Int64>& cells_to_coarsen)
2256 const Int32 sid = meshRank();
2258 cells_to_coarsen.reserve(1000);
2261 UniqueArray<Cell> cells_to_remove;
2262 cells_to_remove.reserve(1000);
2264 ItemInternalMap& cells_map = m_cell_family->itemsMap();
2266 cells_map.eachItem([&](Cell cell) {
2267 if (cell.owner() != sid)
2269 if (cell.hasFlags(ItemFlags::II_JustCoarsened)) {
2270 cells_to_coarsen.add(cell.uniqueId());
2271 for (Integer c = 0, cs = cell.nbHChildren(); c < cs; c++) {
2272 cells_to_remove.add(cell.hChild(c));
2282 for (Integer i = 0, is = cells_to_remove.size(); i < is; ++i)
2283 m_cell_family->removeCell(cells_to_remove[i]);
2286 _updateGroupsAfterRemove();
2293updateGhostLayerFromParent(
Array<Int64>& ghost_cell_to_refine_uid,
2294 Array<Int64>& ghost_cell_to_coarsen_uid,
bool remove_old_ghost)
2297 CHECKPERF(m_perf_counter.start(PerfCounter::UPGHOSTLAYER1));
2299 m_need_compact =
true;
2304 if (remove_old_ghost) {
2305 _removeGhostChildItems2(ghost_cell_to_coarsen_uid);
2309 m_face_family->setCheckOrientation(
false);
2311 m_mesh_builder->addGhostChildFromParent(ghost_cell_to_refine_uid);
2312 m_face_family->setCheckOrientation(
true);
2316 m_mesh_builder->printStats();
2317 CHECKPERF(m_perf_counter.stop(PerfCounter::UPGHOSTLAYER1))
2319 CHECKPERF(m_perf_counter.start(PerfCounter::UPGHOSTLAYER2))
2324 family->endUpdate();
2326 CHECKPERF(m_perf_counter.stop(PerfCounter::UPGHOSTLAYER2))
2330 CHECKPERF(m_perf_counter.start(PerfCounter::UPGHOSTLAYER3))
2336 CHECKPERF(m_perf_counter.stop(PerfCounter::UPGHOSTLAYER3))
2342 CHECKPERF(m_perf_counter.start(PerfCounter::UPGHOSTLAYER4))
2344 _synchronizeGroupsAndVariables();
2345 CHECKPERF(m_perf_counter.stop(PerfCounter::UPGHOSTLAYER4))
2348 CHECKPERF(m_perf_counter.start(PerfCounter::UPGHOSTLAYER5))
2350 m_cell_family->itemsUniqueIdToLocalId(ghost_cell_to_refine_lid, ghost_cell_to_refine_uid,
true);
2352 for (
Integer e = 0, i_size = ghost_cell_to_refine_lid.
size(); e != i_size; ++e) {
2353 Cell i_hParent_cell(cells[ghost_cell_to_refine_lid[e]]);
2359 for (
Integer iface = 0; iface < nb_face; ++iface) {
2360 Face face = i_hParent_cell.
face(iface);
2362 for (
Integer icell = 0; icell < nb_cell; ++icell) {
2366 m_face_family->familyTree(childs, cell,
false);
2367 for (
Integer i = 0, nchilds = childs.
size(); i < nchilds; ++i) {
2376 CHECKPERF(m_perf_counter.stop(PerfCounter::UPGHOSTLAYER5))
2379 CHECKPERF(m_perf_counter.start(PerfCounter::UPGHOSTLAYER6))
2380 m_mesh_checker->checkMeshFromReferenceFile();
2387 bool do_compact = m_properties->getBool(PROPERTY_COMPACT);
2389 bool do_sort = m_properties->getBool(PROPERTY_SORT);
2390 _compactItems(do_sort, do_compact);
2392 CHECKPERF(m_perf_counter.stop(PerfCounter::UPGHOSTLAYER6))
2394 if (arcane_debug_load_balancing) {
2395 _writeMesh(
"update-ghost-layer-after");
2402 pinfo() <<
"Proc: " << meshRank()
2403 <<
" cellown=" << m_cell_family->allItems().own().size()
2404 <<
" cellloc=" << m_cell_family->allItems().size();
2408 CHECKPERF(m_perf_counter.start(PerfCounter::UPGHOSTLAYER7))
2410 m_mesh_checker->updateAMRFaceOrientation(ghost_cell_to_refine_uid);
2412 if (m_mesh_checker->checkLevel() >= 1)
2413 m_mesh_checker->checkValidConnectivity();
2414 CHECKPERF(m_perf_counter.stop(PerfCounter::UPGHOSTLAYER7))
2416#ifdef ACTIVATE_PERF_COUNTER
2417 m_perf_counter.printInfo(
info().file());
2425_internalUpdateGhost(
bool update_ghost_layer,
bool remove_old_ghost)
2427 m_need_compact =
true;
2431 if (update_ghost_layer)
2432 m_submesh_tools->updateGhostMesh();
2435 if (update_ghost_layer) {
2436 if (remove_old_ghost) {
2437 _removeGhostItems();
2440 m_face_family->setCheckOrientation(
false);
2441 m_mesh_builder->addGhostLayers(
false);
2442 m_face_family->setCheckOrientation(
true);
2443 _computeExtraGhostCells();
2444 _computeExtraGhostParticles();
2453_internalEndUpdateInit(
bool update_ghost_layer)
2460 _finalizeMeshChanged();
2465 if (update_ghost_layer) {
2466 info() <<
"ComputeSyncInfos date=" << platform::getCurrentDateTime();
2467 _computeFamilySynchronizeInfos();
2475_internalEndUpdateResizeVariables()
2478 for (IItemFamily* family : m_item_families)
2479 family->_internalApi()->resizeVariables(
true);
2486_internalEndUpdateFinal(
bool print_stat)
2489 m_mesh_checker->checkMeshFromReferenceFile();
2497 _compactItemInternalReferences();
2500 bool do_compact = m_properties->getBool(PROPERTY_COMPACT);
2501 info(4) <<
"DynamicMesh::_internalEndUpdateFinal() compact?=" << do_compact <<
" sort?=" << m_properties->getBool(PROPERTY_SORT);
2503 bool do_sort = m_properties->getBool(PROPERTY_SORT);
2504 _compactItems(do_sort, do_compact);
2509 _notifyEndUpdateForFamilies();
2513 if (m_properties->getBool(PROPERTY_DISPLAY_STATS)) {
2521 m_mesh_checker->updateAMRFaceOrientation();
2523 if (m_mesh_checker->checkLevel() >= 1)
2524 m_mesh_checker->checkValidConnectivity();
2531_notifyEndUpdateForFamilies()
2534 family->_internalApi()->notifyEndUpdateFromMesh();
2550endUpdate(
bool update_ghost_layer,
bool remove_old_ghost)
2564 _internalUpdateGhost(update_ghost_layer, remove_old_ghost);
2566 _internalEndUpdateInit(update_ghost_layer);
2567 if (update_ghost_layer) {
2568 _synchronizeGroups();
2569 _computeGroupSynchronizeInfos();
2571 _internalEndUpdateResizeVariables();
2572 if (update_ghost_layer) {
2573 _synchronizeVariables();
2575 _internalEndUpdateFinal(
false);
2578 for (DynamicMesh* child_mesh : m_child_meshes)
2579 child_mesh->endUpdate(update_ghost_layer, remove_old_ghost);
2586synchronizeGroupsAndVariables()
2588 _synchronizeGroupsAndVariables();
2592 for (DynamicMesh* child_mesh : m_child_meshes)
2593 child_mesh->synchronizeGroupsAndVariables();
2600_synchronizeGroupsAndVariables()
2602 _synchronizeGroups();
2603 _synchronizeVariables();
2613 ItemGroupsSynchronize igs(m_node_family);
2617 ItemGroupsSynchronize igs(m_edge_family);
2621 ItemGroupsSynchronize igs(m_face_family);
2625 ItemGroupsSynchronize igs(m_cell_family);
2629 for (IItemFamily* family : m_item_families) {
2630 if (family->itemKind() == IK_Particle) {
2631 IParticleFamily* pfamily = family->toParticleFamily();
2632 if (pfamily && pfamily->getEnableGhostItems()) {
2633 ItemGroupsSynchronize igs(family);
2645_synchronizeVariables()
2657 typedef UniqueArray<IVariableSynchronizer*> OrderedSyncList;
2658 typedef std::map<IVariableSynchronizer*, VariableCollection> SyncList;
2659 OrderedSyncList ordered_sync_list;
2662 VariableCollection used_vars(subDomain()->variableMng()->usedVariables());
2663 for (VariableCollection::Enumerator i_var(used_vars); ++i_var;) {
2664 IVariable* var = *i_var;
2665 switch (var->itemKind()) {
2671 IVariableSynchronizer* synchronizer = 0;
2672 if (var->isPartial())
2673 synchronizer = var->itemGroup().synchronizer();
2675 synchronizer = var->itemFamily()->allItemsSynchronizer();
2676 IMesh* sync_mesh = synchronizer->itemGroup().mesh();
2677 if (sync_mesh !=
this)
2679 std::pair<SyncList::iterator, bool> inserter = sync_list.insert(std::make_pair(synchronizer, VariableCollection()));
2680 if (inserter.second) {
2681 ordered_sync_list.add(synchronizer);
2683 VariableCollection& collection = inserter.first->second;
2684 collection.add(var);
2692 for (Integer i_sync = 0; i_sync < ordered_sync_list.size(); ++i_sync) {
2693 IVariableSynchronizer* synchronizer = ordered_sync_list[i_sync];
2694 VariableCollection& collection = sync_list[synchronizer];
2695 synchronizer->synchronize(collection);
2703_sortInternalReferences()
2706 m_node_family->sortInternalReferences();
2713_finalizeMeshChanged()
2716 for (IItemFamily* family : m_item_families) {
2717 debug() <<
"_finalizeMeshChanged on " << family->name() <<
" Family on Mesh " << name();
2718 family->endUpdate();
2721 bool do_sort = m_properties->getBool(PROPERTY_SORT);
2723 _sortInternalReferences();
2724 m_tied_interface_need_prepare_dump =
true;
2731_applyCompactPolicy(
const String& timer_name,
2732 std::function<
void(IItemFamilyCompactPolicy*)> functor)
2734 Timer::Action ts_action(m_sub_domain, timer_name);
2735 for (IItemFamily* family : m_item_families) {
2736 IItemFamilyCompactPolicy* c = family->policyMng()->compactPolicy();
2746_compactItemInternalReferences()
2748 _applyCompactPolicy(
"CompactConnectivityData", [&](IItemFamilyCompactPolicy* c) { c->compactConnectivityData(); });
2755_compactItems(
bool do_sort,
bool compact_variables_and_groups)
2758 info(4) <<
"Compress and sort the mesh entities " << name() <<
".";
2760 info(4) <<
"Compress the mesh entities " << name() <<
".";
2762 IMeshCompacter* compacter = m_mesh_compact_mng->beginCompact();
2765 compacter->setSorted(do_sort);
2766 compacter->_setCompactVariablesAndGroups(compact_variables_and_groups);
2768 compacter->doAllActions();
2771 m_mesh_compact_mng->endCompact();
2774 m_mesh_compact_mng->endCompact();
2777 Timer::Action ts_action(m_sub_domain,
"CompactItemSortReferences");
2780 _sortInternalReferences();
2783 m_need_compact =
false;
2794setEstimatedCells(Integer nb_cell0)
2797 if (m_parallel_mng->isParallel())
2800 Integer nb_node = Convert::toInteger(nb_cell0 * 1.2 * factor);
2801 Integer nb_edge = Convert::toInteger(nb_cell0 * 6.8 * factor);
2802 Integer nb_face = Convert::toInteger(nb_cell0 * 3.4 * factor);
2803 Integer nb_cell = Convert::toInteger(nb_cell0 * 1.0 * factor);
2804 info() <<
"Estimating the number of entities:"
2805 <<
" Node=" << nb_node
2806 <<
" Edge=" << nb_edge
2807 <<
" Face=" << nb_face
2808 <<
" Cell=" << nb_cell;
2809 m_node_family->preAllocate(nb_node);
2810 m_edge_family->preAllocate(nb_edge);
2811 m_face_family->preAllocate(nb_face);
2812 m_cell_family->preAllocate(nb_cell);
2836 ARCANE_ASSERT((m_parent_mesh != NULL), (
"Unexpected NULL Mesh"));
2840 m_child_meshes.resize(n_sub_mesh);
2841 for (
Integer i = 0; i < n_sub_mesh; ++i) {
2843 DynamicMesh* dynamic_child_mesh =
dynamic_cast<DynamicMesh*
>(child_mesh);
2844 if (dynamic_child_mesh == 0)
2845 ARCANE_FATAL(
"Cannot associate sub mesh from a different concrete type");
2846 m_child_meshes[i] = dynamic_child_mesh;
2852 for (
Integer i = 0; i < nb_item_family; ++i) {
2853 info(5) <<
"Found family: I=" << i
2862 for (
Integer i = 0; i < nb_item_family; ++i) {
2870 if (!m_is_sub_connectivity_set)
2871 _setSubConnectivity();
2874 family->readFromDump();
2878 _notifyEndUpdateForFamilies();
2881 m_item_internal_list.nodes = m_node_family->itemsInternal();
2882 m_item_internal_list.edges = m_edge_family->itemsInternal();
2883 m_item_internal_list.faces = m_face_family->itemsInternal();
2884 m_item_internal_list.cells = m_cell_family->itemsInternal();
2885 m_item_internal_list.mesh =
this;
2887 m_tied_interface_mng->readTiedInterfacesFromDump();
2889 m_mesh_builder->readFromDump();
2899 return m_tied_interface_mng->hasTiedInterface();
2908 return m_tied_interface_mng->tiedInterfaces();
2917 return m_tied_interface_mng->trueTiedInterfaces();
2924computeTiedInterfaces(
const XmlNode& mesh_node)
2926 m_tied_interface_mng->computeTiedInterfaces(mesh_node);
2936 _checkConnectivity();
2946 ARCANE_FATAL(
"DynamicMesh::setDimension(): mesh is already allocated");
2947 info() <<
"Mesh name=" << name() <<
" set dimension = " << dim;
2948 m_mesh_dimension = dim;
2949 const bool is_non_manifold = meshKind().isNonManifold();
2952 if (is_non_manifold) {
2953 info() <<
"Force no-renumbering of edge and face uid because we are using non manifold mesh";
2954 m_mesh_unique_id_mng->setFaceBuilderVersion(0);
2955 m_mesh_unique_id_mng->setEdgeBuilderVersion(0);
2957 bool v = m_mesh_unique_id_mng->isUseNodeUniqueIdToGenerateEdgeAndFaceUniqueId();
2963 if (!v && is_non_manifold) {
2965 info() <<
"Force using edge and face uid generation from nodes because we are using non manifold mesh";
2967 if (m_mesh_builder) {
2968 auto* adder = m_mesh_builder->oneMeshItemAdder();
2970 adder->setUseNodeUniqueIdToGenerateEdgeAndFaceUniqueId(v);
2974 if (dim == 3 && is_non_manifold) {
2975 Connectivity c(m_mesh_connectivity);
2976 if (!c.hasConnectivity(Connectivity::CT_HasEdge)) {
2977 c.enableConnectivity(Connectivity::CT_HasEdge);
2978 info() <<
"Force creating edges for 3D non-manifold mesh";
2987_checkDimension()
const
2989 if (m_mesh_dimension() < 0)
2990 ARCANE_FATAL(
"dimension not set. setDimension() must be called before allocating cells");
2999 Connectivity c(m_mesh_connectivity);
3000 if (!c.isFrozen()) {
3002 debug() <<
"Mesh " << name() <<
" connectivity : " << Connectivity::Printer(m_mesh_connectivity());
3003 _setSubConnectivity();
3004 _updateItemFamilyDependencies(m_mesh_connectivity);
3014 if (!m_is_amr_activated)
3015 ARCANE_FATAL(
"DynamicMesh::_checkAMR(): amr activator not set.\t"
3016 "amr='true' must be set in the .arc file");
3023_setSubConnectivity()
3025 m_mesh_builder->setConnectivity(m_mesh_connectivity());
3026 m_node_family->setConnectivity(m_mesh_connectivity());
3027 m_edge_family->setConnectivity(m_mesh_connectivity());
3028 m_face_family->setConnectivity(m_mesh_connectivity());
3029 m_cell_family->setConnectivity(m_mesh_connectivity());
3030 m_is_sub_connectivity_set =
true;
3037_writeCells(
const String& filename)
3039 CellGroup cells(m_cell_family->allItems());
3040 std::ofstream ofile(filename.localstr());
3043 ofile <<
"CELL: uid=" << cell.uniqueId() <<
" isown="
3044 << cell.isOwn() <<
" owner=" << cell.owner() <<
'\n';
3054 return m_node_family->nodesCoordinates();
3061sharedNodesCoordinates()
3073_setOwnersFromCells()
3095 const Integer sid = subDomain()->subDomainId();
3098 if (m_new_item_owner_builder == NULL)
3104 Node node = *i_node;
3105 nodes_owner[node] = m_new_item_owner_builder->ownerOfItem(node);
3107 nodes_owner.synchronize();
3111 Node node = *i_node;
3118 Edge edge = *i_edge;
3119 edges_owner[edge] = m_new_item_owner_builder->ownerOfItem(edge);
3121 edges_owner.synchronize();
3125 Edge edge = *i_edge;
3126 edge.mutableItemBase().setOwner(edges_owner[edge], sid);
3132 Face face = *i_face;
3133 faces_owner[face] = m_new_item_owner_builder->ownerOfItem(face);
3135 faces_owner.synchronize();
3139 Face face = *i_face;
3140 face.mutableItemBase().setOwner(faces_owner[face], sid);
3143 nodeFamily()->notifyItemsOwnerChanged();
3144 edgeFamily()->notifyItemsOwnerChanged();
3145 faceFamily()->notifyItemsOwnerChanged();
3146 _computeFamilySynchronizeInfos();
3155 if (!m_mesh_utilities)
3157 return m_mesh_utilities;
3166 return m_cell_family->allItems().outerFaceGroup();
3177 return m_cell_family->allItems().activeCellGroup();
3185 return m_cell_family->allItems().ownActiveCellGroup();
3191allLevelCells(
const Integer& level)
3193 return m_cell_family->allItems().levelCellGroup(level);
3199ownLevelCells(
const Integer& level)
3201 return m_cell_family->allItems().ownLevelCellGroup(level);
3209 return m_cell_family->allItems().activeFaceGroup();
3217 return m_cell_family->allItems().ownActiveFaceGroup();
3228 return m_cell_family->allItems().innerActiveFaceGroup();
3236 return m_cell_family->allItems().outerActiveFaceGroup();
3252 ARCANE_FATAL(
"Cannot set inconsistant mesh/group parents to mesh '{0}'",
name());
3254 if (m_parent_mesh) {
3255 if (m_parent_mesh !=
mesh)
3256 ARCANE_FATAL(
"Mesh '{0}' already has parent mesh '{1}'",
name(), m_parent_mesh->name());
3257 if (m_parent_group != group.
internal())
3258 ARCANE_FATAL(
"Mesh '{0}' already has parent group '{1}'",
name(), m_parent_group->name());
3261 m_parent_mesh =
mesh;
3266 dimension_shift = 1;
3269 dimension_shift = 0;
3272 ARCANE_FATAL(
"Only SubMesh on FaceGroup or CellGoup is allowed");
3275 _setDimension(
mesh->dimension() - dimension_shift);
3278 const eItemKind kind = family->itemKind();
3283 family->setParentFamily(
mesh->itemFamily(parent_kind));
3296partitionConstraintMng()
3298 return m_partition_constraint_mng;
3307 return m_parent_mesh;
3323addChildMesh(
IMesh* sub_mesh)
3325 DynamicMesh* dynamic_child_mesh =
dynamic_cast<DynamicMesh*
>(sub_mesh);
3326 if (!dynamic_child_mesh)
3327 ARCANE_FATAL(
"Cannot associate sub mesh from a different concrete type");
3328 for (
Integer i = 0; i < m_child_meshes.size(); ++i)
3329 if (m_child_meshes[i] == dynamic_child_mesh)
3331 m_child_meshes.add(dynamic_child_mesh);
3341 for (
Integer i = 0; i < m_child_meshes.size(); ++i) {
3342 collection.add(m_child_meshes[i]);
3353 return m_mesh_checker;
3360isPrimaryMesh()
const
3382 return m_node_family->nbItem();
3387 return m_edge_family->nbItem();
3392 return m_face_family->nbItem();
3397 return m_cell_family->nbItem();
3403 return m_node_family;
3409 return m_edge_family;
3415 return m_face_family;
3421 return m_cell_family;
3424DynamicMeshKindInfos::ItemInternalMap& DynamicMesh::
3427 return m_node_family->itemsMap();
3430DynamicMeshKindInfos::ItemInternalMap& DynamicMesh::
3433 return m_edge_family->itemsMap();
3436DynamicMeshKindInfos::ItemInternalMap& DynamicMesh::
3439 return m_face_family->itemsMap();
3442DynamicMeshKindInfos::ItemInternalMap& DynamicMesh::
3445 return m_cell_family->itemsMap();
3457 true_meshes.
add(true_mesh);
3460 merger.mergeMeshes(true_meshes);
3467_printConnectivityPolicy()
3469 info() <<
"Connectivity policy=" << (int)m_connectivity_policy;
3472 ARCANE_FATAL(
"Invalid value '{0}' for InternalConnectivityPolicy. Only '{1}' is allowed",
3482 m_mesh_part_info = mpi;
3492 if (!m_item_family_network)
3495 for (
const auto& con : m_item_family_network->getConnectivities()) {
3496 if (c.hasConnectivity(c.kindsToConnectivity(con->sourceFamily()->itemKind(), con->targetFamily()->itemKind()))) {
3497 m_item_family_network->setIsStored(con);
3508 return m_internal_api.get();
3515_modifierInternalApi()
3517 return m_internal_api.get();
3524computeSynchronizeInfos()
3526 _computeSynchronizeInfos();
3532class ARCANE_MESH_EXPORT DynamicMeshFactoryBase
3557 if (is_submesh && m_is_amr)
3570class ARCANE_MESH_EXPORT DynamicMeshFactory
3571:
public DynamicMeshFactoryBase
3576 : DynamicMeshFactoryBase(sbi,
false)
3583class ARCANE_MESH_EXPORT DynamicAMRMeshFactory
3584:
public DynamicMeshFactoryBase
3589 : DynamicMeshFactoryBase(sbi,
true)
#define ARCANE_FATAL_IF(const,...)
Macro throwing a FatalErrorException if cond is true.
#define ARCANE_CHECK_POINTER(ptr)
Macro returning the pointer ptr if it is not null or throwing an exception if it is null.
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
Utility functions for the mesh.
void writeMeshConnectivity(IMesh *mesh, const String &file_name)
Writes the connectivity of the mesh mesh to the file file_name.
#define ARCANE_SERVICE_INTERFACE(ainterface)
Macro to declare an interface when registering a service.
Integer size() const
Number of elements in the vector.
AbstractService(const ServiceBuildInfo &)
Constructor from a ServiceBuildInfo.
Base class for 1D data vectors.
ConstReferenceType operator[](Int64 i) const
Element at index i.
void resize(Int64 s)
Changes the number of elements in the array to s.
void clear()
Removes the elements from the array.
void add(ConstReferenceType val)
Adds element val to the end of the array.
Exception when a conversion from one type to another is invalid.
Face face(Int32 i) const
i-th face of the cell
Int32 nbFace() const
Number of faces of the cell.
EnumeratorT< ItemGroup > Enumerator
Manages the retrieval of connectivity information.
Constant view of an array of type T.
constexpr Integer size() const noexcept
Number of elements in the array.
constexpr bool empty() const noexcept
true if the array is empty (size()==0)
Cell cell(Int32 i) const
i-th cell of the face
Int32 nbCell() const
Number of cells of the face (1 or 2).
Interface of a part of a dataset.
virtual XmlNode rootElement()=0
Returns the root element.
Interface of a builder for "extraordinary" ghost cells.
Interface for modifying a family.
Interface of an entity family.
virtual ItemGroup findGroup(const String &name) const =0
Searches for a group.
virtual ItemInternalArrayView itemsInternal()=0
Internal array of entities.
virtual String name() const =0
Family name.
virtual ItemVectorView view(Int32ConstArrayView local_ids)=0
View on the entities.
virtual void itemsUniqueIdToLocalId(Int32ArrayView local_ids, Int64ConstArrayView unique_ids, bool do_fatal=true) const =0
Converts an array of unique numbers to local numbers.
virtual VariableItemInt32 & itemsNewOwner()=0
Variable containing the number of the new subdomain owning the entity.
Interface for mesh verification methods.
Interface of the service managing mesh reading.
virtual IVariableMng * variableMng() const =0
Variable manager associated with this manager.
virtual MeshHandle * findMeshHandle(const String &name, bool throw_exception)=0
Searches for the mesh with name name.
Internal part of IMeshModifier.
Interface of a mesh partitioning constraint manager.
Interface of a class providing utility functions on meshes.
Interface of the parallelism manager for a subdomain.
@ ModePut
The serializer expects reserve().
@ ModeGet
The serializer expects get().
virtual void allocateBuffer()=0
Allocates the serializer memory.
virtual void setMode(eMode new_mode)=0
Sets the current mode.
Interface of the subdomain manager.
Interface managing execution time statistics.
virtual void dumpTimeAndMemoryUsage(IParallelMng *pm)=0
Displays the current date and memory consumption.
virtual ISubDomain * internalSubDomain() const =0
Temporary internal function to retrieve the subdomain.
Variable manager interface.
virtual VariableCollection usedVariables()=0
List of used variables.
virtual IVariable * findMeshVariable(IMesh *mesh, const String &name)=0
Returns the mesh variable named name or 0 if no such name exists.
virtual IObservable * writeObservable()=0
Observable for variables being written.
virtual IVariableMngInternal * _internalApi()=0
Internal Arcane API.
virtual IObservable * readObservable()=0
Observable for variables being read.
virtual bool initialize(const ItemGroup &group, const String &value)=0
Initializes the variable on a group.
virtual void resizeFromGroup()=0
Sets the number of elements for a mesh variable.
virtual bool isUsed() const =0
Usage state of the variable.
virtual IItemFamily * itemFamily() const =0
Associated entity family.
virtual String name() const =0
Variable name.
ItemGroupImpl * internal() const
Returns the group implementation.
eItemKind itemKind() const
Group kind. This is the kind of its elements.
bool null() const
true means the group is the null group
IMesh * mesh() const
Mesh to which this group belongs (0 for the null group).
Internal structure of a mesh entity.
Index of an Item in a variable.
Base class for a mesh element.
impl::MutableItemBase mutableItemBase() const
Mutable internal part of the entity.
constexpr Int32 localId() const
Local identifier of the entity in the processor subdomain.
Int32 owner() const
Owner subdomain number of the entity.
ItemUniqueId uniqueId() const
Unique identifier across all domains.
constexpr bool isOwn() const
true if the entity belongs to the subdomain
Implementation of a collection of elements in vector form.
Parameters necessary for building a mesh.
const ItemGroup & parentGroup() const
Parent group in the case of a sub-mesh, null otherwise.
const MeshKind meshKind() const
Mesh characteristics.
MeshBuildInfo & addMeshKind(const MeshKind &v)
Sets the mesh characteristics.
Arguments for mesh events.
IMesh * mesh() const
Associated mesh.
Characteristics of a mesh.
Arguments for IMeshModifier::addCells().
Arguments for IMeshModifier::addFaces().
Information about a partitioned mesh.
void dumpStats() override
Prints mesh information.
static eItemKind kindTranspose(eItemKind kindA, IMesh *meshA, IMesh *meshB)
Transpose the kind kindA of mesh meshA to the associated kind in meshB.
void setOwner(Integer suid, Int32 current_sub_domain)
Sets the sub-domain number of the entity owner.
Encapsulation of an automatically destructing pointer.
Structure containing the information to create a service.
Service creation properties.
Unicode character string.
bool null() const
Returns true if the string is null.
Positions the name of the currently executing action.
Sentinel for the timer. The sentinel associated with a timer allows it to be triggered upon its const...
@ TimerReal
Timer using real time.
Real lastActivationTime() const
Returns the time (in seconds) spent during the last activation of the timer.
TraceMessageDbg debug(Trace::eDebugLevel=Trace::Medium) const
Flow for a debug message.
TraceMessage pinfo() const
Flow for a parallel information message.
TraceMessage info() const
Flow for an information message.
TraceMessage error() const
Flow for an error message.
1D data vector with value semantics (STL style).
Utility functions for a mesh.
Function each(Function f)
Applies the functor f to all elements in the collection.
List of nodes of a DOM tree.
XmlNodeList children(const String &name) const
Set of child nodes of this node having the name name.
bool null() const
True if the node is null.
IPrimaryMesh * createMesh(IMeshMng *mm, const MeshBuildInfo &build_info) override
Creates a mesh with the information from build_info.
void build() override
Build-level construction of the service.
Construction of a mesh incrementally.
Information for mesh exchange between subdomains.
Implementation of a mesh.
IPrimaryMesh * toPrimaryMesh() override
Returns the instance in the form of an IPrimaryMesh.
void computeSynchronizeInfos() override
Recalculates synchronization information.
IItemFamily * nodeFamily() override
Returns the node family.
IItemFamily * cellFamily() override
Returns the cell family.
void endAllocate() override
Indicates the end of cell allocation.
ITraceMng * traceMng() override
Associated message manager.
IParallelMng * parallelMng() override
Parallelism manager.
bool isPrimaryMesh() const override
Indicates if the instance is a primary mesh.
IMesh * mesh() override
Associated mesh.
VariableNodeReal3 & nodesCoordinates() override
Node coordinates.
IItemFamily * createItemFamily(eItemKind ik, const String &name) override
Create a particle family named name.
String name() const override
Mesh name.
IMeshMng * meshMng() const override
Associated mesh manager.
void _readFromDump()
Reloads the mesh from protected variables.
IMeshModifier * modifier() override
Associated modifier interface.
void clearItems() override
Deletes all entities of all families in this mesh.
void updateGhostLayers() override
ItemFamilyList m_item_families
List of entity family interfaces.
IGhostLayerMng * ghostLayerMng() const override
Associated ghost layer manager.
void endUpdate() override
Notifies the instance that mesh modification is finished.
void destroyGroups() override
Destroys all groups of all families.
void _saveProperties()
Saves properties before a dump.
IItemFamily * findItemFamily(eItemKind ik, const String &name, bool create_if_needed, bool register_modifier_if_created) override
Returns the family named name.
Properties * properties() override
Properties associated with this mesh.
CellGroup ownCells() override
Group of all domain-specific cells.
IItemFamilyNetwork * itemFamilyNetwork() override
Family network interface (connected families).
IMesh * parentMesh() const override
Access to the parent mesh.
void _loadProperties()
Reloads properties from a dump.
void checkValidMesh() override
Check for the validity of internal mesh structures (internal).
void _prepareForDump()
Prepares variables for a dump.
void _prepareForDumpReal()
Prepares variables for a dump.
ItemGroupList m_all_groups
List of entity groups.
bool m_is_amr_activated
AMR.
MeshRefinement * m_mesh_refinement
AMR.
void addFaces(Integer nb_face, Int64ConstArrayView face_infos, Int32ArrayView faces) override
Adds faces.
Interface for the manager of incremental connectivities indexed on entities.
void executeExtend(const Int32ConstArrayView *new_items_info)
Execute the action associated with the extension.
Information for exchanging entities of a given family and their characteristics.
Manager for compacting families of a mesh.
Interface for the mesh exchange manager between subdomains.
Mesh partitioning constraint manager.
Implementation of unstructured mesh refinement adaptation algorithms.
Mesh uniqueId() numbering manager.
Variables containing the information of connectivities common to 1D, 2D, and 3D meshes.
VariableArrayString m_item_families_name
Names of entity families.
VariableArrayString m_child_meshes_name
Names of parent meshes.
VariableArrayInteger m_item_families_kind
Kind of entities in the families.
VariableScalarString m_parent_mesh_name
Name of the parent mesh.
VariableScalarString m_parent_group_name
Name of the parent group.
VariableScalarInteger m_mesh_dimension
Mesh dimension.
Implementation of the tied interface manager.
ItemGroupT< Cell > CellGroup
Group of cells.
ItemGroupT< Face > FaceGroup
Group of faces.
#define ARCANE_REGISTER_SERVICE(aclass, a_service_property,...)
Macro for registering a service.
MeshVariableScalarRefT< Node, Real3 > VariableNodeReal3
Coordinate type quantity at node.
ItemVariableScalarRefT< Int32 > VariableItemInt32
32-bit integer type quantity
VariableRefScalarT< Integer > VariableScalarInteger
Scalar variable of integer type.
bool arcaneIsCheck()
True if running in check mode.
Collection< ItemGroup > ItemGroupCollection
Collection of mesh item groups.
std::int64_t Int64
Signed integer type of 64 bits.
Int32 Integer
Type representing an integer.
ConstArrayView< Int32 > Int32ConstArrayView
C equivalent of a 1D array of 32-bit integers.
ConstArrayView< ItemInternal * > ItemInternalList
Type of the internal list of entities.
@ ST_Application
The service is used at the application level.
ConstArrayView< Int64 > Int64ConstArrayView
C equivalent of a 1D array of 64-bit integers.
eMeshEventType
Events generated by IMesh.
@ EndPrepareDump
Event sent at the end of prepareForDump().
@ BeginPrepareDump
Event sent at the beginning of prepareForDump().
UniqueArray< Int32 > Int32UniqueArray
Dynamic 1D array of 32-bit integers.
ArrayView< Int32 > Int32ArrayView
C equivalent of a 1D array of 32-bit integers.
SharedMeshVariableScalarRefT< Node, Real3 > SharedVariableNodeReal3
Quantity at the node of coordinate type.
eItemKind
Mesh entity type.
@ IK_Particle
Particle mesh entity.
@ IK_Node
Node mesh entity.
@ IK_Cell
Cell mesh entity.
@ IK_Unknown
Unknown or uninitialized mesh entity.
@ IK_Face
Face mesh entity.
@ IK_DoF
Degree of Freedom mesh entity.
@ IK_Edge
Edge mesh entity.
const char * itemKindName(eItemKind kind)
Entity kind name.
Array< Int32 > Int32Array
Dynamic one-dimensional array of 32-bit integers.
Collection< IMesh * > IMeshCollection
Collection of meshes.
InternalConnectivityPolicy
Connectivity usage policy.
@ NewOnly
Allocates only the new connectivities.
eMeshAMRKind
AMR mesh type.
@ Patch
The mesh is AMR by patch.
@ Cell
The mesh is AMR by cell.
@ None
The mesh is not AMR.
@ PatchCartesianMeshOnly
The mesh is AMR by Cartesian patch (rectangular).
Collection< ITiedInterface * > TiedInterfaceCollection
Collection of tied interfaces.
std::int32_t Int32
Signed integer type of 32 bits.