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)
1788 if (!nb_exchange_str.
null()) {
1789 bool is_bad = builtInGetValue(nb_exchange, nb_exchange_str);
1795 if (!exchange_version_str.
null()) {
1796 builtInGetValue(exchange_version, exchange_version_str);
1799 info() <<
"DynamicMesh::_echangeItems() do_compact?=" << do_compact
1800 <<
" nb_exchange=" << nb_exchange <<
" version=" << exchange_version;
1802 if (nb_exchange > 1) {
1803 _multipleExchangeItems(nb_exchange, exchange_version, do_compact);
1806 _exchangeItemsNew();
1811 if (ghostLayerMng()->nbGhostLayer() > 1 && !m_use_mesh_item_family_dependencies)
1812 updateGhostLayers(
true);
1813 String check_exchange = platform::getEnvironmentVariable(
"ARCANE_CHECK_EXCHANGE");
1814 if (!check_exchange.null()) {
1815 m_mesh_checker->checkGhostCells();
1816 pwarning() <<
"CHECKING SYNCHRONISATION !";
1817 m_mesh_checker->checkVariablesSynchronization();
1818 m_mesh_checker->checkItemGroupsSynchronization();
1820 if (checkLevel() >= 2)
1821 m_mesh_checker->checkValidMesh();
1822 else if (checkLevel() >= 1)
1823 m_mesh_checker->checkValidConnectivity();
1858_multipleExchangeItems(
Integer nb_exchange,
Integer version,
bool do_compact)
1860 if (version < 1 || version > 2)
1861 ARCANE_FATAL(
"Invalid value '{0}' for version. Valid values are 1 or 2", version);
1863 info() <<
"** ** MULTIPLE EXCHANGE ITEM version=" << version <<
" nb_exchange=" << nb_exchange;
1875 Int32 new_owner = cells_new_owner[icell];
1876 if (current_owner == new_owner)
1880 phase = (new_owner % nb_exchange);
1881 else if (version == 1)
1882 phase = icell.index() / nb_cell;
1883 cells_to_exchange_new_owner[phase].
add(new_owner);
1884 cells_to_exchange_uid[phase].
add(cell.
uniqueId().asInt64());
1890 cells_new_owner[icell] = cell.
owner();
1896 for (
Integer i = 0; i < nb_exchange; ++i) {
1900 info() <<
"MultipleExchange current_exchange=" << i <<
" nb_cell=" << nb_cell;
1901 uids_to_lids.
resize(nb_cell);
1906 for (
Integer z = 0; z < nb_cell; ++z)
1907 cells_new_owner[cells[uids_to_lids[z]]] = new_owners[z];
1908 cells_new_owner.synchronize();
1909 mesh()->utilities()->changeOwnersFromCells();
1910 _exchangeItemsNew();
1914 Timer::Action ts_action1(m_sub_domain,
"CompactItems",
true);
1915 bool do_sort = m_properties->getBool(PROPERTY_SORT);
1916 _compactItems(do_sort,
true);
1926 _exchangeItems(m_properties->getBool(PROPERTY_COMPACT));
1936 family->clearItems();
1943class ItemsExchangeInfo2List
1947 ~ItemsExchangeInfo2List()
1969 Trace::Setter mci(traceMng(), _className());
1974 m_need_compact =
true;
1976 if (arcane_debug_load_balancing) {
1979 m_node_family->itemsNewOwner().checkIfSync(10);
1980 m_edge_family->itemsNewOwner().checkIfSync(10);
1981 m_face_family->itemsNewOwner().checkIfSync(10);
1982 m_cell_family->itemsNewOwner().checkIfSync(10);
1987 typedef Collection<DynamicMesh*> DynamicMeshCollection;
1988 DynamicMeshCollection all_cascade_meshes = List<DynamicMesh*>();
1989 all_cascade_meshes.add(
this);
1990 for (Integer i = 0; i < m_child_meshes.size(); ++i)
1991 all_cascade_meshes.add(m_child_meshes[i]);
1993 IMeshExchanger* iexchanger = m_mesh_exchange_mng->beginExchange();
1994 MeshExchanger* mesh_exchanger =
ARCANE_CHECK_POINTER(
dynamic_cast<MeshExchanger*
>(iexchanger));
1997 if (mesh_exchanger->computeExchangeInfos()) {
1998 info() <<
"No load balance is performed";
1999 m_mesh_exchange_mng->endExchange();
2004 mesh_exchanger->processExchange();
2007 mesh_exchanger->removeNeededItems();
2013 auto action = [](ItemGroup& group) {
2017 if (group.internal()->hasComputeFunctor() || group.isLocalToSubDomain())
2020 group.internal()->removeSuppressedItems();
2022 for (DynamicMesh* mesh : all_cascade_meshes) {
2023 meshvisitor::visitGroups(mesh, action);
2035 for (DynamicMesh* child_mesh : m_child_meshes)
2036 child_mesh->m_submesh_tools->removeDeadGhostCells();
2038 for (Integer i_child_mesh = 0; i_child_mesh < m_child_meshes.size(); ++i_child_mesh)
2039 m_child_meshes[i_child_mesh]->m_submesh_tools->removeDeadGhostCells();
2043 mesh_exchanger->allocateReceivedItems();
2047 for (DynamicMesh* mesh : all_cascade_meshes)
2048 mesh->_internalEndUpdateInit(
true);
2050 mesh_exchanger->updateItemGroups();
2053 for (DynamicMesh* mesh : all_cascade_meshes)
2054 mesh->_computeGroupSynchronizeInfos();
2057 mesh_exchanger->updateVariables();
2060 for (DynamicMesh* mesh : all_cascade_meshes) {
2062 bool print_info = (mesh ==
this);
2063 mesh->_internalEndUpdateFinal(print_info);
2069 mesh_exchanger->finalizeExchange();
2072 m_mesh_exchange_mng->endExchange();
2080 if (m_extra_ghost_cells_builder->hasBuilder() || m_extra_ghost_particles_builder->hasBuilder())
2081 this->endUpdate(
true,
false);
2092 m_extra_ghost_cells_builder->addExtraGhostCellsBuilder(builder);
2101 m_extra_ghost_cells_builder->removeExtraGhostCellsBuilder(builder);
2110 m_extra_ghost_particles_builder->addExtraGhostParticlesBuilder(builder);
2119 m_extra_ghost_particles_builder->removeExtraGhostParticlesBuilder(builder);
2126_computeExtraGhostCells()
2128 m_extra_ghost_cells_builder->computeExtraGhostCells();
2135_computeExtraGhostParticles()
2137 m_extra_ghost_particles_builder->computeExtraGhostParticles();
2146 const Int32 sid = meshRank();
2151 UniqueArray<Int32> cells_to_remove;
2152 cells_to_remove.reserve(1000);
2154 ItemInternalMap& cells_map = m_cell_family->itemsMap();
2155 cells_map.eachItem([&](Item cell) {
2156 if (cell.owner() != sid)
2157 cells_to_remove.add(cell.localId());
2160 info() <<
"Number of cells to remove: " << cells_to_remove.size();
2161 m_cell_family->removeCells(cells_to_remove);
2164 _updateGroupsAfterRemove();
2173_updateGroupsAfterRemove()
2175 auto action = [&](
const ItemGroup& group) { group.itemFamily()->partialEndUpdateGroup(group); };
2176 meshvisitor::visitGroups(
this, action);
2192updateGhostLayers(
bool remove_old_ghost)
2201 _internalUpdateGhost(
true, remove_old_ghost);
2202 _internalEndUpdateInit(
true);
2203 _synchronizeGroups();
2204 _computeGroupSynchronizeInfos();
2205 _internalEndUpdateResizeVariables();
2206 _synchronizeVariables();
2207 _internalEndUpdateFinal(
true);
2210 for (
Integer i = 0; i < m_child_meshes.size(); ++i) {
2211 m_child_meshes[i]->endUpdate(
true, remove_old_ghost);
2218_removeGhostChildItems()
2220 const Int32 sid = meshRank();
2223 UniqueArray<Int32> cells_to_remove;
2224 cells_to_remove.reserve(1000);
2226 ItemInternalMap& cells_map = m_cell_family->itemsMap();
2227 Integer max_level = 0;
2228 cells_map.eachItem([&](impl::ItemBase cell) {
2229 if ((cell.owner() != sid) && (cell.level() != 0))
2230 max_level = math::max(cell.level(), max_level);
2236 cells_map.eachItem([&](impl::ItemBase cell) {
2237 if ((cell.owner() != sid) && (cell.level() == max_level)) {
2238 cells_to_remove.add(cell.localId());
2242 info() <<
"Number of cells to remove: " << cells_to_remove.size();
2243 m_cell_family->removeCells(cells_to_remove);
2246 _updateGroupsAfterRemove();
2253_removeGhostChildItems2(Array<Int64>& cells_to_coarsen)
2255 const Int32 sid = meshRank();
2257 cells_to_coarsen.reserve(1000);
2260 UniqueArray<Cell> cells_to_remove;
2261 cells_to_remove.reserve(1000);
2263 ItemInternalMap& cells_map = m_cell_family->itemsMap();
2265 cells_map.eachItem([&](Cell cell) {
2266 if (cell.owner() != sid)
2268 if (cell.hasFlags(ItemFlags::II_JustCoarsened)) {
2269 cells_to_coarsen.add(cell.uniqueId());
2270 for (Integer c = 0, cs = cell.nbHChildren(); c < cs; c++) {
2271 cells_to_remove.add(cell.hChild(c));
2281 for (Integer i = 0, is = cells_to_remove.size(); i < is; ++i)
2282 m_cell_family->removeCell(cells_to_remove[i]);
2285 _updateGroupsAfterRemove();
2292updateGhostLayerFromParent(
Array<Int64>& ghost_cell_to_refine_uid,
2293 Array<Int64>& ghost_cell_to_coarsen_uid,
bool remove_old_ghost)
2296 CHECKPERF(m_perf_counter.start(PerfCounter::UPGHOSTLAYER1));
2298 m_need_compact =
true;
2303 if (remove_old_ghost) {
2304 _removeGhostChildItems2(ghost_cell_to_coarsen_uid);
2308 m_face_family->setCheckOrientation(
false);
2310 m_mesh_builder->addGhostChildFromParent(ghost_cell_to_refine_uid);
2311 m_face_family->setCheckOrientation(
true);
2315 m_mesh_builder->printStats();
2316 CHECKPERF(m_perf_counter.stop(PerfCounter::UPGHOSTLAYER1))
2318 CHECKPERF(m_perf_counter.start(PerfCounter::UPGHOSTLAYER2))
2323 family->endUpdate();
2325 CHECKPERF(m_perf_counter.stop(PerfCounter::UPGHOSTLAYER2))
2329 CHECKPERF(m_perf_counter.start(PerfCounter::UPGHOSTLAYER3))
2335 CHECKPERF(m_perf_counter.stop(PerfCounter::UPGHOSTLAYER3))
2341 CHECKPERF(m_perf_counter.start(PerfCounter::UPGHOSTLAYER4))
2343 _synchronizeGroupsAndVariables();
2344 CHECKPERF(m_perf_counter.stop(PerfCounter::UPGHOSTLAYER4))
2347 CHECKPERF(m_perf_counter.start(PerfCounter::UPGHOSTLAYER5))
2349 m_cell_family->itemsUniqueIdToLocalId(ghost_cell_to_refine_lid, ghost_cell_to_refine_uid,
true);
2351 for (
Integer e = 0, i_size = ghost_cell_to_refine_lid.
size(); e != i_size; ++e) {
2352 Cell i_hParent_cell(cells[ghost_cell_to_refine_lid[e]]);
2358 for (
Integer iface = 0; iface < nb_face; ++iface) {
2359 Face face = i_hParent_cell.
face(iface);
2361 for (
Integer icell = 0; icell < nb_cell; ++icell) {
2365 m_face_family->familyTree(childs, cell,
false);
2366 for (
Integer i = 0, nchilds = childs.
size(); i < nchilds; ++i) {
2375 CHECKPERF(m_perf_counter.stop(PerfCounter::UPGHOSTLAYER5))
2378 CHECKPERF(m_perf_counter.start(PerfCounter::UPGHOSTLAYER6))
2379 m_mesh_checker->checkMeshFromReferenceFile();
2386 bool do_compact = m_properties->getBool(PROPERTY_COMPACT);
2388 bool do_sort = m_properties->getBool(PROPERTY_SORT);
2389 _compactItems(do_sort, do_compact);
2391 CHECKPERF(m_perf_counter.stop(PerfCounter::UPGHOSTLAYER6))
2393 if (arcane_debug_load_balancing) {
2394 _writeMesh(
"update-ghost-layer-after");
2401 pinfo() <<
"Proc: " << meshRank()
2402 <<
" cellown=" << m_cell_family->allItems().own().size()
2403 <<
" cellloc=" << m_cell_family->allItems().size();
2407 CHECKPERF(m_perf_counter.start(PerfCounter::UPGHOSTLAYER7))
2409 m_mesh_checker->updateAMRFaceOrientation(ghost_cell_to_refine_uid);
2411 if (m_mesh_checker->checkLevel() >= 1)
2412 m_mesh_checker->checkValidConnectivity();
2413 CHECKPERF(m_perf_counter.stop(PerfCounter::UPGHOSTLAYER7))
2415#ifdef ACTIVATE_PERF_COUNTER
2416 m_perf_counter.printInfo(
info().file());
2424_internalUpdateGhost(
bool update_ghost_layer,
bool remove_old_ghost)
2426 m_need_compact =
true;
2430 if (update_ghost_layer)
2431 m_submesh_tools->updateGhostMesh();
2434 if (update_ghost_layer) {
2435 if (remove_old_ghost) {
2436 _removeGhostItems();
2439 m_face_family->setCheckOrientation(
false);
2440 m_mesh_builder->addGhostLayers(
false);
2441 m_face_family->setCheckOrientation(
true);
2442 _computeExtraGhostCells();
2443 _computeExtraGhostParticles();
2452_internalEndUpdateInit(
bool update_ghost_layer)
2459 _finalizeMeshChanged();
2464 if (update_ghost_layer) {
2465 info() <<
"ComputeSyncInfos date=" << platform::getCurrentDateTime();
2466 _computeFamilySynchronizeInfos();
2474_internalEndUpdateResizeVariables()
2477 for (IItemFamily* family : m_item_families)
2478 family->_internalApi()->resizeVariables(
true);
2485_internalEndUpdateFinal(
bool print_stat)
2488 m_mesh_checker->checkMeshFromReferenceFile();
2496 _compactItemInternalReferences();
2499 bool do_compact = m_properties->getBool(PROPERTY_COMPACT);
2500 info(4) <<
"DynamicMesh::_internalEndUpdateFinal() compact?=" << do_compact <<
" sort?=" << m_properties->getBool(PROPERTY_SORT);
2502 bool do_sort = m_properties->getBool(PROPERTY_SORT);
2503 _compactItems(do_sort, do_compact);
2508 _notifyEndUpdateForFamilies();
2512 if (m_properties->getBool(PROPERTY_DISPLAY_STATS)) {
2520 m_mesh_checker->updateAMRFaceOrientation();
2522 if (m_mesh_checker->checkLevel() >= 1)
2523 m_mesh_checker->checkValidConnectivity();
2530_notifyEndUpdateForFamilies()
2533 family->_internalApi()->notifyEndUpdateFromMesh();
2549endUpdate(
bool update_ghost_layer,
bool remove_old_ghost)
2563 _internalUpdateGhost(update_ghost_layer, remove_old_ghost);
2565 _internalEndUpdateInit(update_ghost_layer);
2566 if (update_ghost_layer) {
2567 _synchronizeGroups();
2568 _computeGroupSynchronizeInfos();
2570 _internalEndUpdateResizeVariables();
2571 if (update_ghost_layer) {
2572 _synchronizeVariables();
2574 _internalEndUpdateFinal(
false);
2577 for (DynamicMesh* child_mesh : m_child_meshes)
2578 child_mesh->endUpdate(update_ghost_layer, remove_old_ghost);
2585synchronizeGroupsAndVariables()
2587 _synchronizeGroupsAndVariables();
2591 for (DynamicMesh* child_mesh : m_child_meshes)
2592 child_mesh->synchronizeGroupsAndVariables();
2599_synchronizeGroupsAndVariables()
2601 _synchronizeGroups();
2602 _synchronizeVariables();
2612 ItemGroupsSynchronize igs(m_node_family);
2616 ItemGroupsSynchronize igs(m_edge_family);
2620 ItemGroupsSynchronize igs(m_face_family);
2624 ItemGroupsSynchronize igs(m_cell_family);
2628 for (IItemFamily* family : m_item_families) {
2629 if (family->itemKind() == IK_Particle) {
2630 IParticleFamily* pfamily = family->toParticleFamily();
2631 if (pfamily && pfamily->getEnableGhostItems()) {
2632 ItemGroupsSynchronize igs(family);
2644_synchronizeVariables()
2656 typedef UniqueArray<IVariableSynchronizer*> OrderedSyncList;
2657 typedef std::map<IVariableSynchronizer*, VariableCollection> SyncList;
2658 OrderedSyncList ordered_sync_list;
2661 VariableCollection used_vars(subDomain()->variableMng()->usedVariables());
2662 for (VariableCollection::Enumerator i_var(used_vars); ++i_var;) {
2663 IVariable* var = *i_var;
2664 switch (var->itemKind()) {
2670 IVariableSynchronizer* synchronizer = 0;
2671 if (var->isPartial())
2672 synchronizer = var->itemGroup().synchronizer();
2674 synchronizer = var->itemFamily()->allItemsSynchronizer();
2675 IMesh* sync_mesh = synchronizer->itemGroup().mesh();
2676 if (sync_mesh !=
this)
2678 std::pair<SyncList::iterator, bool> inserter = sync_list.insert(std::make_pair(synchronizer, VariableCollection()));
2679 if (inserter.second) {
2680 ordered_sync_list.add(synchronizer);
2682 VariableCollection& collection = inserter.first->second;
2683 collection.add(var);
2691 for (Integer i_sync = 0; i_sync < ordered_sync_list.size(); ++i_sync) {
2692 IVariableSynchronizer* synchronizer = ordered_sync_list[i_sync];
2693 VariableCollection& collection = sync_list[synchronizer];
2694 synchronizer->synchronize(collection);
2702_sortInternalReferences()
2705 m_node_family->sortInternalReferences();
2712_finalizeMeshChanged()
2715 for (IItemFamily* family : m_item_families) {
2716 debug() <<
"_finalizeMeshChanged on " << family->name() <<
" Family on Mesh " << name();
2717 family->endUpdate();
2720 bool do_sort = m_properties->getBool(PROPERTY_SORT);
2722 _sortInternalReferences();
2723 m_tied_interface_need_prepare_dump =
true;
2730_applyCompactPolicy(
const String& timer_name,
2731 std::function<
void(IItemFamilyCompactPolicy*)> functor)
2733 Timer::Action ts_action(m_sub_domain, timer_name);
2734 for (IItemFamily* family : m_item_families) {
2735 IItemFamilyCompactPolicy* c = family->policyMng()->compactPolicy();
2745_compactItemInternalReferences()
2747 _applyCompactPolicy(
"CompactConnectivityData", [&](IItemFamilyCompactPolicy* c) { c->compactConnectivityData(); });
2754_compactItems(
bool do_sort,
bool compact_variables_and_groups)
2757 info(4) <<
"Compress and sort the mesh entities " << name() <<
".";
2759 info(4) <<
"Compress the mesh entities " << name() <<
".";
2761 IMeshCompacter* compacter = m_mesh_compact_mng->beginCompact();
2764 compacter->setSorted(do_sort);
2765 compacter->_setCompactVariablesAndGroups(compact_variables_and_groups);
2767 compacter->doAllActions();
2770 m_mesh_compact_mng->endCompact();
2773 m_mesh_compact_mng->endCompact();
2776 Timer::Action ts_action(m_sub_domain,
"CompactItemSortReferences");
2779 _sortInternalReferences();
2782 m_need_compact =
false;
2793setEstimatedCells(Integer nb_cell0)
2796 if (m_parallel_mng->isParallel())
2799 Integer nb_node = Convert::toInteger(nb_cell0 * 1.2 * factor);
2800 Integer nb_edge = Convert::toInteger(nb_cell0 * 6.8 * factor);
2801 Integer nb_face = Convert::toInteger(nb_cell0 * 3.4 * factor);
2802 Integer nb_cell = Convert::toInteger(nb_cell0 * 1.0 * factor);
2803 info() <<
"Estimating the number of entities:"
2804 <<
" Node=" << nb_node
2805 <<
" Edge=" << nb_edge
2806 <<
" Face=" << nb_face
2807 <<
" Cell=" << nb_cell;
2808 m_node_family->preAllocate(nb_node);
2809 m_edge_family->preAllocate(nb_edge);
2810 m_face_family->preAllocate(nb_face);
2811 m_cell_family->preAllocate(nb_cell);
2835 ARCANE_ASSERT((m_parent_mesh != NULL), (
"Unexpected NULL Mesh"));
2839 m_child_meshes.resize(n_sub_mesh);
2840 for (
Integer i = 0; i < n_sub_mesh; ++i) {
2842 DynamicMesh* dynamic_child_mesh =
dynamic_cast<DynamicMesh*
>(child_mesh);
2843 if (dynamic_child_mesh == 0)
2844 ARCANE_FATAL(
"Cannot associate sub mesh from a different concrete type");
2845 m_child_meshes[i] = dynamic_child_mesh;
2851 for (
Integer i = 0; i < nb_item_family; ++i) {
2852 info(5) <<
"Found family: I=" << i
2861 for (
Integer i = 0; i < nb_item_family; ++i) {
2869 if (!m_is_sub_connectivity_set)
2870 _setSubConnectivity();
2873 family->readFromDump();
2877 _notifyEndUpdateForFamilies();
2880 m_item_internal_list.nodes = m_node_family->itemsInternal();
2881 m_item_internal_list.edges = m_edge_family->itemsInternal();
2882 m_item_internal_list.faces = m_face_family->itemsInternal();
2883 m_item_internal_list.cells = m_cell_family->itemsInternal();
2884 m_item_internal_list.mesh =
this;
2886 m_tied_interface_mng->readTiedInterfacesFromDump();
2888 m_mesh_builder->readFromDump();
2898 return m_tied_interface_mng->hasTiedInterface();
2907 return m_tied_interface_mng->tiedInterfaces();
2916 return m_tied_interface_mng->trueTiedInterfaces();
2923computeTiedInterfaces(
const XmlNode& mesh_node)
2925 m_tied_interface_mng->computeTiedInterfaces(mesh_node);
2935 _checkConnectivity();
2945 ARCANE_FATAL(
"DynamicMesh::setDimension(): mesh is already allocated");
2946 info() <<
"Mesh name=" << name() <<
" set dimension = " << dim;
2947 m_mesh_dimension = dim;
2948 const bool is_non_manifold = meshKind().isNonManifold();
2951 if (is_non_manifold) {
2952 info() <<
"Force no-renumbering of edge and face uid because we are using non manifold mesh";
2953 m_mesh_unique_id_mng->setFaceBuilderVersion(0);
2954 m_mesh_unique_id_mng->setEdgeBuilderVersion(0);
2956 bool v = m_mesh_unique_id_mng->isUseNodeUniqueIdToGenerateEdgeAndFaceUniqueId();
2962 if (!v && is_non_manifold) {
2964 info() <<
"Force using edge and face uid generation from nodes because we are using non manifold mesh";
2966 if (m_mesh_builder) {
2967 auto* adder = m_mesh_builder->oneMeshItemAdder();
2969 adder->setUseNodeUniqueIdToGenerateEdgeAndFaceUniqueId(v);
2973 if (dim == 3 && is_non_manifold) {
2974 Connectivity c(m_mesh_connectivity);
2975 if (!c.hasConnectivity(Connectivity::CT_HasEdge)) {
2976 c.enableConnectivity(Connectivity::CT_HasEdge);
2977 info() <<
"Force creating edges for 3D non-manifold mesh";
2986_checkDimension()
const
2988 if (m_mesh_dimension() < 0)
2989 ARCANE_FATAL(
"dimension not set. setDimension() must be called before allocating cells");
2998 Connectivity c(m_mesh_connectivity);
2999 if (!c.isFrozen()) {
3001 debug() <<
"Mesh " << name() <<
" connectivity : " << Connectivity::Printer(m_mesh_connectivity());
3002 _setSubConnectivity();
3003 _updateItemFamilyDependencies(m_mesh_connectivity);
3013 if (!m_is_amr_activated)
3014 ARCANE_FATAL(
"DynamicMesh::_checkAMR(): amr activator not set.\t"
3015 "amr='true' must be set in the .arc file");
3022_setSubConnectivity()
3024 m_mesh_builder->setConnectivity(m_mesh_connectivity());
3025 m_node_family->setConnectivity(m_mesh_connectivity());
3026 m_edge_family->setConnectivity(m_mesh_connectivity());
3027 m_face_family->setConnectivity(m_mesh_connectivity());
3028 m_cell_family->setConnectivity(m_mesh_connectivity());
3029 m_is_sub_connectivity_set =
true;
3036_writeCells(
const String& filename)
3038 CellGroup cells(m_cell_family->allItems());
3039 std::ofstream ofile(filename.localstr());
3042 ofile <<
"CELL: uid=" << cell.uniqueId() <<
" isown="
3043 << cell.isOwn() <<
" owner=" << cell.owner() <<
'\n';
3053 return m_node_family->nodesCoordinates();
3060sharedNodesCoordinates()
3072_setOwnersFromCells()
3093 const Integer sid = subDomain()->subDomainId();
3096 if (m_new_item_owner_builder == NULL)
3102 Node node = *i_node;
3103 nodes_owner[node] = m_new_item_owner_builder->ownerOfItem(node);
3105 nodes_owner.synchronize();
3109 Node node = *i_node;
3116 Edge edge = *i_edge;
3117 edges_owner[edge] = m_new_item_owner_builder->ownerOfItem(edge);
3119 edges_owner.synchronize();
3123 Edge edge = *i_edge;
3124 edge.mutableItemBase().setOwner(edges_owner[edge], sid);
3130 Face face = *i_face;
3131 faces_owner[face] = m_new_item_owner_builder->ownerOfItem(face);
3133 faces_owner.synchronize();
3137 Face face = *i_face;
3138 face.mutableItemBase().setOwner(faces_owner[face], sid);
3141 nodeFamily()->notifyItemsOwnerChanged();
3142 edgeFamily()->notifyItemsOwnerChanged();
3143 faceFamily()->notifyItemsOwnerChanged();
3144 _computeFamilySynchronizeInfos();
3153 if (!m_mesh_utilities)
3155 return m_mesh_utilities;
3164 return m_cell_family->allItems().outerFaceGroup();
3175 return m_cell_family->allItems().activeCellGroup();
3183 return m_cell_family->allItems().ownActiveCellGroup();
3189allLevelCells(
const Integer& level)
3191 return m_cell_family->allItems().levelCellGroup(level);
3197ownLevelCells(
const Integer& level)
3199 return m_cell_family->allItems().ownLevelCellGroup(level);
3207 return m_cell_family->allItems().activeFaceGroup();
3215 return m_cell_family->allItems().ownActiveFaceGroup();
3226 return m_cell_family->allItems().innerActiveFaceGroup();
3234 return m_cell_family->allItems().outerActiveFaceGroup();
3250 ARCANE_FATAL(
"Cannot set inconsistant mesh/group parents to mesh '{0}'",
name());
3252 if (m_parent_mesh) {
3253 if (m_parent_mesh !=
mesh)
3254 ARCANE_FATAL(
"Mesh '{0}' already has parent mesh '{1}'",
name(), m_parent_mesh->name());
3255 if (m_parent_group != group.
internal())
3256 ARCANE_FATAL(
"Mesh '{0}' already has parent group '{1}'",
name(), m_parent_group->name());
3259 m_parent_mesh =
mesh;
3264 dimension_shift = 1;
3267 dimension_shift = 0;
3270 ARCANE_FATAL(
"Only SubMesh on FaceGroup or CellGoup is allowed");
3273 _setDimension(
mesh->dimension() - dimension_shift);
3276 const eItemKind kind = family->itemKind();
3281 family->setParentFamily(
mesh->itemFamily(parent_kind));
3294partitionConstraintMng()
3296 return m_partition_constraint_mng;
3305 return m_parent_mesh;
3321addChildMesh(
IMesh* sub_mesh)
3323 DynamicMesh* dynamic_child_mesh =
dynamic_cast<DynamicMesh*
>(sub_mesh);
3324 if (!dynamic_child_mesh)
3325 ARCANE_FATAL(
"Cannot associate sub mesh from a different concrete type");
3326 for (
Integer i = 0; i < m_child_meshes.size(); ++i)
3327 if (m_child_meshes[i] == dynamic_child_mesh)
3329 m_child_meshes.add(dynamic_child_mesh);
3339 for (
Integer i = 0; i < m_child_meshes.size(); ++i) {
3340 collection.add(m_child_meshes[i]);
3351 return m_mesh_checker;
3358isPrimaryMesh()
const
3380 return m_node_family->nbItem();
3385 return m_edge_family->nbItem();
3390 return m_face_family->nbItem();
3395 return m_cell_family->nbItem();
3401 return m_node_family;
3407 return m_edge_family;
3413 return m_face_family;
3419 return m_cell_family;
3422DynamicMeshKindInfos::ItemInternalMap& DynamicMesh::
3425 return m_node_family->itemsMap();
3428DynamicMeshKindInfos::ItemInternalMap& DynamicMesh::
3431 return m_edge_family->itemsMap();
3434DynamicMeshKindInfos::ItemInternalMap& DynamicMesh::
3437 return m_face_family->itemsMap();
3440DynamicMeshKindInfos::ItemInternalMap& DynamicMesh::
3443 return m_cell_family->itemsMap();
3455 true_meshes.
add(true_mesh);
3458 merger.mergeMeshes(true_meshes);
3465_printConnectivityPolicy()
3467 info() <<
"Connectivity policy=" << (int)m_connectivity_policy;
3470 ARCANE_FATAL(
"Invalid value '{0}' for InternalConnectivityPolicy. Only '{1}' is allowed",
3480 m_mesh_part_info = mpi;
3490 if (!m_item_family_network)
3493 for (
const auto& con : m_item_family_network->getConnectivities()) {
3494 if (c.hasConnectivity(c.kindsToConnectivity(con->sourceFamily()->itemKind(), con->targetFamily()->itemKind()))) {
3495 m_item_family_network->setIsStored(con);
3506 return m_internal_api.get();
3513_modifierInternalApi()
3515 return m_internal_api.get();
3522computeSynchronizeInfos()
3524 _computeSynchronizeInfos();
3530class ARCANE_MESH_EXPORT DynamicMeshFactoryBase
3555 if (is_submesh && m_is_amr)
3568class ARCANE_MESH_EXPORT DynamicMeshFactory
3569:
public DynamicMeshFactoryBase
3574 : DynamicMeshFactoryBase(sbi,
false)
3581class ARCANE_MESH_EXPORT DynamicAMRMeshFactory
3582:
public DynamicMeshFactoryBase
3587 : DynamicMeshFactoryBase(sbi,
true)
#define ARCANE_FATAL_IF(const,...)
Macro envoyant une exception FatalErrorException si cond est vrai.
#define ARCANE_CHECK_POINTER(ptr)
Macro retournant le pointeur ptr s'il est non nul ou lancant une exception s'il est nul.
#define ARCANE_FATAL(...)
Macro envoyant une exception FatalErrorException.
Fonctions utilitaires sur le maillage.
void writeMeshConnectivity(IMesh *mesh, const String &file_name)
Ecrit sur le fichier file_name la connectivité du maillage mesh.
#define ARCANE_SERVICE_INTERFACE(ainterface)
Macro pour déclarer une interface lors de l'enregistrement d'un service.
Integer size() const
Nombre d'éléments du vecteur.
AbstractService(const ServiceBuildInfo &)
Constructeur à partir d'un ServiceBuildInfo.
Tableau d'items de types quelconques.
void resize(Int64 s)
Change le nombre d'éléments du tableau à s.
T & operator[](const T &item)
void add(ConstReferenceType val)
Ajoute l'élément val à la fin du tableau.
Exception lorsqu'une conversion d'un type vers un autre est invalide.
Face face(Int32 i) const
i-ème face de la maille
Int32 nbFace() const
Nombre de faces de la maille.
EnumeratorT< ItemGroup > Enumerator
Gère la récupération des informations de connectivité.
Vue constante d'un tableau de type T.
constexpr Integer size() const noexcept
Nombre d'éléments du tableau.
constexpr bool empty() const noexcept
true si le tableau est vide (size()==0)
Cell cell(Int32 i) const
i-ème maille de la face
Int32 nbCell() const
Nombre de mailles de la face (1 ou 2).
Interface d'une partie d'un jeu de données.
virtual XmlNode rootElement()=0
Retourne l'élément racine.
Interface d'un constructeur de mailles fantômes "extraordinaires".
Interface de modification d'une famille.
Interface d'une famille d'entités.
virtual ItemGroup findGroup(const String &name) const =0
Recherche un groupe.
virtual ItemInternalArrayView itemsInternal()=0
Tableau interne des entités.
virtual String name() const =0
Nom de la famille.
virtual ItemVectorView view(Int32ConstArrayView local_ids)=0
Vue sur les entités.
virtual void itemsUniqueIdToLocalId(Int32ArrayView local_ids, Int64ConstArrayView unique_ids, bool do_fatal=true) const =0
Converti un tableau de numéros uniques en numéros locaux.
virtual VariableItemInt32 & itemsNewOwner()=0
Variable contenant le numéro du nouveau sous-domaine propriétaire de l'entité.
Interface de méthodes de vérification d'un maillage.
Interface du service gérant la lecture d'un maillage.
Interface du gestionnaire des maillages.
virtual IVariableMng * variableMng() const =0
Gestionnaire de variables associé à ce gestionnaire.
virtual MeshHandle * findMeshHandle(const String &name, bool throw_exception)=0
Recherche le maillage de nom name.
Partie interne de IMeshModifier.
Interface d'un gestionnaire de contraintes de partitionnement de maillage.
Interface d'une classe proposant des fonctions utilitaires sur maillage.
Interface du gestionnaire de parallélisme pour un sous-domaine.
Interface d'un sérialiseur.
@ ModePut
Le sérialiseur attend des reserve().
@ ModeGet
Le sérialiseur attend des get().
virtual void allocateBuffer()=0
Alloue la mémoire du sérialiseur.
virtual void setMode(eMode new_mode)=0
Positionne le fonctionnement actuel.
Interface du gestionnaire d'un sous-domaine.
Interface gérant les statistiques sur les temps d'exécution.
virtual void dumpTimeAndMemoryUsage(IParallelMng *pm)=0
Affiche la date actuelle et la mémoire consommée.
virtual ISubDomain * internalSubDomain() const =0
Fonction interne temporaire pour récupérer le sous-domaine.
Interface du gestionnaire de variables.
virtual VariableCollection usedVariables()=0
Liste des variables utilisées.
virtual IVariable * findMeshVariable(IMesh *mesh, const String &name)=0
Retourne la variable du maillage de nom name ou 0 si aucune de se nom existe.
virtual IObservable * writeObservable()=0
Observable pour les variables en écriture.
virtual IVariableMngInternal * _internalApi()=0
API interne à Arcane.
virtual IObservable * readObservable()=0
Observable pour les variables en lecture.
Interface d'une variable.
virtual bool initialize(const ItemGroup &group, const String &value)=0
Initialise la variable sur un groupe.
virtual void resizeFromGroup()=0
Positionne le nombre d'éléments pour une variable du maillage.
virtual bool isUsed() const =0
Etat d'utilisation de la variable.
virtual IItemFamily * itemFamily() const =0
Famille d'entité associée.
virtual String name() const =0
Nom de la variable.
Groupe d'entités de maillage.
ItemGroupImpl * internal() const
Retourne l'implémentation du groupe.
eItemKind itemKind() const
Genre du groupe. Il s'agit du genre de ses éléments.
bool null() const
true is le groupe est le groupe nul
IMesh * mesh() const
Maillage auquel appartient ce groupe (0 pour le group nul).
Structure interne d'une entité de maillage.
Index d'un Item dans une variable.
Classe de base d'un élément de maillage.
impl::MutableItemBase mutableItemBase() const
Partie interne modifiable de l'entité.
constexpr Int32 localId() const
Identifiant local de l'entité dans le sous-domaine du processeur.
Int32 owner() const
Numéro du sous-domaine propriétaire de l'entité
ItemUniqueId uniqueId() const
Identifiant unique sur tous les domaines.
constexpr bool isOwn() const
true si l'entité est appartient au sous-domaine
Implémentation d'une collection d'éléments sous forme de vecteur.
Paramètres nécessaires à la construction d'un maillage.
const ItemGroup & parentGroup() const
Groupe parent dans le cas d'un sous-maillage, null sinon.
const MeshKind meshKind() const
Caractéristiques du maillage.
MeshBuildInfo & addMeshKind(const MeshKind &v)
Positionne les caractéristiques du maillage.
Arguments des évènements sur le maillage.
IMesh * mesh() const
Maillage associé.
Caractéristiques d'un maillage.
Arguments pour IMeshModifier::addCells().
Arguments pour IMeshModifier::addFaces().
Informations un maillage partitionné.
void dumpStats() override
Imprime des infos sur le maillage.
static eItemKind kindTranspose(eItemKind kindA, IMesh *meshA, IMesh *meshB)
Transpose le genre kindA du maillage meshA en le genre associé dans meshB.
void setOwner(Integer suid, Int32 current_sub_domain)
Positionne le numéro du sous-domaine propriétaire de l'entité.
Encapsulation d'un pointeur qui se détruit automatiquement.
Structure contenant les informations pour créer un service.
Propriétés de création d'un service.
Chaîne de caractères unicode.
bool null() const
Retourne true si la chaîne est nulle.
Postionne le nom de l'action en cours d'exécution.
Sentinelle pour le timer. La sentinelle associée à un timer permet de déclancher celui-ci au moment d...
@ TimerReal
Timer utilisant le temps réel.
Real lastActivationTime() const
Retourne le temps (en secondes) passé lors de la dernière activation du timer.
TraceMessageDbg debug(Trace::eDebugLevel=Trace::Medium) const
Flot pour un message de debug.
TraceMessage pinfo() const
Flot pour un message d'information en parallèle.
TraceMessage info() const
Flot pour un message d'information.
TraceMessage error() const
Flot pour un message d'erreur.
Positionne une classe de message.
Vecteur 1D de données avec sémantique par valeur (style STL).
Utility functions for a mesh.
Function each(Function f)
Applique le fonctor f à tous les éléments de la collection.
Liste de noeuds d'un arbre DOM.
XmlNodeList children(const String &name) const
Ensemble des noeuds fils de ce noeud ayant pour nom name.
bool null() const
Vrai si le noeud est nul.
IPrimaryMesh * createMesh(IMeshMng *mm, const MeshBuildInfo &build_info) override
Créé un maillage avec les informations de build_info.
void build() override
Construction de niveau build du service.
Construction of a mesh incrementally.
Information for mesh exchange between subdomains.
Implementation of a mesh.
IPrimaryMesh * toPrimaryMesh() override
Retourne l'instance sous la forme d'un IPrimaryMesh.
void computeSynchronizeInfos() override
Recalcule les informations de synchronisation.
IItemFamily * nodeFamily() override
Retourne la famille des noeuds.
IItemFamily * cellFamily() override
Retourne la famille des mailles.
void endAllocate() override
Indique une fin d'allocation de mailles.
ITraceMng * traceMng() override
Gestionnaire de message associé
IParallelMng * parallelMng() override
Gestionnaire de parallèlisme.
bool isPrimaryMesh() const override
Indique si l'instance est un maillage primaire.
IMesh * mesh() override
Maillage associé
VariableNodeReal3 & nodesCoordinates() override
Coordonnées des noeuds.
IItemFamily * createItemFamily(eItemKind ik, const String &name) override
Créé une famille de particule de nom name.
String name() const override
Nom du maillage.
IMeshMng * meshMng() const override
Gestionnaire de maillage associé
void _readFromDump()
Reloads the mesh from protected variables.
IMeshModifier * modifier() override
Interface de modification associée.
void clearItems() override
Supprime toutes les entitées de toutes les familles de ce maillage.
void updateGhostLayers() override
ItemFamilyList m_item_families
List of entity family interfaces.
IGhostLayerMng * ghostLayerMng() const override
Gestionnare de couche fantômes associé
void endUpdate() override
Notifie l'instance de la fin de la modification du maillage.
void destroyGroups() override
Détruit tous les groupes de toutes les familles.
void _saveProperties()
Saves properties before a dump.
IItemFamily * findItemFamily(eItemKind ik, const String &name, bool create_if_needed, bool register_modifier_if_created) override
Retourne la famille de nom name.
Properties * properties() override
Propriétés associées à ce maillage.
CellGroup ownCells() override
Groupe de toutes les mailles propres au domaine.
IItemFamilyNetwork * itemFamilyNetwork() override
Interface du réseau de familles (familles connectées).
IMesh * parentMesh() const override
Accès au maillage parent.
void _loadProperties()
Reloads properties from a dump.
void checkValidMesh() override
Vérification de la validité des structues internes de maillage (interne).
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
Ajoute des faces.
Interface for the manager of incremental connectivities indexed on entities.
void executeExtend(const Int32ConstArrayView *new_items_info)
Execute l'action associée à l'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
Groupe de mailles.
ItemGroupT< Face > FaceGroup
Groupe de faces.
#define ARCANE_REGISTER_SERVICE(aclass, a_service_property,...)
Macro pour enregistrer un service.
MeshVariableScalarRefT< Node, Real3 > VariableNodeReal3
Grandeur au noeud de type coordonnées.
ItemVariableScalarRefT< Int32 > VariableItemInt32
Grandeur de type entier 32 bits.
VariableRefScalarT< Integer > VariableScalarInteger
Variable scalaire de type entier.
bool arcaneIsCheck()
Vrai si on est en mode vérification.
Collection< ItemGroup > ItemGroupCollection
Collection de groupes d'éléments du maillage.
std::int64_t Int64
Type entier signé sur 64 bits.
Int32 Integer
Type représentant un entier.
ConstArrayView< Int32 > Int32ConstArrayView
Equivalent C d'un tableau à une dimension d'entiers 32 bits.
ConstArrayView< ItemInternal * > ItemInternalList
Type de la liste interne des entités.
@ ST_Application
Le service s'utilise au niveau de l'application.
ConstArrayView< Int64 > Int64ConstArrayView
Equivalent C d'un tableau à une dimension d'entiers 64 bits.
eMeshEventType
Evènements générés par IMesh.
@ EndPrepareDump
Evènement envoyé à la fin de prepareForDump().
@ BeginPrepareDump
Evènement envoyé au début de prepareForDump().
UniqueArray< Int32 > Int32UniqueArray
Tableau dynamique à une dimension d'entiers 32 bits.
ArrayView< Int32 > Int32ArrayView
Equivalent C d'un tableau à une dimension d'entiers 32 bits.
SharedMeshVariableScalarRefT< Node, Real3 > SharedVariableNodeReal3
Grandeur au noeud de type coordonnées.
eItemKind
Genre d'entité de maillage.
@ IK_Particle
Entité de maillage de genre particule.
@ IK_Node
Entité de maillage de genre noeud.
@ IK_Cell
Entité de maillage de genre maille.
@ IK_Unknown
Entité de maillage de genre inconnu ou non initialisé
@ IK_Face
Entité de maillage de genre face.
@ IK_DoF
Entité de maillage de genre degre de liberte.
@ IK_Edge
Entité de maillage de genre arête.
const char * itemKindName(eItemKind kind)
Nom du genre d'entité.
Array< Int32 > Int32Array
Tableau dynamique à une dimension d'entiers 32 bits.
Collection< IMesh * > IMeshCollection
Collection de maillages.
InternalConnectivityPolicy
Politique d'utilisation des connectivités.
@ NewOnly
Alloue uniquement les nouvelles connectivités.
eMeshAMRKind
Type de maillage AMR.
@ Patch
Le maillage est AMR par patch.
@ Cell
Le maillage est AMR par maille.
@ None
Le maillage n'est pas AMR.
@ PatchCartesianMeshOnly
Le maillage est AMR par patch cartésien (rectangulaire).
Collection< ITiedInterface * > TiedInterfaceCollection
Collection d'interfaces liées.
std::int32_t Int32
Type entier signé sur 32 bits.