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"
109const char* PROPERTY_SORT =
"sort";
110const char* PROPERTY_COMPACT =
"compact";
111const char* PROPERTY_COMPACT_AFTER_ALLOCATE =
"compact-after-allocate";
112const char* PROPERTY_DUMP =
"dump";
113const char* PROPERTY_DISPLAY_STATS =
"display-stats";
116const char* PROPERTY_MESH_VERSION =
"mesh-version";
125extern "C++" ARCANE_MESH_EXPORT IItemFamilyPolicyMng*
128extern "C++" ARCANE_MESH_EXPORT IItemFamilyPolicyMng*
131extern "C++" ARCANE_MESH_EXPORT IItemFamilyPolicyMng*
134extern "C++" ARCANE_MESH_EXPORT IItemFamilyPolicyMng*
137extern "C++" ARCANE_MESH_EXPORT IItemFamilyPolicyMng*
138createParticleFamilyPolicyMng(
ItemFamily* family);
140extern "C++" ARCANE_MESH_EXPORT IItemFamilyPolicyMng*
143extern "C++" ARCANE_MESH_EXPORT
void
144allocateCartesianMesh(
DynamicMesh* mesh,CartesianMeshAllocateBuildInfo& build_info);
152#ifdef ARCANE_DEBUG_LOAD_BALANCING
153static bool arcane_debug_load_balancing =
true;
155static bool arcane_debug_load_balancing =
false;
158#ifdef ACTIVATE_PERF_COUNTER
159const std::string DynamicMesh::PerfCounter::m_names[] = {
179 explicit InternalApi(DynamicMesh*
mesh)
181 , m_connectivity_mng(std::make_unique<ItemConnectivityMng>(
mesh->traceMng()))
188 m_mesh->m_mesh_kind = v;
193 return m_connectivity_mng.get();
203 m_mesh->incrementalBuilder()->removeNeedRemoveMarkedItems();
208 DynamicMesh* m_mesh =
nullptr;
209 std::unique_ptr<IItemConnectivityMng> m_connectivity_mng =
nullptr;
219, m_sub_domain(sub_domain)
220, m_mesh_mng(sub_domain->meshMng())
221, m_mesh_handle(m_mesh_mng->findMeshHandle(mbi.name()))
222, m_parallel_mng(mbi.parallelMngRef().get())
223, m_variable_mng(sub_domain->variableMng())
224, m_properties(new
Properties(sub_domain->propertyMng(),
String(
"ArcaneMeshProperties_")+mbi.name()))
226, m_is_allocated(false)
229, m_factory_name(mbi.factoryName())
230, m_need_compact(true)
231, m_node_family(nullptr)
232, m_edge_family(nullptr)
233, m_face_family(nullptr)
234, m_cell_family(nullptr)
235, m_parent_mesh(nullptr)
236, m_parent_group(nullptr)
237, m_mesh_utilities(nullptr)
238, m_mesh_builder(nullptr)
239, m_mesh_checker(nullptr)
240, m_submesh_tools(nullptr)
242, m_mesh_refinement(nullptr)
243, m_new_item_owner_builder(nullptr)
244, m_extra_ghost_cells_builder(nullptr)
245, m_extra_ghost_particles_builder(nullptr)
246, m_initial_allocator(this)
247, m_internal_api(std::make_unique<InternalApi>(this))
249, m_amr_type(mbi.meshKind().meshAMRKind())
251, m_tied_interface_mng(nullptr)
252, m_is_sub_connectivity_set(false)
253, m_tied_interface_need_prepare_dump(true)
254, m_partition_constraint_mng(nullptr)
255, m_ghost_layer_mng(new
GhostLayerMng(m_parallel_mng->traceMng()))
260, m_mesh_part_info(makeMeshPartInfoFromParallelMng(m_parallel_mng))
263, m_mesh_kind(mbi.meshKind())
270 _addFamily(m_node_family);
271 _addFamily(m_edge_family);
272 _addFamily(m_face_family);
273 _addFamily(m_cell_family);
275 m_properties->setBool(PROPERTY_SORT,
true);
276 m_properties->setBool(PROPERTY_COMPACT,
true);
277 m_properties->setBool(PROPERTY_COMPACT_AFTER_ALLOCATE,
true);
278 m_properties->setBool(PROPERTY_DUMP,
true);
279 m_properties->setBool(PROPERTY_DISPLAY_STATS,
true);
280 m_properties->setInt32(PROPERTY_MESH_VERSION,1);
282 m_item_internal_list.mesh =
this;
283 m_item_internal_list._internalSetNodeSharedInfo(m_node_family->commonItemSharedInfo());
284 m_item_internal_list._internalSetEdgeSharedInfo(m_edge_family->commonItemSharedInfo());
285 m_item_internal_list._internalSetFaceSharedInfo(m_face_family->commonItemSharedInfo());
286 m_item_internal_list._internalSetCellSharedInfo(m_cell_family->commonItemSharedInfo());
289 <<
" AMR type = " << m_amr_type
290 <<
" allow_loose_items=" << m_mesh_kind.isNonManifold();
292 _printConnectivityPolicy();
296 m_use_mesh_item_family_dependencies = true ;
298 _addDependency(m_cell_family,m_node_family);
299 _addDependency(m_cell_family,m_face_family);
300 _addDependency(m_cell_family,m_edge_family);
301 _addDependency(m_face_family,m_node_family);
302 _addDependency(m_edge_family,m_node_family);
303 _addRelation(m_face_family,m_edge_family);
304 _addRelation(m_face_family,m_face_family);
305 _addRelation(m_face_family,m_cell_family);
306 _addRelation(m_edge_family,m_cell_family);
307 _addRelation(m_edge_family,m_face_family);
308 _addRelation(m_node_family,m_cell_family);
309 _addRelation(m_node_family,m_face_family);
310 _addRelation(m_node_family,m_edge_family);
316 m_family_modifiers.add(m_cell_family);
317 m_family_modifiers.add(m_face_family);
318 m_family_modifiers.add(m_node_family);
319 m_family_modifiers.add(m_edge_family);
324#ifdef USE_GRAPH_CONNECTIVITY_POLICY
328 m_item_family_network =
new ItemFamilyNetwork(
traceMng());
329 info()<<
"Graph connectivity is activated";
330 m_family_modifiers.add(m_cell_family);
331 m_family_modifiers.add(m_face_family);
332 m_family_modifiers.add(m_node_family);
333 m_family_modifiers.add(m_edge_family);
337 m_extra_ghost_cells_builder =
new ExtraGhostCellsBuilder(
this);
338 m_extra_ghost_particles_builder =
new ExtraGhostParticlesBuilder(
this);
344 m_do_not_save_need_compact = v.value();
349 bool is_generate = (v.value() != 0);
352 if (!is_generate &&
meshKind().isNonManifold())
354 m_mesh_unique_id_mng->setUseNodeUniqueIdToGenerateEdgeAndFaceUniqueId(is_generate);
366 if (m_extra_ghost_cells_builder->hasBuilder())
367 info() <<
"WARNING: pending ExtraGhostCellsBuilder reference";
368 if (m_extra_ghost_particles_builder->hasBuilder())
369 info() <<
"WARNING: pending ExtraGhostParticlesBuilder reference";
371 m_indexed_connectivity_mng =
nullptr;
372 delete m_mesh_compact_mng;
373 delete m_mesh_exchange_mng;
374 delete m_extra_ghost_cells_builder;
375 delete m_extra_ghost_particles_builder;
376 delete m_mesh_unique_id_mng;
377 delete m_ghost_layer_mng;
378 delete m_tied_interface_mng;
379 delete m_partition_constraint_mng;
380 delete m_mesh_utilities;
381 delete m_mesh_builder;
382 delete m_mesh_checker;
385 delete m_submesh_tools;
386 delete m_new_item_owner_builder;
397 m_properties->destroy();
400 delete m_cell_family;
401 delete m_face_family;
402 delete m_edge_family;
403 delete m_node_family;
405 delete m_item_type_mng;
416 info() <<
"Building DynamicMesh name=" <<
name()
417 <<
" ItemInternalMapImpl=" << ItemInternalMap::UseNewImpl;
419 m_item_type_mng->build(
this);
427 _buildAndInitFamily(family);
433 m_observer_pool.addObserver(
this,
438 m_observer_pool.addObserver(
this,
444 m_partition_constraint_mng =
new MeshPartitionConstraintMng(
this);
448 m_submesh_tools =
new SubMeshTools(
this, m_mesh_builder);
497 return m_parallel_mng;
507 ARCANE_FATAL(
"INTERNAL: DynamicMesh: invalid use of a null entity");
526 info() <<
"Reloading the mesh " <<
name();
527 m_is_allocated =
true;
532 m_mesh_checker->checkMeshFromReferenceFile();
534 info() <<
"Time to reallocate the mesh structures (direct method) (unit: second): "
544 m_mesh_checker->setCheckLevel(level);
553 return m_mesh_checker->checkLevel();
564 m_mesh_checker->checkValidMesh();
575 m_mesh_checker->checkValidMeshFull();
582checkValidConnectivity()
594 family->destroyGroups();
606 group = family->findGroup(
name);
632 ARCANE_CHECK_PTR(family);
639ItemGroup DynamicMesh::
640createGroup(
const String&
name,
const ItemGroup& parent)
642 IItemFamily* family = parent.itemFamily();
643 ARCANE_CHECK_PTR(family);
644 return family->createGroup(
name,parent);
651_computeSynchronizeInfos()
653 _computeFamilySynchronizeInfos();
654 _computeGroupSynchronizeInfos();
661_computeFamilySynchronizeInfos()
663 info() <<
"Computing family synchronization information for " <<
name();
665 family->computeSynchronizeInfos();
671 Int32 iteration = subDomain()->commonVariables().globalIteration();
672 String file_name = String::format(
"{0}_sync_topology_iter{1}.json",
name(),iteration);
673 mesh_utils::dumpSynchronizerTopologyJSON(var_syncer,file_name);
681_computeGroupSynchronizeInfos()
683 auto action = [](ItemGroup& group)
685 if (group.hasSynchronizer())
686 group.synchronizer()->compute();
689 info() <<
"Computing group synchronization information for " <<
name();
690 meshvisitor::visitGroups(
this,action);
721 items_owner[iitem] = item.
owner();
730 bool has_error =
false;
733 for(
const auto& i : child_list ){
734 String var_name = i.attrValue(
"nom");
737 error() <<
"Failed to initialize the variable `" << var_name
738 <<
"'\nNo variable with that name exists";
746 String grp_name = i.attrValue(
"groupe");
750 error() <<
"Failed to initialize the variable `" << var_name
751 <<
"' on the group `" << grp_name <<
"'\n"
752 <<
"No group with that name exists";
756 debug() <<
"Read value variable `" << grp_name
757 <<
"' `" << var_name <<
"' " << var;
758 String val_str = i.attrValue(
"valeur");
761 error() <<
"Failed to initialized the variable `" << var_name
762 <<
"' on the group `" << grp_name <<
"'";
768 fatal() <<
"Variable initialization failed";
786 m_mesh_builder->resetAfterDeallocate();
788 m_is_allocated =
false;
798 if (mesh_nb_cell==0 && !cells_infos.
empty())
799 ARCANE_FATAL(
"Can not dynamically compute the number of cells");
803 setEstimatedCells(mesh_nb_cell);
808 _allocateCells(mesh_nb_cell,cells_infos);
812 info() <<
"Time to build the mesh structures (indirect method) (unit: second): "
826 _checkConnectivity();
828 bool print_stats =
true;
832 info() <<
"Begin compute face unique ids";
835 m_mesh_builder->computeFacesUniqueIds();
837 info() <<
"Begin compute ghost layer";
840 m_mesh_builder->addGhostLayers(
true);
842 info() <<
"Begin compact items";
845 _allocateCells2(m_mesh_builder);
847 if (m_properties->getBool(PROPERTY_COMPACT_AFTER_ALLOCATE))
848 _compactItems(
true,
false);
850 _compactItemInternalReferences();
852 family->_internalApi()->endAllocate();
857#ifdef ARCANE_DEBUG_DYNAMIC_MESH
859 String file_name(
"mesh-end-allocate");
862 file_name += m_mesh_rank;
869 m_mesh_checker->checkMeshFromReferenceFile();
878 info() <<
"** Set owners from cells";
879 _setOwnersFromCells();
885 _notifyEndUpdateForFamilies();
889 m_is_allocated =
true;
904_allocateCells(
Integer mesh_nb_cell,
907 bool allow_build_face)
911 _checkConnectivity();
912 Int32 rank = meshRank();
913 if (m_use_mesh_item_family_dependencies)
914 m_mesh_builder->
addCells3(mesh_nb_cell,cells_infos,rank,cells,allow_build_face);
916 m_mesh_builder->
addCells(mesh_nb_cell,cells_infos,rank,cells,allow_build_face);
927 const bool allow_build_face = (m_parallel_mng->commSize() == 1);
928 _allocateCells(nb_cell,cells_infos,cells,allow_build_face);
937 bool allow_build_face = args.isAllowBuildFaces();
941 if (m_parallel_mng->commSize() > 1)
942 allow_build_face =
false;
943 _allocateCells(args.nbCell(),args.cellInfos(),args.cellLocalIds(),allow_build_face);
961 _addCells(buffer,&cells_local_id);
972 _checkConnectivity();
975 !IItemFamilyNetwork::plug_serializer) {
978 cell_serializer->deserializeItems(buffer,cells_local_id);
981 _deserializeItems(buffer, cells_local_id, m_cell_family);
989allocate(UnstructuredMeshAllocateBuildInfo& build_info)
991 auto* x = build_info._internal();
1000allocate(CartesianMeshAllocateBuildInfo& build_info)
1004 allocateCartesianMesh(
this,build_info);
1015 _checkConnectivity();
1018 !IItemFamilyNetwork::plug_serializer) {
1020 buffer->
setMode(ISerializer::ModeReserve);
1021 cell_serializer->serializeItems(buffer,cells_local_id);
1024 cell_serializer->serializeItems(buffer,cells_local_id);
1027 _serializeItems(buffer, cells_local_id, m_cell_family);
1040 using FamilyLidMap = std::map<String, Int32UniqueArray>;
1041 FamilyLidMap serialized_items;
1042 serialized_items[item_family->
name()] = item_local_ids;
1046 auto& connected_family_serialized_items = serialized_items[
connectivity->targetFamily()->
name()];
1047 connected_family_serialized_items.addRange(connectivity_accessor.connectedItems(
ItemLocalId(item)).localIds());
1051 buffer->
setMode(ISerializer::ModeReserve);
1052 _fillSerializer(buffer, serialized_items);
1055 _fillSerializer(buffer, serialized_items);
1063_deserializeItems(ISerializer* buffer,
Int32Array* item_local_ids, IItemFamily* item_family)
1065 ARCANE_UNUSED(item_family);
1068 auto family_serializer = std::unique_ptr<IItemFamilySerializer>{family->policyMng()->createSerializer()};
1069 family_serializer->deserializeItems(buffer,item_local_ids);
1071 IItemFamilyNetwork::InverseTopologicalOrder);
1073 auto family_serializer = std::unique_ptr<IItemFamilySerializer>{family->policyMng()->createSerializer()};
1074 family_serializer->deserializeItemRelations(buffer,item_local_ids);
1076 IItemFamilyNetwork::InverseTopologicalOrder);
1083_fillSerializer(ISerializer* buffer, std::map<String, Int32UniqueArray>& serialized_items)
1086 auto family_serializer = std::unique_ptr<IItemFamilySerializer>{family->policyMng()->createSerializer()};
1087 auto& serialized_items_local_ids = serialized_items[family->name()];
1088 family_serializer->serializeItems(buffer,serialized_items_local_ids);
1090 IItemFamilyNetwork::InverseTopologicalOrder);
1092 auto family_serializer = std::unique_ptr<IItemFamilySerializer>{family->policyMng()->createSerializer()};
1093 auto& serialized_items_local_ids = serialized_items[family->name()];
1094 family_serializer->serializeItemRelations(buffer,serialized_items_local_ids);
1096 IItemFamilyNetwork::InverseTopologicalOrder);
1103addParentCells(ItemVectorView & items)
1105 Trace::Setter mci(
traceMng(),_className());
1107 _checkConnectivity();
1108 m_mesh_builder->addParentCells(items);
1119 _checkConnectivity();
1120 bool allow_build_face =
false ;
1121 m_mesh_builder->addHChildrenCells(parent_cell,nb_cell,cells_infos,meshRank(),cells,allow_build_face);
1128addParentCellToCell(
Cell child,
Cell parent)
1132 _checkConnectivity();
1141addChildCellToCell(
Cell parent,
Cell child)
1145 _checkConnectivity();
1147 m_cell_family->_addChildCellToCell2(parent, child);
1154addParentFaceToFace(Face child, Face parent)
1156 Trace::Setter mci(
traceMng(), _className());
1158 _checkConnectivity();
1160 m_face_family->_addParentFaceToFace(parent, child);
1167addChildFaceToFace(Face parent, Face child)
1169 Trace::Setter mci(
traceMng(), _className());
1171 _checkConnectivity();
1173 m_face_family->_addChildFaceToFace(parent, child);
1180addParentNodeToNode(Node child, Node parent)
1182 Trace::Setter mci(
traceMng(), _className());
1184 _checkConnectivity();
1186 m_node_family->_addParentNodeToNode(parent, child);
1193addChildNodeToNode(Node parent, Node child)
1195 Trace::Setter mci(
traceMng(), _className());
1197 _checkConnectivity();
1199 m_node_family->_addChildNodeToNode(parent, child);
1209 _checkConnectivity();
1210 Int32 rank = meshRank();
1211 if (m_use_mesh_item_family_dependencies)
1212 m_mesh_builder->addFaces3(nb_face,face_infos,rank,faces);
1214 m_mesh_builder->addFaces(nb_face,face_infos,rank,faces);
1223 addFaces(args.nbFace(),args.faceInfos(),args.faceLocalIds());
1233 _checkConnectivity();
1234 Int32 rank = meshRank();
1235 if (m_use_mesh_item_family_dependencies)
1236 m_mesh_builder->addEdges3(nb_edge,edge_infos,rank,edges);
1238 m_mesh_builder->addEdges(nb_edge,edge_infos,rank,edges);
1248 _checkConnectivity();
1249 Int32 rank = meshRank();
1250 if (m_use_mesh_item_family_dependencies)
1251 m_mesh_builder->addNodes2(nodes_uid,rank,nodes);
1253 m_mesh_builder->addNodes(nodes_uid,rank,nodes);
1262 ARCANE_UNUSED(update_graph);
1264 if (m_use_mesh_item_family_dependencies)
1265 removeItems(m_cell_family,cells_local_id);
1269 if(m_item_family_network)
1281 ARCANE_UNUSED(item_family);
1282 ARCANE_ASSERT((
itemFamilyNetwork()),(
"Cannot call DynamicMesh::removeItems if no ItemFamilyNetwork available"))
1284 if (cells_local_id.empty())
1288 ItemDataList item_data_list;
1289 ItemData& cell_data = item_data_list.itemData(
Integer(m_cell_family->itemKind()),
1291 m_cell_family,(IItemFamilyModifier*)(m_cell_family),m_parallel_mng->commRank());
1293 for (auto local_id : cells_local_id) {
1295 cell_data.itemInfos()[i++] = (Int64)local_id;
1299 family->removeItems2(item_data_list);
1301 IItemFamilyNetwork::TopologicalOrder);
1311 if (m_use_mesh_item_family_dependencies)
1312 m_cell_family->detachCells2(cells_local_id);
1315 for(
Integer i=0, is=cells_local_id.
size(); i<is; ++i )
1316 m_cell_family->detachCell(cells[cells_local_id[i]]);
1327 if (m_use_mesh_item_family_dependencies)
1328 removeItems(m_cell_family,cells_local_id);
1331 for(
Integer i=0, is=cells_local_id.
size(); i<is; ++i )
1332 m_cell_family->removeDetachedCell(cells[cells_local_id[i]]);
1367 _checkConnectivity();
1377 Trace::Setter mci(
traceMng(),_className());
1379 _checkConnectivity();
1388coarsenItemsV2(
bool update_parent_flag)
1390 Trace::Setter mci(
traceMng(), _className());
1392 _checkConnectivity();
1395 ARCANE_FATAL(
"This method is not compatible with Cartesian Mesh Patch AMR");
1406 Trace::Setter mci(
traceMng(),_className());
1408 _checkConnectivity();
1421 _compactItems(
false,
true);
1428registerCallBack(IAMRTransportFunctor* f)
1430 Trace::Setter mci(
traceMng(),_className());
1438unRegisterCallBack(IAMRTransportFunctor* f)
1440 Trace::Setter mci(
traceMng(),_className());
1449_allocateCells2(DynamicMeshIncrementalBuilder* mib)
1451 Trace::Setter mci(
traceMng(),_className());
1453 _finalizeMeshChanged();
1457#ifdef ARCANE_DEBUG_DYNAMIC_MESH
1458 OCStringStream ostr;
1460 info() << ostr.str();
1468_writeMesh(
const String& base_name)
1470 StringBuilder file_name(base_name);
1472 IParallelMng* pm = m_parallel_mng;
1473 bool is_parallel = pm->isParallel();
1474 Int32 rank = meshRank();
1476 file_name += subDomain()->commonVariables().globalIteration();
1480 mesh_utils::writeMeshConnectivity(
this,file_name.toString());
1484 String mesh_file_name = file_name.toString() +
".mli";
1485 writer->writeMeshToFile(
this,mesh_file_name);
1493_printMesh(std::ostream& ostr)
1495 ostr <<
"----------- Mesh\n";
1496 ostr <<
" Nodes: " <<
nbNode() <<
'\n';
1497 ostr <<
" Edges: " <<
nbEdge() <<
'\n';
1498 ostr <<
" Faces: " <<
nbFace() <<
'\n';
1499 ostr <<
" Cells: " <<
nbCell() <<
'\n';
1500 mesh_utils::printItems(ostr,
"Nodes",
allNodes());
1501 mesh_utils::printItems(ostr,
"Edges",
allEdges());
1502 mesh_utils::printItems(ostr,
"Faces",
allFaces());
1503 mesh_utils::printItems(ostr,
"Cells",
allCells());
1514 info(4) <<
"DynamicMesh::_saveProperties() name=" <<
name()
1517 auto p = m_properties;
1518 p->setInt32(
"nb-ghostlayer",
ghostLayerMng()->nbGhostLayer());
1519 p->setInt32(
"ghostlayer-builder-version",
ghostLayerMng()->builderVersion());
1520 p->setInt32(
"part-info-part-rank",m_mesh_part_info.partRank());
1521 p->setInt32(
"part-info-nb-part",m_mesh_part_info.nbPart());
1522 p->setInt32(
"part-info-replication-rank",m_mesh_part_info.replicationRank());
1523 p->setInt32(
"part-info-nb-replication",m_mesh_part_info.nbReplication());
1524 p->setBool(
"has-itemsharedinfo-variables",
true);
1525 p->setInt64(
"mesh-timestamp",m_timestamp);
1526 if (!m_do_not_save_need_compact)
1527 p->setBool(
"need-compact",m_need_compact);
1538 auto p = m_properties;
1540 info(4) <<
"DynamicMesh::_readProperties() name=" <<
name()
1541 <<
" mesh-version=" << p->getInt32WithDefault(PROPERTY_MESH_VERSION,-1);
1546 if (p->get(
"nb-ghostlayer",x))
1548 if (p->get(
"ghostlayer-builder-version",x))
1550 if (p->get(
"part-info-part-rank",x))
1551 m_mesh_part_info.setPartRank(x);
1552 if (p->get(
"part-info-nb-part",x))
1553 m_mesh_part_info.setNbPart(x);
1554 if (p->get(
"part-info-replication-rank",x))
1555 m_mesh_part_info.setReplicationRank(x);
1556 if (p->get(
"part-info-nb-replication",x))
1557 m_mesh_part_info.setNbReplication(x);
1558 if (!m_do_not_save_need_compact){
1560 if (p->get(
"need-compact",xb))
1561 m_need_compact = xb;
1564 if (p->get(
"mesh-timestamp",x2))
1577 bool want_dump = m_properties->getBool(PROPERTY_DUMP);
1578 info(4) <<
"DynamicMesh::prepareForDump() name=" <<
name()
1579 <<
" need_compact?=" << m_need_compact
1580 <<
" want_dump?=" << want_dump
1581 <<
" timestamp=" << m_timestamp;
1585 m_mesh_events.eventObservable(t).notify(
MeshEventArgs(
this,t));
1600 m_mesh_events.eventObservable(t).notify(
MeshEventArgs(
this,t));
1612 if (m_need_compact){
1615 _compactItems(
true,
true);
1620 if (m_parent_mesh) {
1621 ARCANE_ASSERT((m_parent_group != NULL),(
"Unexpected NULL parent group"));
1625 ARCANE_ASSERT((m_parent_group == NULL),(
"Unexpected non-NULL parent group"));
1629 const Integer n_sub_mesh = m_child_meshes.size();
1631 for(
Integer i=0;i<n_sub_mesh; ++i)
1649 family->prepareForDump();
1652 if (m_tied_interface_need_prepare_dump){
1653 m_tied_interface_mng->prepareTiedInterfacesForDump();
1654 m_tied_interface_need_prepare_dump =
false;
1666 ARCANE_FATAL(
"Attempting to create a family that already exists '{0}'",
name);
1668 debug() <<
"Creating the entities family "
1674 _buildAndInitFamily(family);
1699 ARCANE_FATAL(
"Attempting to create an ItemFamily with an unknown item kind.");
1707IItemFamilyPolicyMng* DynamicMesh::
1708_createFamilyPolicyMng(ItemFamily* family)
1713 return createNodeFamilyPolicyMng(family);
1715 return createEdgeFamilyPolicyMng(family);
1717 return createFaceFamilyPolicyMng(family);
1719 return createCellFamilyPolicyMng(family);
1721 return createParticleFamilyPolicyMng(family);
1723 return createDoFFamilyPolicyMng(family);
1725 ARCANE_FATAL(
"Attempting to create an ItemFamily with an unknown item kind.");
1734_buildAndInitFamily(IItemFamily* family)
1738 IItemFamilyPolicyMng* policy_mng = _createFamilyPolicyMng(true_family);
1739 true_family->setPolicyMng(policy_mng);
1746_addFamily(ItemFamily* family)
1757 bool register_modifier_if_created)
1760 if (family->name()==
name && family->itemKind()==ik)
1762 if (create_if_needed){
1764 if(register_modifier_if_created){
1781 if (family->name()==
name)
1783 if (throw_exception)
1807_exchangeItems(
bool do_compact)
1816 if (!nb_exchange_str.
null()){
1817 bool is_bad = builtInGetValue(nb_exchange,nb_exchange_str);
1823 if (!exchange_version_str.
null()){
1824 builtInGetValue(exchange_version,exchange_version_str);
1827 info() <<
"DynamicMesh::_echangeItems() do_compact?=" << do_compact
1828 <<
" nb_exchange=" << nb_exchange <<
" version=" << exchange_version;
1834 _exchangeItemsNew();
1839 if (
ghostLayerMng()->nbGhostLayer()>1 && !m_use_mesh_item_family_dependencies)
1842 if (!check_exchange.null()){
1843 m_mesh_checker->checkGhostCells();
1844 pwarning() <<
"CHECKING SYNCHRONISATION !";
1845 m_mesh_checker->checkVariablesSynchronization();
1846 m_mesh_checker->checkItemGroupsSynchronization();
1849 m_mesh_checker->checkValidMesh();
1851 m_mesh_checker->checkValidConnectivity();
1889 if (version<1 || version>2)
1890 ARCANE_FATAL(
"Invalid value '{0}' for version. Valid values are 1 or 2",version);
1892 info() <<
"** ** MULTIPLE EXCHANGE ITEM version=" << version <<
" nb_exchange=" << nb_exchange;
1904 Int32 new_owner = cells_new_owner[icell];
1905 if (current_owner==new_owner)
1909 phase = (new_owner % nb_exchange);
1910 else if (version==1)
1911 phase = icell.index() / nb_cell;
1912 cells_to_exchange_new_owner[phase].
add(new_owner);
1913 cells_to_exchange_uid[phase].
add(cell.
uniqueId().asInt64());
1920 cells_new_owner[icell] = cell.
owner();
1926 for(
Integer i=0; i<nb_exchange; ++i ){
1930 info() <<
"MultipleExchange current_exchange=" << i <<
" nb_cell=" << nb_cell;
1931 uids_to_lids.
resize(nb_cell);
1936 for(
Integer z=0; z<nb_cell; ++z )
1937 cells_new_owner[cells[uids_to_lids[z]]] = new_owners[z];
1938 cells_new_owner.synchronize();
1940 _exchangeItemsNew();
1945 bool do_sort = m_properties->getBool(PROPERTY_SORT);
1946 _compactItems(do_sort,
true);
1956 _exchangeItems(m_properties->getBool(PROPERTY_COMPACT));
1966 family->clearItems();
1973class ItemsExchangeInfo2List
1977 ~ItemsExchangeInfo2List()
1979 for(
Integer i=0, is=size(); i<is; ++i ){
1999 Trace::Setter mci(
traceMng(),_className());
2004 m_need_compact =
true;
2006 if (arcane_debug_load_balancing){
2009 m_node_family->itemsNewOwner().checkIfSync(10);
2010 m_edge_family->itemsNewOwner().checkIfSync(10);
2011 m_face_family->itemsNewOwner().checkIfSync(10);
2012 m_cell_family->itemsNewOwner().checkIfSync(10);
2017 typedef Collection<DynamicMesh*> DynamicMeshCollection;
2018 DynamicMeshCollection all_cascade_meshes = List<DynamicMesh*>();
2019 all_cascade_meshes.add(
this);
2020 for(
Integer i=0;i<m_child_meshes.size();++i)
2021 all_cascade_meshes.add(m_child_meshes[i]);
2023 IMeshExchanger* iexchanger = m_mesh_exchange_mng->beginExchange();
2024 MeshExchanger* mesh_exchanger =
ARCANE_CHECK_POINTER(
dynamic_cast<MeshExchanger*
>(iexchanger));
2027 if (mesh_exchanger->computeExchangeInfos()){
2028 info() <<
"No load balance is performed";
2029 m_mesh_exchange_mng->endExchange();
2034 mesh_exchanger->processExchange();
2037 mesh_exchanger->removeNeededItems();
2043 auto action = [](ItemGroup& group)
2048 if (group.internal()->hasComputeFunctor() || group.isLocalToSubDomain())
2051 group.internal()->removeSuppressedItems();
2053 for( DynamicMesh*
mesh : all_cascade_meshes ){
2054 meshvisitor::visitGroups(
mesh,action);
2066 for( DynamicMesh* child_mesh : m_child_meshes )
2067 child_mesh->m_submesh_tools->removeDeadGhostCells();
2069 for(
Integer i_child_mesh=0;i_child_mesh<m_child_meshes.size();++i_child_mesh)
2070 m_child_meshes[i_child_mesh]->m_submesh_tools->removeDeadGhostCells();
2074 mesh_exchanger->allocateReceivedItems();
2078 for( DynamicMesh*
mesh : all_cascade_meshes )
2079 mesh->_internalEndUpdateInit(
true);
2081 mesh_exchanger->updateItemGroups();
2084 for( DynamicMesh*
mesh : all_cascade_meshes )
2085 mesh->_computeGroupSynchronizeInfos();
2088 mesh_exchanger->updateVariables();
2091 for( DynamicMesh*
mesh : all_cascade_meshes ){
2093 bool print_info = (
mesh==
this);
2094 mesh->_internalEndUpdateFinal(print_info);
2100 mesh_exchanger->finalizeExchange();
2103 m_mesh_exchange_mng->endExchange();
2111 if (m_extra_ghost_cells_builder->hasBuilder() || m_extra_ghost_particles_builder->hasBuilder())
2123 m_extra_ghost_cells_builder->addExtraGhostCellsBuilder(builder);
2132 m_extra_ghost_cells_builder->removeExtraGhostCellsBuilder(builder);
2141 m_extra_ghost_particles_builder->addExtraGhostParticlesBuilder(builder);
2150 m_extra_ghost_particles_builder->removeExtraGhostParticlesBuilder(builder);
2157_computeExtraGhostCells()
2159 m_extra_ghost_cells_builder->computeExtraGhostCells();
2166_computeExtraGhostParticles()
2168 m_extra_ghost_particles_builder->computeExtraGhostParticles();
2177 const Int32 sid = meshRank();
2182 UniqueArray<Int32> cells_to_remove;
2183 cells_to_remove.reserve(1000);
2185 ItemInternalMap& cells_map = m_cell_family->itemsMap();
2186 cells_map.eachItem([&](Item cell) {
2187 if (cell.owner() != sid)
2188 cells_to_remove.add(cell.localId());
2191 info() <<
"Number of cells to remove: " << cells_to_remove.size();
2192 m_cell_family->removeCells(cells_to_remove);
2206 auto action = [&](
const ItemGroup& group){ group.itemFamily()->partialEndUpdateGroup(group); };
2207 meshvisitor::visitGroups(
this,action);
2232 _internalUpdateGhost(
true, remove_old_ghost);
2233 _internalEndUpdateInit(
true);
2234 _synchronizeGroups();
2235 _computeGroupSynchronizeInfos();
2236 _internalEndUpdateResizeVariables();
2237 _synchronizeVariables();
2241 for(
Integer i=0;i<m_child_meshes.size();++i) {
2242 m_child_meshes[i]->endUpdate(
true, remove_old_ghost);
2249_removeGhostChildItems()
2251 const Int32 sid = meshRank();
2254 UniqueArray<Int32> cells_to_remove;
2255 cells_to_remove.reserve(1000);
2257 ItemInternalMap& cells_map = m_cell_family->itemsMap();
2259 cells_map.eachItem([&](impl::ItemBase cell) {
2260 if ((cell.owner() != sid) && (cell.level() != 0))
2261 max_level =
math::max(cell.level(),max_level);
2267 cells_map.eachItem([&](impl::ItemBase cell) {
2268 if ((cell.owner() != sid) && (cell.level() == max_level)) {
2269 cells_to_remove.add(cell.localId());
2273 info() <<
"Number of cells to remove: " << cells_to_remove.size();
2274 m_cell_family->removeCells(cells_to_remove);
2284_removeGhostChildItems2(Array<Int64>& cells_to_coarsen)
2286 const Int32 sid = meshRank();
2288 cells_to_coarsen.reserve(1000);
2291 UniqueArray<Cell> cells_to_remove;
2292 cells_to_remove.reserve(1000);
2294 ItemInternalMap& cells_map = m_cell_family->itemsMap();
2296 cells_map.eachItem([&](
Cell cell) {
2297 if (cell.owner() != sid)
2300 cells_to_coarsen.add(cell.uniqueId());
2301 for (
Integer c = 0, cs = cell.nbHChildren(); c < cs; c++) {
2302 cells_to_remove.add(cell.hChild(c));
2312 for(
Integer i=0, is=cells_to_remove.size(); i<is; ++i )
2313 m_cell_family->removeCell(cells_to_remove[i]);
2324 Array<Int64>& ghost_cell_to_coarsen_uid,
bool remove_old_ghost)
2327 CHECKPERF( m_perf_counter.start(PerfCounter::UPGHOSTLAYER1) ) ;
2329 m_need_compact =
true;
2334 if(remove_old_ghost){
2335 _removeGhostChildItems2(ghost_cell_to_coarsen_uid) ;
2339 m_face_family->setCheckOrientation(
false);
2341 m_mesh_builder->addGhostChildFromParent(ghost_cell_to_refine_uid);
2342 m_face_family->setCheckOrientation(
true);
2346 m_mesh_builder->printStats();
2347 CHECKPERF( m_perf_counter.stop(PerfCounter::UPGHOSTLAYER1) )
2350 CHECKPERF( m_perf_counter.start(PerfCounter::UPGHOSTLAYER2) )
2355 family->endUpdate();
2357 CHECKPERF( m_perf_counter.stop(PerfCounter::UPGHOSTLAYER2) )
2362 CHECKPERF( m_perf_counter.start(PerfCounter::UPGHOSTLAYER3) )
2368 CHECKPERF( m_perf_counter.stop(PerfCounter::UPGHOSTLAYER3) )
2374 CHECKPERF( m_perf_counter.start(PerfCounter::UPGHOSTLAYER4) )
2376 _synchronizeGroupsAndVariables();
2377 CHECKPERF( m_perf_counter.stop(PerfCounter::UPGHOSTLAYER4) )
2381 CHECKPERF( m_perf_counter.start(PerfCounter::UPGHOSTLAYER5) )
2383 m_cell_family->itemsUniqueIdToLocalId(ghost_cell_to_refine_lid,ghost_cell_to_refine_uid,
true) ;
2385 for (
Integer e = 0, i_size=ghost_cell_to_refine_lid.
size(); e != i_size; ++e){
2386 Cell i_hParent_cell(cells[ghost_cell_to_refine_lid[e]]);
2392 for(
Integer iface=0;iface<nb_face;++iface){
2393 Face face = i_hParent_cell.
face(iface);
2395 for(
Integer icell=0;icell<nb_cell;++icell){
2399 m_face_family->familyTree(childs,cell,
false) ;
2400 for(
Integer i=0,nchilds=childs.
size();i<nchilds;++i){
2409 CHECKPERF( m_perf_counter.stop(PerfCounter::UPGHOSTLAYER5) )
2413 CHECKPERF( m_perf_counter.start(PerfCounter::UPGHOSTLAYER6) )
2414 m_mesh_checker->checkMeshFromReferenceFile();
2421 bool do_compact = m_properties->getBool(PROPERTY_COMPACT);
2423 bool do_sort = m_properties->getBool(PROPERTY_SORT);
2424 _compactItems(do_sort,do_compact);
2426 CHECKPERF( m_perf_counter.stop(PerfCounter::UPGHOSTLAYER6) )
2428 if (arcane_debug_load_balancing){
2429 _writeMesh(
"update-ghost-layer-after");
2436 pinfo() <<
"Proc: " << meshRank()
2437 <<
" cellown=" << m_cell_family->allItems().own().size()
2438 <<
" cellloc=" << m_cell_family->allItems().size();
2442 CHECKPERF( m_perf_counter.start(PerfCounter::UPGHOSTLAYER7) )
2444 m_mesh_checker->updateAMRFaceOrientation(ghost_cell_to_refine_uid);
2446 if (m_mesh_checker->checkLevel()>=1)
2447 m_mesh_checker->checkValidConnectivity();
2448 CHECKPERF( m_perf_counter.stop(PerfCounter::UPGHOSTLAYER7) )
2450#ifdef ACTIVATE_PERF_COUNTER
2451 m_perf_counter.printInfo(
info().file()) ;
2459_internalUpdateGhost(
bool update_ghost_layer,
bool remove_old_ghost)
2461 m_need_compact =
true;
2465 if (update_ghost_layer)
2466 m_submesh_tools->updateGhostMesh();
2469 if (update_ghost_layer){
2470 if(remove_old_ghost){
2471 _removeGhostItems();
2475 m_mesh_builder->addGhostLayers(
false);
2477 _computeExtraGhostCells();
2478 _computeExtraGhostParticles();
2487_internalEndUpdateInit(
bool update_ghost_layer)
2494 _finalizeMeshChanged();
2498 if (update_ghost_layer){
2500 _computeFamilySynchronizeInfos();
2508_internalEndUpdateResizeVariables()
2512 family->_internalApi()->resizeVariables(
true);
2523 m_mesh_checker->checkMeshFromReferenceFile();
2531 _compactItemInternalReferences();
2534 bool do_compact = m_properties->getBool(PROPERTY_COMPACT);
2535 info(4) <<
"DynamicMesh::_internalEndUpdateFinal() compact?=" << do_compact <<
" sort?=" << m_properties->getBool(PROPERTY_SORT);
2537 bool do_sort = m_properties->getBool(PROPERTY_SORT);
2538 _compactItems(do_sort,do_compact);
2543 _notifyEndUpdateForFamilies();
2547 if (m_properties->getBool(PROPERTY_DISPLAY_STATS)){
2555 m_mesh_checker->updateAMRFaceOrientation();
2557 if (m_mesh_checker->checkLevel()>=1)
2558 m_mesh_checker->checkValidConnectivity();
2565_notifyEndUpdateForFamilies()
2568 family->_internalApi()->notifyEndUpdateFromMesh();
2584endUpdate(
bool update_ghost_layer,
bool remove_old_ghost)
2598 _internalUpdateGhost(update_ghost_layer, remove_old_ghost);
2600 _internalEndUpdateInit(update_ghost_layer);
2601 if (update_ghost_layer){
2602 _synchronizeGroups();
2603 _computeGroupSynchronizeInfos();
2605 _internalEndUpdateResizeVariables();
2606 if (update_ghost_layer){
2607 _synchronizeVariables();
2612 for( DynamicMesh* child_mesh : m_child_meshes )
2613 child_mesh->endUpdate(update_ghost_layer, remove_old_ghost);
2622 _synchronizeGroupsAndVariables();
2626 for( DynamicMesh* child_mesh : m_child_meshes )
2627 child_mesh->synchronizeGroupsAndVariables();
2634_synchronizeGroupsAndVariables()
2636 _synchronizeGroups();
2637 _synchronizeVariables();
2651 ItemGroupsSynchronize igs(m_edge_family);
2655 ItemGroupsSynchronize igs(m_face_family);
2659 ItemGroupsSynchronize igs(m_cell_family);
2665 IParticleFamily* pfamily = family->toParticleFamily();
2666 if (pfamily && pfamily->getEnableGhostItems()){
2667 ItemGroupsSynchronize igs(family);
2679_synchronizeVariables()
2691 typedef UniqueArray<IVariableSynchronizer*> OrderedSyncList;
2692 typedef std::map<IVariableSynchronizer*, VariableCollection> SyncList;
2693 OrderedSyncList ordered_sync_list;
2696 VariableCollection used_vars(subDomain()->
variableMng()->usedVariables());
2697 for( VariableCollection::Enumerator i_var(used_vars); ++i_var; ) {
2698 IVariable* var = *i_var;
2699 switch(var->itemKind()) {
2705 IVariableSynchronizer * synchronizer = 0;
2706 if (var->isPartial())
2707 synchronizer = var->itemGroup().synchronizer();
2709 synchronizer = var->itemFamily()->allItemsSynchronizer();
2710 IMesh * sync_mesh = synchronizer->itemGroup().mesh();
2711 if (sync_mesh !=
this)
continue;
2712 std::pair<SyncList::iterator,bool> inserter = sync_list.insert(std::make_pair(synchronizer,VariableCollection()));
2713 if (inserter.second) {
2714 ordered_sync_list.add(synchronizer);
2716 VariableCollection & collection = inserter.first->second;
2717 collection.add(var);
2725 for(
Integer i_sync = 0; i_sync < ordered_sync_list.size(); ++i_sync) {
2726 IVariableSynchronizer * synchronizer = ordered_sync_list[i_sync];
2727 VariableCollection & collection = sync_list[synchronizer];
2728 synchronizer->synchronize(collection);
2736_sortInternalReferences()
2739 m_node_family->sortInternalReferences();
2746_finalizeMeshChanged()
2750 debug() <<
"_finalizeMeshChanged on " << family->name() <<
" Family on Mesh " <<
name();
2751 family->endUpdate();
2754 bool do_sort = m_properties->getBool(PROPERTY_SORT);
2756 _sortInternalReferences();
2757 m_tied_interface_need_prepare_dump =
true;
2764_applyCompactPolicy(
const String& timer_name,
2765 std::function<
void(IItemFamilyCompactPolicy*)> functor)
2767 Timer::Action ts_action(m_sub_domain,timer_name);
2769 IItemFamilyCompactPolicy* c = family->policyMng()->compactPolicy();
2779_compactItemInternalReferences()
2781 _applyCompactPolicy(
"CompactConnectivityData",[&](IItemFamilyCompactPolicy* c)
2782 { c->compactConnectivityData(); });
2789_compactItems(
bool do_sort,
bool compact_variables_and_groups)
2792 info(4) <<
"Compress and sort the mesh entities " <<
name() <<
".";
2794 info(4) <<
"Compress the mesh entities " <<
name() <<
".";
2796 IMeshCompacter* compacter = m_mesh_compact_mng->beginCompact();
2799 compacter->setSorted(do_sort);
2800 compacter->_setCompactVariablesAndGroups(compact_variables_and_groups);
2802 compacter->doAllActions();
2805 m_mesh_compact_mng->endCompact();
2808 m_mesh_compact_mng->endCompact();
2811 Timer::Action ts_action(m_sub_domain,
"CompactItemSortReferences");
2814 _sortInternalReferences();
2817 m_need_compact =
false;
2828setEstimatedCells(
Integer nb_cell0)
2831 if (m_parallel_mng->isParallel())
2838 info() <<
"Estimating the number of entities:"
2839 <<
" Node=" << nb_node
2840 <<
" Edge=" << nb_edge
2841 <<
" Face=" << nb_face
2842 <<
" Cell=" << nb_cell;
2843 m_node_family->preAllocate(nb_node);
2844 m_edge_family->preAllocate(nb_edge);
2845 m_face_family->preAllocate(nb_face);
2846 m_cell_family->preAllocate(nb_cell);
2870 ARCANE_ASSERT((m_parent_mesh != NULL),(
"Unexpected NULL Mesh"));
2874 m_child_meshes.resize(n_sub_mesh);
2875 for(
Integer i=0;i<n_sub_mesh;++i)
2878 DynamicMesh* dynamic_child_mesh =
dynamic_cast<DynamicMesh*
>(child_mesh);
2879 if (dynamic_child_mesh == 0)
2880 ARCANE_FATAL(
"Cannot associate sub mesh from a different concrete type");
2881 m_child_meshes[i] = dynamic_child_mesh;
2887 for(
Integer i=0; i<nb_item_family; ++i ){
2888 info(5) <<
"Found family: I=" << i
2897 for(
Integer i=0; i<nb_item_family; ++i ){
2905 if (!m_is_sub_connectivity_set)
2906 _setSubConnectivity();
2910 family->readFromDump();
2914 _notifyEndUpdateForFamilies();
2917 m_item_internal_list.nodes = m_node_family->itemsInternal();
2918 m_item_internal_list.edges = m_edge_family->itemsInternal();
2919 m_item_internal_list.faces = m_face_family->itemsInternal();
2920 m_item_internal_list.cells = m_cell_family->itemsInternal();
2921 m_item_internal_list.mesh =
this;
2923 m_tied_interface_mng->readTiedInterfacesFromDump();
2925 m_mesh_builder->readFromDump();
2935 return m_tied_interface_mng->hasTiedInterface();
2944 return m_tied_interface_mng->tiedInterfaces();
2953 return m_tied_interface_mng->trueTiedInterfaces();
2962 m_tied_interface_mng->computeTiedInterfaces(mesh_node);
2972 _checkConnectivity();
2982 ARCANE_FATAL(
"DynamicMesh::setDimension(): mesh is already allocated");
2983 info() <<
"Mesh name=" <<
name() <<
" set dimension = " << dim;
2985 const bool is_non_manifold =
meshKind().isNonManifold();
2988 if (is_non_manifold){
2989 info() <<
"Force no-renumbering of edge and face uid because we are using non manifold mesh";
2999 if (!v && is_non_manifold) {
3001 info() <<
"Force using edge and face uid generation from nodes because we are using non manifold mesh";
3003 if (m_mesh_builder){
3004 auto* adder = m_mesh_builder->oneMeshItemAdder();
3010 if (dim == 3 && is_non_manifold) {
3012 if (!c.hasConnectivity(Connectivity::CT_HasEdge)) {
3013 c.enableConnectivity(Connectivity::CT_HasEdge);
3014 info() <<
"Force creating edges for 3D non-manifold mesh";
3023_checkDimension()
const
3026 ARCANE_FATAL(
"dimension not set. setDimension() must be called before allocating cells");
3036 if (!c.isFrozen()) {
3039 _setSubConnectivity();
3051 ARCANE_FATAL(
"DynamicMesh::_checkAMR(): amr activator not set.\t"
3052 "amr='true' must be set in the .arc file");
3059_setSubConnectivity()
3066 m_is_sub_connectivity_set =
true;
3073_writeCells(
const String& filename)
3075 CellGroup cells(m_cell_family->allItems());
3076 std::ofstream ofile(filename.localstr());
3079 ofile <<
"CELL: uid=" << cell.uniqueId() <<
" isown="
3080 << cell.isOwn() <<
" owner=" << cell.owner() <<
'\n';
3090 return m_node_family->nodesCoordinates();
3109_setOwnersFromCells()
3136 if(m_new_item_owner_builder == NULL)
3142 Node node = *i_node;
3143 nodes_owner[node] = m_new_item_owner_builder->ownerOfItem(node);
3145 nodes_owner.synchronize();
3149 Node node = *i_node;
3156 Edge edge = *i_edge;
3157 edges_owner[edge] = m_new_item_owner_builder->ownerOfItem(edge);
3159 edges_owner.synchronize();
3163 Edge edge = *i_edge;
3164 edge.mutableItemBase().setOwner(edges_owner[edge],sid);
3170 Face face = *i_face;
3171 faces_owner[face] = m_new_item_owner_builder->ownerOfItem(face);
3173 faces_owner.synchronize();
3177 Face face = *i_face;
3178 face.mutableItemBase().setOwner(faces_owner[face],sid);
3184 _computeFamilySynchronizeInfos();
3193 if (!m_mesh_utilities)
3195 return m_mesh_utilities;
3290 ARCANE_FATAL(
"Cannot set inconsistant mesh/group parents to mesh '{0}'",
name());
3292 if (m_parent_mesh) {
3293 if (m_parent_mesh !=
mesh)
3294 ARCANE_FATAL(
"Mesh '{0}' already has parent mesh '{1}'",
name(),m_parent_mesh->name());
3295 if (m_parent_group != group.
internal())
3296 ARCANE_FATAL(
"Mesh '{0}' already has parent group '{1}'",
name(),m_parent_group->name());
3299 m_parent_mesh =
mesh;
3304 dimension_shift = 1;
3307 dimension_shift = 0;
3310 ARCANE_FATAL(
"Only SubMesh on FaceGroup or CellGoup is allowed");
3313 _setDimension(
mesh->dimension()-dimension_shift);
3316 const eItemKind kind = family->itemKind();
3321 family->setParentFamily(
mesh->itemFamily(parent_kind));
3335 return m_partition_constraint_mng;
3344 return m_parent_mesh;
3362 DynamicMesh * dynamic_child_mesh =
dynamic_cast<DynamicMesh*
>(sub_mesh);
3363 if (!dynamic_child_mesh)
3364 ARCANE_FATAL(
"Cannot associate sub mesh from a different concrete type");
3365 for(
Integer i=0;i<m_child_meshes.size();++i)
3366 if (m_child_meshes[i] == dynamic_child_mesh)
3368 m_child_meshes.add(dynamic_child_mesh);
3378 for(
Integer i=0;i<m_child_meshes.size(); ++i) {
3379 collection.add(m_child_meshes[i]);
3390 return m_mesh_checker;
3419 return m_node_family->nbItem();
3424 return m_edge_family->nbItem();
3429 return m_face_family->nbItem();
3434 return m_cell_family->nbItem();
3440 return m_node_family;
3446 return m_edge_family;
3452 return m_face_family;
3458 return m_cell_family;
3461DynamicMeshKindInfos::ItemInternalMap& DynamicMesh::
3464 return m_node_family->itemsMap();
3467DynamicMeshKindInfos::ItemInternalMap& DynamicMesh::
3470 return m_edge_family->itemsMap();
3473DynamicMeshKindInfos::ItemInternalMap& DynamicMesh::
3476 return m_face_family->itemsMap();
3479DynamicMeshKindInfos::ItemInternalMap& DynamicMesh::
3482 return m_cell_family->itemsMap();
3494 true_meshes.
add(true_mesh);
3497 merger.mergeMeshes(true_meshes);
3504_printConnectivityPolicy()
3506 info() <<
"Connectivity policy=" << (int)m_connectivity_policy;
3509 ARCANE_FATAL(
"Invalid value '{0}' for InternalConnectivityPolicy. Only '{1}' is allowed",
3519 m_mesh_part_info = mpi;
3529 if (!m_item_family_network)
3533 if (c.hasConnectivity(c.kindsToConnectivity(con->sourceFamily()->itemKind(),con->targetFamily()->itemKind()))){
3545 return m_internal_api.get();
3554 return m_internal_api.get();
3563 _computeSynchronizeInfos();
3569class ARCANE_MESH_EXPORT DynamicMeshFactoryBase
3592 if (is_submesh && m_is_amr)
3569class ARCANE_MESH_EXPORT DynamicMeshFactoryBase {
…};
3605class ARCANE_MESH_EXPORT DynamicMeshFactory
3606:
public DynamicMeshFactoryBase
3610 : DynamicMeshFactoryBase(sbi,
false) {}
3605class ARCANE_MESH_EXPORT DynamicMeshFactory {
…};
3616class ARCANE_MESH_EXPORT DynamicAMRMeshFactory
3617:
public DynamicMeshFactoryBase
3621 : DynamicMeshFactoryBase(sbi,
true) {}
3616class ARCANE_MESH_EXPORT DynamicAMRMeshFactory {
…};
#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.
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)
static std::optional< Int32 > tryParseFromEnvironment(StringView s, bool throw_if_invalid)
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".
virtual void setBuilderVersion(Integer n)=0
Positionne la version du constructeur de mailles fantômes. Pour l'instant (version 3....
virtual Integer nbGhostLayer() const =0
Nombre de couches fantômes.
virtual void setNbGhostLayer(Integer n)=0
Positionne le nombre de couches fantômes.
Interface de modification d'une famille.
virtual List< IIncrementalItemConnectivity * > getConnectivities()=0
Obtenir la liste de toutes les connectivités, qu'elles soient relation ou dépendance.
virtual void removeConnectedDoFsFromCells(Int32ConstArrayView local_ids)=0
supprime les DoFs et les liens entre DoFs connectés aux mailles supprimées
virtual void setIsStored(IIncrementalItemConnectivity *connectivity)=0
Positionne une connectivité comme étant stockée.
virtual void schedule(IItemFamilyNetworkTask task, eSchedulingOrder order=TopologicalOrder)=0
Ordonnance l'exécution d'une tâche, dans l'ordre topologique ou topologique inverse du graphe de dépe...
virtual IItemFamilySerializer * createSerializer(bool with_flags=false)=0
Créé une instance pour la sérialisation des entités. L'instance retournée doit être détruite par l'op...
Interface d'une famille d'entités.
virtual ItemGroup findGroup(const String &name) const =0
Recherche un groupe.
virtual IVariableSynchronizer * allItemsSynchronizer()=0
Synchroniseur sur toutes les entités de la famille.
virtual ItemInternalArrayView itemsInternal()=0
Tableau interne des entités.
virtual String name() const =0
Nom de la famille.
virtual void notifyItemsOwnerChanged()=0
Notifie que les entités propres au sous-domaine de la famille ont été modifiées.
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.
virtual void setFaceBuilderVersion(Integer n)=0
Positionne la version de la numérotation des faces.
virtual void setEdgeBuilderVersion(Integer n)=0
Positionne la version de la numérotation des arêtes.
virtual bool isUseNodeUniqueIdToGenerateEdgeAndFaceUniqueId() const =0
Indique le mécanisme utilisé pour numéroter les arêtes ou les faces.
Interface d'une classe proposant des fonctions utilitaires sur maillage.
virtual void changeOwnersFromCells()=0
Positionne les nouveaux propriétaires des noeuds, arêtes et faces à partir des mailles.
virtual IMeshUtilities * utilities()=0
Interface des fonctions utilitaires associée.
virtual IItemFamilyNetwork * itemFamilyNetwork()=0
Interface du réseau de familles (familles connectées)
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.
virtual Int32 subDomainId() const =0
Numéro du sous-domaine associé à ce gestionnaire.
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.
@ II_JustCoarsened
L'entité vient d'être dé-raffiné
void executeExtend(const Int32ConstArrayView *new_items_info)
Execute l'action associée à l'extension.
Groupe d'entités de maillage.
ItemGroupImpl * internal() const
Retourne l'implémentation du groupe.
FaceGroup activeFaceGroup() const
Groupe des faces actives.
FaceGroup innerActiveFaceGroup() const
Groupe des faces internes des éléments de ce groupe.
Integer size() const
Nombre d'éléments du groupe.
FaceGroup ownActiveFaceGroup() const
Groupe des faces actives propres au domaine des éléments de ce groupe.
CellGroup levelCellGroup(const Integer &level) const
Groupe des mailles de niveau l des éléments de ce groupe.
eItemKind itemKind() const
Genre du groupe. Il s'agit du genre de ses éléments.
CellGroup ownActiveCellGroup() const
Groupe des mailles propres actives des éléments de ce groupe.
bool null() const
true is le groupe est le groupe nul
CellGroup ownLevelCellGroup(const Integer &level) const
Groupe des mailles propres de niveau l des éléments de ce groupe.
FaceGroup outerActiveFaceGroup() const
Groupe des faces externes actives des éléments de ce groupe.
IMesh * mesh() const
Maillage auquel appartient ce groupe (0 pour le group nul)
CellGroup activeCellGroup() const
AMR.
FaceGroup outerFaceGroup() const
Groupe des faces externes des éléments de ce groupe.
Informations pour synchroniser les groupes entre sous-domaines.
Structure interne d'une entité de maillage.
Index d'un Item dans une variable.
Gestionnaire des types d'entités d'un maillage.
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.
bool isOwn() const
true si l'entité est appartient au sous-domaine
Int32 owner() const
Numéro du sous-domaine propriétaire de l'entité
ItemUniqueId uniqueId() const
Identifiant unique sur tous les domaines.
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.
Gestionnaire des compactages de familles d'un maillage.
Arguments des évènements sur le maillage.
Interface du gestionnaire des échanges de maillages entre sous-domaines.
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.
Variables contenant les informations de connectivités communes aux maillages 1D, 2D et 3D.
VariableScalarString m_parent_group_name
Nom du groupe parent.
VariableScalarInteger m_mesh_connectivity
Connectivité du maillage.
VariableScalarInteger m_mesh_dimension
Dimension du maillage.
VariableArrayString m_item_families_name
Noms des familles d'entités.
VariableScalarString m_parent_mesh_name
Nom du maillage parent.
VariableArrayString m_child_meshes_name
Noms des maillages parentés.
VariableArrayInteger m_item_families_kind
Genre des entités des familles.
void setOwner(Integer suid, Int32 current_sub_domain)
Positionne le numéro du sous-domaine propriétaire de l'entité.
void setBool(const String &name, bool value)
Positionne une propriété de type bool de nom name et de valeur value.
Encapsulation d'un pointeur qui se détruit automatiquement.
Structure contenant les informations pour créer un service.
Ref< InterfaceType > createReference(const String &name, eServiceBuilderProperties properties=SB_None)
Créé une instance implémentant l'interface InterfaceType.
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.
Implémentation du gestionnaire d'interfaces liées.
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.
Classe d'accès aux traces.
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 fatal() const
Flot pour un message d'erreur fatale.
TraceMessage info() const
Flot pour un message d'information.
TraceMessage error() const
Flot pour un message d'erreur.
TraceMessage pwarning() const
Positionne une classe de message.
Vecteur 1D de données avec sémantique par valeur (style STL).
Fonctions utilitaires sur un maillage.
Function each(Function f)
Applique le fonctor f à tous les éléments de la collection.
String name() const
Nom de la variable.
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.
virtual void internalRemoveItems(Int32ConstArrayView local_ids, bool keep_ghost=false) override
void _addParentCellToCell(Cell cell, Cell parent_cell)
AMR.
void checkValidConnectivity()
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 d'un maillage de manière incrémentale.
void addCells(Integer nb_cell, Int64ConstArrayView cell_infos, Integer sub_domain_id, Int32ArrayView cells, bool allow_build_face=true)
Ajoute des mailles au maillage actuel.
void addCells3(Integer nb_cell, Int64ConstArrayView cell_infos, Integer sub_domain_id, Int32ArrayView cells, bool allow_build_face=true)
Ajoute des mailles au maillage actuel. Utilise l'ajout d'item générique basé sur dépendances entre fa...
Informations pour un échange de maillage entre sous-domaines.
IItemConnectivityMng * dofConnectivityMng() const noexcept override
Renvoie le gestionnaire de connectivités des dofs.
void removeNeedRemoveMarkedItems() override
Suppression des items qui quittent le sous-domaine. Cette méthode est appelée dans MeshExchanger.
void setMeshKind(const MeshKind &v) override
Positionne le type de maillage.
IPolyhedralMeshModifier * polyhedralMeshModifier() const noexcept override
Implémentation d'un maillage.
IPrimaryMesh * toPrimaryMesh() override
Retourne l'instance sous la forme d'un IPrimaryMesh.
FaceGroup ownActiveFaces() override
Groupe de toutes les faces actives sur la frontière.
void computeSynchronizeInfos() override
Recalcule les informations de synchronisation.
void flagCellToRefine(Int32ConstArrayView cells_lids) override
AMR.
IMeshPartitionConstraintMng * partitionConstraintMng() override
Gestionnaire des contraintes de partitionnement associées à ce maillage.
void checkValidMeshFull() override
Vérification de la validité du maillage.
Integer checkLevel() const override
Niveau actuel de vérification.
VariableItemInt32 & itemsNewOwner(eItemKind ik) override
Variable contenant l'identifiant du sous-domaine propriétaire.
IItemFamily * nodeFamily() override
Retourne la famille des noeuds.
FaceGroup outerActiveFaces() override
Groupe de toutes les faces actives sur la frontière.
void addExtraGhostCellsBuilder(IExtraGhostCellsBuilder *builder) override
ajout du algorithme d'ajout de mailles fantômes "extraordinaires".
IItemFamily * cellFamily() override
Retourne la famille des mailles.
IMeshCollection childMeshes() const override
Liste des sous-maillages du maillage courant.
void endAllocate() override
Indique une fin d'allocation de mailles.
FaceGroup allFaces() override
Groupe de toutes les faces.
void _internalEndUpdateFinal(bool print_stat)
void addEdges(Integer nb_edge, Int64ConstArrayView edge_infos, Int32ArrayView edges) override
Ajoute des arêtes.
IMeshModifierInternal * _modifierInternalApi() override
API interne à Arcane.
UniqueArray< ItemFamily * > m_true_item_families
Liste des implémentations des familles d'entités.
CellGroup allActiveCells() override
AMR.
ITraceMng * traceMng() override
Gestionnaire de message associé
void setDimension(Integer dim) override
Positionne la dimension du maillage (1D, 2D ou 3D).
IParallelMng * parallelMng() override
Gestionnaire de parallèlisme.
Integer nbCell() override
Nombre de mailles du maillage.
ItemGroup findGroup(const String &name) override
Retourne le groupe de nom name ou le groupe nul s'il n'y en a pas.
bool isPrimaryMesh() const override
Indique si l'instance est un maillage primaire.
IMeshChecker * checker() const override
Interface du vérificateur.
IMesh * mesh() override
Maillage associé
void removeExtraGhostCellsBuilder(IExtraGhostCellsBuilder *builder) override
Supprime l'association à l'instance builder.
void mergeMeshes(ConstArrayView< IMesh * > meshes) override
Fusionne les maillages de meshes avec le maillage actuel.
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 setCheckLevel(Integer level) override
Positionne le niveau de vérification du maillage.
NodeGroup ownNodes() override
Groupe de tous les noeuds propres au domaine.
void _readFromDump()
Recharge le maillage à partir des variables protégés.
EdgeGroup ownEdges() override
Groupe de toutes les arêtes propres au domaine.
void serializeCells(ISerializer *buffer, Int32ConstArrayView cells_local_id) override
void reloadMesh() override
Recharge le maillage à partir des variables protégées.
IMeshModifier * modifier() override
Interface de modification associée.
void addCells(Integer nb_cell, Int64ConstArrayView cell_infos, Int32ArrayView cells) override
Ajoute des mailles.
IItemFamilyModifier * findItemFamilyModifier(eItemKind ik, const String &name) override
Retourne l'interface IItemFamilyModifier pour famille de nom name et de type ik.
bool hasTiedInterface() override
Vrai s'il existe des interfaces semi-conformes dans le maillage.
VariableScalarInteger connectivity() override
Descripteur de connectivité
void addExtraGhostParticlesBuilder(IExtraGhostParticlesBuilder *builder) override
Ajout du algorithme d'ajout de particules fantômes "extraordinaires".
void exchangeItems() override
Change les sous-domaines propriétaires des entités.
void prepareForDump() override
Prépare l'instance en vue d'une protection.
SharedVariableNodeReal3 sharedNodesCoordinates() override
Coordonnées des noeuds.
void deallocate() override
Désalloue le maillage.
ItemGroupCollection groups() override
Liste des groupes.
void clearItems() override
Supprime toutes les entitées de toutes les familles de ce maillage.
void updateGhostLayers() override
ItemFamilyList m_item_families
Liste des interfaces familles d'entités.
EdgeGroup allEdges() override
Groupe de toutes les arêtes.
void detachCells(Int32ConstArrayView cells_local_id) override
Détache des mailles du maillage.
Integer nbNode() override
Nombre de noeuds du maillage.
CellGroup allCells() override
Groupe de toutes les mailles.
FaceGroup outerFaces() override
Groupe de toutes les faces sur la frontière.
IVariableMng * variableMng() const override
Gestionnaire de variable associé
IGhostLayerMng * ghostLayerMng() const override
Gestionnare de couche fantômes associé
void addChildMesh(IMesh *sub_mesh) override
Ajoute un sous-maillage au maillage parent.
void endUpdate() override
Notifie l'instance de la fin de la modification du maillage.
TiedInterfaceCollection tiedInterfaces() override
Liste des interfaces semi-conformes.
void synchronizeGroupsAndVariables() override
Synchronise tous les groupes et les variables du maillage.
void defineParentForBuild(IMesh *mesh, ItemGroup group) override
Définit les maillage et groupe parents.
InternalConnectivityPolicy _connectivityPolicy() const override
Politique d'utilisation des connectivitées.
void removeDetachedCells(Int32ConstArrayView cells_local_id) override
Supprime les mailles détachées.
Integer nbEdge() override
Nombre d'arêtes du maillage.
FaceGroup ownFaces() override
Groupe de toutes les faces propres au domaine.
IItemFamily * faceFamily() override
Retourne la famille des faces.
void addHChildrenCells(Cell parent_cell, Integer nb_cell, Int64ConstArrayView cells_infos, Int32ArrayView cells) override
AMR.
ItemGroup parentGroup() const override
Groupe parent.
void removeExtraGhostParticlesBuilder(IExtraGhostParticlesBuilder *builder) override
Supprime l'association à l'instance builder.
void destroyGroups() override
Détruit tous les groupes de toutes les familles.
void _saveProperties()
Sauve les propriétés avant une protection.
Integer nbFace() override
Nombre de faces du maillage.
IItemFamily * findItemFamily(eItemKind ik, const String &name, bool create_if_needed, bool register_modifier_if_created) override
Retourne la famille de nom name.
const MeshKind meshKind() const override
Caractéristiques du maillage.
Properties * properties() override
Propriétés associées à ce maillage.
FaceGroup allActiveFaces() override
Groupe de toutes les faces actives.
CellGroup ownCells() override
Groupe de toutes les mailles propres au domaine.
IMeshInternal * _internalApi() override
API interne à Arcane.
IItemFamilyNetwork * itemFamilyNetwork() override
Interface du réseau de familles (familles connectées)
void computeTiedInterfaces(const XmlNode &xml_node) override
Détermine les interfaces de semi-conformités.
IMesh * parentMesh() const override
Accès au maillage parent.
void setMeshPartInfo(const MeshPartInfo &mpi) override
Positionne les informations de partitionnement.
CellGroup ownActiveCells() override
Groupe de toutes les mailles actives et propres au domaine.
void _loadProperties()
Relit les propriétés depuis une protection.
void checkValidMesh() override
Vérification de la validité des structues internes de maillage (interne)
void initializeVariables(const XmlNode &init_node) override
void addNodes(Int64ConstArrayView nodes_uid, Int32ArrayView nodes) override
Ajoute des noeuds.
void updateGhostLayerFromParent(Array< Int64 > &ghost_cell_to_refine, Array< Int64 > &cells_to_coarsen, bool remove_old_ghost) override
AMR.
FaceGroup innerActiveFaces() override
Groupe de toutes les faces actives.
NodeGroup allNodes() override
Groupe de tous les noeuds.
void _prepareForDump()
Prépare les variables pour une protection.
void allocateCells(Integer mesh_nb_cell, Int64ConstArrayView cells_info, bool one_alloc) override
Allocation d'un maillage.
IItemFamily * edgeFamily() override
Retourne la famille des arêtes.
IMeshUtilities * utilities() override
Interface des fonctions utilitaires associée.
void _updateGroupsAfterRemove()
Met à jour les groupes suite à des suppressions d'entités.
void _multipleExchangeItems(Integer nb_exchange, Integer version, bool do_compact)
Echange les entités en plusieurs fois.
void _prepareForDumpReal()
Prépare les variables pour une protection.
ItemGroupList m_all_groups
Liste des groupes d'entités.
bool m_is_amr_activated
AMR.
MeshRefinement * m_mesh_refinement
AMR.
CellGroup ownLevelCells(const Integer &level) override
Groupe de toutes les mailles propres de niveau level.
CellGroup allLevelCells(const Integer &level) override
Groupe de toutes les mailles de niveau level.
void addFaces(Integer nb_face, Int64ConstArrayView face_infos, Int32ArrayView faces) override
Ajoute des faces.
void setCheckOrientation(bool is_check)
Indique s'il faut vérifier l'orientation des mailles et des faces.
Interface du gestionnaire des connectivités incrémentales indexées sur les entités.
IItemFamilyPolicyMng * policyMng() override
Interface des comportements/politiques associées à cette famille.
Informations pour échanger des entités d'une famille donnée et leur caractéristiques.
Implémentation des algorithmes d'adaptation par raffinement de maillages non-structuré.
bool refineItems(const bool maintain_level_one=true)
bool coarsenItems(const bool maintain_level_one=true)
Gestionnaire de numérotation des uniqueId() d'un maillage.
void setUseNodeUniqueIdToGenerateEdgeAndFaceUniqueId(bool v)
Positionne le mécanisme de numérotation des uniqueId().
T max(const T &a, const T &b, const T &c)
Retourne le maximum de trois éléments.
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.
@ None
Aucune politique d'exécution.
Integer toInteger(Real r)
Converti un Real en Integer.
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.
SharedMeshVariableScalarRefT< Node, Real3 > SharedVariableNodeReal3
Grandeur au noeud de type coordonnées.
@ 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.
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é.
double Real
Type représentant un réel.
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.
@ NewWithDependenciesAndLegacy
Alloue les anciennes et les nouvelles connectivités utilise les nouvelles via les nouveaux accesseurs...
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.