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)
177: MeshVariables(sub_domain,mbi.name())
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()))
217, m_mesh_exchange_mng(new MeshExchangeMng(this))
218, m_mesh_compact_mng(new MeshCompactMng(this))
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,
404 m_partition_constraint_mng =
new MeshPartitionConstraintMng(
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);
455 m_internal_api->build();
464 return m_parallel_mng;
474 ARCANE_FATAL(
"INTERNAL: DynamicMesh: invalid use of a null entity");
493 info() <<
"Reloading the mesh " <<
name();
494 m_is_allocated =
true;
499 m_mesh_checker->checkMeshFromReferenceFile();
501 info() <<
"Time to reallocate the mesh structures (direct method) (unit: second): "
511 m_mesh_checker->setCheckLevel(level);
520 return m_mesh_checker->checkLevel();
531 m_mesh_checker->checkValidMesh();
542 m_mesh_checker->checkValidMeshFull();
549checkValidConnectivity()
551 m_mesh_checker->checkValidConnectivity();
561 family->destroyGroups();
573 group = family->findGroup(
name);
588 return family->
findGroup(name,create_if_needed);
599 ARCANE_CHECK_PTR(family);
606ItemGroup DynamicMesh::
607createGroup(
const String& name,
const ItemGroup& parent)
609 IItemFamily* family = parent.itemFamily();
610 ARCANE_CHECK_PTR(family);
611 return family->createGroup(name,parent);
618_computeSynchronizeInfos()
620 _computeFamilySynchronizeInfos();
621 _computeGroupSynchronizeInfos();
628_computeFamilySynchronizeInfos()
630 info() <<
"Computing family synchronization information for " << name();
631 for( IItemFamily* family : m_item_families ){
632 family->computeSynchronizeInfos();
636 if (!platform::getEnvironmentVariable(
"ARCANE_DUMP_VARIABLE_SYNCHRONIZER_TOPOLOGY").null()){
637 auto* var_syncer = cellFamily()->allItemsSynchronizer();
638 Int32 iteration = subDomain()->commonVariables().globalIteration();
639 String file_name = String::format(
"{0}_sync_topology_iter{1}.json",name(),iteration);
640 mesh_utils::dumpSynchronizerTopologyJSON(var_syncer,file_name);
648_computeGroupSynchronizeInfos()
650 auto action = [](ItemGroup& group)
652 if (group.hasSynchronizer())
653 group.synchronizer()->compute();
656 info() <<
"Computing group synchronization information for " << name();
657 meshvisitor::visitGroups(
this,action);
680initializeVariables(
const XmlNode& init_node)
688 items_owner[iitem] = item.
owner();
697 bool has_error =
false;
700 for(
const auto& i : child_list ){
701 String var_name = i.attrValue(
"nom");
704 error() <<
"Failed to initialize the variable '" << var_name
705 <<
"' : no variable with that name exists";
717 error() <<
"Variable '" << var->
name() <<
"' has no family";
720 String grp_name = i.attrValue(
"groupe");
724 error() <<
"Failed to initialize the variable '" << var_name
725 <<
"' on the group `" << grp_name <<
"' : "
726 <<
"No group with that name exists for family '" << family->
name() <<
"'\n";
730 debug() <<
"Read value variable `" << grp_name
731 <<
"' `" << var_name <<
"' " << var;
732 String val_str = i.attrValue(
"valeur");
735 error() <<
"Failed to initialized the variable '" << var_name
736 <<
"' on the group `" << grp_name <<
"'";
760 m_mesh_builder->resetAfterDeallocate();
762 m_is_allocated =
false;
772 ARCANE_FATAL_IF(m_is_allocated,
"mesh has already been allocated (via endAllocate() or allocateCells())");
773 if (mesh_nb_cell==0 && !cells_infos.
empty())
774 ARCANE_FATAL(
"Can not dynamically compute the number of cells");
778 setEstimatedCells(mesh_nb_cell);
783 _allocateCells(mesh_nb_cell,cells_infos);
787 info() <<
"Time to build the mesh structures (indirect method) (unit: second): "
797 ARCANE_FATAL_IF(m_is_allocated,
"mesh has already been allocated (via endAllocate() or allocateCells())");
802 _checkConnectivity();
804 bool print_stats =
true;
808 info() <<
"Begin compute face unique ids";
811 m_mesh_builder->computeFacesUniqueIds();
813 info() <<
"Begin compute ghost layer";
816 m_mesh_builder->addGhostLayers(
true);
818 info() <<
"Begin compact items";
821 _allocateCells2(m_mesh_builder);
823 if (m_properties->getBool(PROPERTY_COMPACT_AFTER_ALLOCATE))
824 _compactItems(
true,
false);
826 _compactItemInternalReferences();
828 family->_internalApi()->endAllocate();
833#ifdef ARCANE_DEBUG_DYNAMIC_MESH
835 String file_name(
"mesh-end-allocate");
838 file_name += m_mesh_rank;
845 m_mesh_checker->checkMeshFromReferenceFile();
854 info() <<
"** Set owners from cells";
855 _setOwnersFromCells();
861 _notifyEndUpdateForFamilies();
865 m_is_allocated =
true;
880_allocateCells(
Integer mesh_nb_cell,
883 bool allow_build_face)
887 _checkConnectivity();
888 Int32 rank = meshRank();
889 if (m_use_mesh_item_family_dependencies)
890 m_mesh_builder->addCells3(mesh_nb_cell,cells_infos,rank,cells,allow_build_face);
892 m_mesh_builder->addCells(mesh_nb_cell,cells_infos,rank,cells,allow_build_face);
903 const bool allow_build_face = (m_parallel_mng->commSize() == 1);
904 _allocateCells(nb_cell,cells_infos,cells,allow_build_face);
913 bool allow_build_face = args.isAllowBuildFaces();
917 if (m_parallel_mng->commSize() > 1)
918 allow_build_face =
false;
919 _allocateCells(args.nbCell(),args.cellInfos(),args.cellLocalIds(),allow_build_face);
937 _addCells(buffer,&cells_local_id);
948 _checkConnectivity();
949 if (!itemFamilyNetwork() ||
950 !(itemFamilyNetwork() && itemFamilyNetwork()->isActivated()) ||
951 !IItemFamilyNetwork::plug_serializer) {
954 cell_serializer->deserializeItems(buffer,cells_local_id);
957 _deserializeItems(buffer, cells_local_id, m_cell_family);
965allocate(UnstructuredMeshAllocateBuildInfo& build_info)
967 auto* x = build_info._internal();
968 setDimension(x->meshDimension());
969 allocateCells(x->nbCell(),x->cellsInfos(),
true);
976allocate(CartesianMeshAllocateBuildInfo& build_info)
980 allocateCartesianMesh(
this,build_info);
991 _checkConnectivity();
994 !IItemFamilyNetwork::plug_serializer) {
996 buffer->
setMode(ISerializer::ModeReserve);
997 cell_serializer->serializeItems(buffer,cells_local_id);
1000 cell_serializer->serializeItems(buffer,cells_local_id);
1003 _serializeItems(buffer, cells_local_id, m_cell_family);
1016 using FamilyLidMap = std::map<String, Int32UniqueArray>;
1017 FamilyLidMap serialized_items;
1018 serialized_items[item_family->
name()] = item_local_ids;
1019 for (
const auto& connectivity :
mesh()->itemFamilyNetwork()->getChildDependencies(item_family)){
1022 auto& connected_family_serialized_items = serialized_items[connectivity->targetFamily()->name()];
1023 connected_family_serialized_items.addRange(connectivity_accessor.connectedItems(
ItemLocalId(item)).localIds());
1027 buffer->
setMode(ISerializer::ModeReserve);
1028 _fillSerializer(buffer, serialized_items);
1030 buffer->
setMode(ISerializer::ModePut);
1031 _fillSerializer(buffer, serialized_items);
1039_deserializeItems(ISerializer* buffer,Int32Array* item_local_ids, IItemFamily* item_family)
1041 ARCANE_UNUSED(item_family);
1042 buffer->setMode(ISerializer::ModeGet);
1043 mesh()->itemFamilyNetwork()->schedule([item_local_ids,buffer](IItemFamily* family) {
1044 auto family_serializer = std::unique_ptr<IItemFamilySerializer>{family->policyMng()->createSerializer()};
1045 family_serializer->deserializeItems(buffer,item_local_ids);
1047 IItemFamilyNetwork::InverseTopologicalOrder);
1048 mesh()->itemFamilyNetwork()->schedule([item_local_ids,buffer](IItemFamily* family) {
1049 auto family_serializer = std::unique_ptr<IItemFamilySerializer>{family->policyMng()->createSerializer()};
1050 family_serializer->deserializeItemRelations(buffer,item_local_ids);
1052 IItemFamilyNetwork::InverseTopologicalOrder);
1059_fillSerializer(ISerializer* buffer, std::map<String, Int32UniqueArray>& serialized_items)
1061 mesh()->itemFamilyNetwork()->schedule([& serialized_items,buffer](IItemFamily* family) {
1062 auto family_serializer = std::unique_ptr<IItemFamilySerializer>{family->policyMng()->createSerializer()};
1063 auto& serialized_items_local_ids = serialized_items[family->name()];
1064 family_serializer->serializeItems(buffer,serialized_items_local_ids);
1066 IItemFamilyNetwork::InverseTopologicalOrder);
1067 mesh()->itemFamilyNetwork()->schedule([& serialized_items,buffer](IItemFamily* family) {
1068 auto family_serializer = std::unique_ptr<IItemFamilySerializer>{family->policyMng()->createSerializer()};
1069 auto& serialized_items_local_ids = serialized_items[family->name()];
1070 family_serializer->serializeItemRelations(buffer,serialized_items_local_ids);
1072 IItemFamilyNetwork::InverseTopologicalOrder);
1079addParentCells(ItemVectorView & items)
1081 Trace::Setter mci(traceMng(),_className());
1083 _checkConnectivity();
1084 m_mesh_builder->addParentCells(items);
1095 _checkConnectivity();
1096 bool allow_build_face =
false ;
1097 m_mesh_builder->addHChildrenCells(parent_cell,nb_cell,cells_infos,meshRank(),cells,allow_build_face);
1104addParentCellToCell(
Cell child,
Cell parent)
1108 _checkConnectivity();
1110 m_cell_family->_addParentCellToCell(child,parent);
1117addChildCellToCell(
Cell parent,
Cell child)
1121 _checkConnectivity();
1123 m_cell_family->_addChildCellToCell2(parent, child);
1130addParentFaceToFace(Face child, Face parent)
1132 Trace::Setter mci(traceMng(), _className());
1134 _checkConnectivity();
1136 m_face_family->_addParentFaceToFace(parent, child);
1143addChildFaceToFace(Face parent, Face child)
1145 Trace::Setter mci(traceMng(), _className());
1147 _checkConnectivity();
1149 m_face_family->_addChildFaceToFace(parent, child);
1156addParentNodeToNode(Node child, Node parent)
1158 Trace::Setter mci(traceMng(), _className());
1160 _checkConnectivity();
1162 m_node_family->_addParentNodeToNode(parent, child);
1169addChildNodeToNode(Node parent, Node child)
1171 Trace::Setter mci(traceMng(), _className());
1173 _checkConnectivity();
1175 m_node_family->_addChildNodeToNode(parent, child);
1185 _checkConnectivity();
1186 Int32 rank = meshRank();
1187 if (m_use_mesh_item_family_dependencies)
1188 m_mesh_builder->addFaces3(nb_face,face_infos,rank,faces);
1190 m_mesh_builder->addFaces(nb_face,face_infos,rank,faces);
1199 addFaces(args.nbFace(),args.faceInfos(),args.faceLocalIds());
1209 _checkConnectivity();
1210 Int32 rank = meshRank();
1211 if (m_use_mesh_item_family_dependencies)
1212 m_mesh_builder->addEdges3(nb_edge,edge_infos,rank,edges);
1214 m_mesh_builder->addEdges(nb_edge,edge_infos,rank,edges);
1224 _checkConnectivity();
1225 Int32 rank = meshRank();
1226 if (m_use_mesh_item_family_dependencies)
1227 m_mesh_builder->addNodes2(nodes_uid,rank,nodes);
1229 m_mesh_builder->addNodes(nodes_uid,rank,nodes);
1238 ARCANE_UNUSED(update_graph);
1240 if (m_use_mesh_item_family_dependencies)
1241 removeItems(m_cell_family,cells_local_id);
1243 m_cell_family->internalRemoveItems(cells_local_id);
1245 if(m_item_family_network)
1247 m_item_family_network->removeConnectedDoFsFromCells(cells_local_id) ;
1255removeItems(IItemFamily* item_family, Int32ConstArrayView cells_local_id)
1257 ARCANE_UNUSED(item_family);
1258 ARCANE_ASSERT((itemFamilyNetwork()),(
"Cannot call DynamicMesh::removeItems if no ItemFamilyNetwork available"))
1260 if (cells_local_id.empty())
1264 ItemDataList item_data_list;
1265 ItemData& cell_data = item_data_list.itemData(Integer(m_cell_family->itemKind()),
1266 cells_local_id.size(),cells_local_id.size(),Int32ArrayView(),
1267 m_cell_family,(IItemFamilyModifier*)(m_cell_family),m_parallel_mng->commRank());
1269 for (auto local_id : cells_local_id) {
1271 cell_data.itemInfos()[i++] = (Int64)local_id;
1273 itemFamilyNetwork()->schedule([&item_data_list](IItemFamily* family){
1275 family->removeItems2(item_data_list);
1277 IItemFamilyNetwork::TopologicalOrder);
1287 if (m_use_mesh_item_family_dependencies)
1288 m_cell_family->detachCells2(cells_local_id);
1291 for(
Integer i=0, is=cells_local_id.
size(); i<is; ++i )
1292 m_cell_family->detachCell(cells[cells_local_id[i]]);
1303 if (m_use_mesh_item_family_dependencies)
1304 removeItems(m_cell_family,cells_local_id);
1307 for(
Integer i=0, is=cells_local_id.
size(); i<is; ++i )
1308 m_cell_family->removeDetachedCell(cells[cells_local_id[i]]);
1332 m_mesh_refinement->flagCellToCoarsen(lids);
1343 _checkConnectivity();
1345 m_mesh_refinement->refineItems(
true);
1353 Trace::Setter mci(traceMng(),_className());
1355 _checkConnectivity();
1357 m_mesh_refinement->coarsenItems(
true);
1364coarsenItemsV2(
bool update_parent_flag)
1366 Trace::Setter mci(traceMng(), _className());
1368 _checkConnectivity();
1370 if (m_amr_type != eMeshAMRKind::Cell) {
1371 ARCANE_FATAL(
"This method is not compatible with Cartesian Mesh Patch AMR");
1373 m_mesh_refinement->coarsenItemsV2(update_parent_flag);
1382 Trace::Setter mci(traceMng(),_className());
1384 _checkConnectivity();
1386 if(m_mesh_refinement->needUpdate())
1387 m_mesh_refinement->update() ;
1388 return m_mesh_refinement->refineAndCoarsenItems(
true);
1397 _compactItems(
false,
true);
1404registerCallBack(IAMRTransportFunctor* f)
1406 Trace::Setter mci(traceMng(),_className());
1408 m_mesh_refinement->registerCallBack(f);
1414unRegisterCallBack(IAMRTransportFunctor* f)
1416 Trace::Setter mci(traceMng(),_className());
1418 m_mesh_refinement->unRegisterCallBack(f);
1425_allocateCells2(DynamicMeshIncrementalBuilder* mib)
1427 Trace::Setter mci(traceMng(),_className());
1429 _finalizeMeshChanged();
1433#ifdef ARCANE_DEBUG_DYNAMIC_MESH
1434 OCStringStream ostr;
1436 info() << ostr.str();
1444_writeMesh(
const String& base_name)
1446 StringBuilder file_name(base_name);
1448 IParallelMng* pm = m_parallel_mng;
1449 bool is_parallel = pm->isParallel();
1450 Int32 rank = meshRank();
1452 file_name += subDomain()->commonVariables().globalIteration();
1456 mesh_utils::writeMeshConnectivity(
this,file_name.toString());
1458 auto writer(ServiceBuilder<IMeshWriter>::createReference(subDomain(),
"Lima"));
1460 String mesh_file_name = file_name.toString() +
".mli";
1461 writer->writeMeshToFile(
this,mesh_file_name);
1469_printMesh(std::ostream& ostr)
1471 ostr <<
"----------- Mesh\n";
1472 ostr <<
" Nodes: " << nbNode() <<
'\n';
1473 ostr <<
" Edges: " << nbEdge() <<
'\n';
1474 ostr <<
" Faces: " << nbFace() <<
'\n';
1475 ostr <<
" Cells: " << nbCell() <<
'\n';
1476 mesh_utils::printItems(ostr,
"Nodes",allNodes());
1477 mesh_utils::printItems(ostr,
"Edges",allEdges());
1478 mesh_utils::printItems(ostr,
"Faces",allFaces());
1479 mesh_utils::printItems(ostr,
"Cells",allCells());
1490 info(4) <<
"DynamicMesh::_saveProperties() name=" <<
name()
1493 auto p = m_properties;
1494 p->setInt32(
"nb-ghostlayer",
ghostLayerMng()->nbGhostLayer());
1495 p->setInt32(
"ghostlayer-builder-version",
ghostLayerMng()->builderVersion());
1496 p->setInt32(
"part-info-part-rank",m_mesh_part_info.partRank());
1497 p->setInt32(
"part-info-nb-part",m_mesh_part_info.nbPart());
1498 p->setInt32(
"part-info-replication-rank",m_mesh_part_info.replicationRank());
1499 p->setInt32(
"part-info-nb-replication",m_mesh_part_info.nbReplication());
1500 p->setBool(
"has-itemsharedinfo-variables",
true);
1501 p->setInt64(
"mesh-timestamp",m_timestamp);
1502 if (!m_do_not_save_need_compact)
1503 p->setBool(
"need-compact",m_need_compact);
1514 auto p = m_properties;
1516 info(4) <<
"DynamicMesh::_readProperties() name=" <<
name()
1517 <<
" mesh-version=" << p->getInt32WithDefault(PROPERTY_MESH_VERSION,-1);
1522 if (p->get(
"nb-ghostlayer",x))
1524 if (p->get(
"ghostlayer-builder-version",x))
1526 if (p->get(
"part-info-part-rank",x))
1527 m_mesh_part_info.setPartRank(x);
1528 if (p->get(
"part-info-nb-part",x))
1529 m_mesh_part_info.setNbPart(x);
1530 if (p->get(
"part-info-replication-rank",x))
1531 m_mesh_part_info.setReplicationRank(x);
1532 if (p->get(
"part-info-nb-replication",x))
1533 m_mesh_part_info.setNbReplication(x);
1534 if (!m_do_not_save_need_compact){
1536 if (p->get(
"need-compact",xb))
1537 m_need_compact = xb;
1540 if (p->get(
"mesh-timestamp",x2))
1553 bool want_dump = m_properties->getBool(PROPERTY_DUMP);
1554 info(4) <<
"DynamicMesh::prepareForDump() name=" <<
name()
1555 <<
" need_compact?=" << m_need_compact
1556 <<
" want_dump?=" << want_dump
1557 <<
" timestamp=" << m_timestamp;
1561 m_mesh_events.eventObservable(t).notify(
MeshEventArgs(
this,t));
1576 m_mesh_events.eventObservable(t).notify(
MeshEventArgs(
this,t));
1586_prepareForDumpReal()
1588 if (m_need_compact){
1591 _compactItems(
true,
true);
1596 if (m_parent_mesh) {
1597 ARCANE_ASSERT((m_parent_group != NULL),(
"Unexpected NULL parent group"));
1601 ARCANE_ASSERT((m_parent_group == NULL),(
"Unexpected non-NULL parent group"));
1605 const Integer n_sub_mesh = m_child_meshes.size();
1607 for(
Integer i=0;i<n_sub_mesh; ++i)
1625 family->prepareForDump();
1628 if (m_tied_interface_need_prepare_dump){
1629 m_tied_interface_mng->prepareTiedInterfacesForDump();
1630 m_tied_interface_need_prepare_dump =
false;
1642 ARCANE_FATAL(
"Attempting to create a family that already exists '{0}'",
name);
1644 debug() <<
"Creating the entities family "
1650 _buildAndInitFamily(family);
1675 ARCANE_FATAL(
"Attempting to create an ItemFamily with an unknown item kind.");
1683IItemFamilyPolicyMng* DynamicMesh::
1684_createFamilyPolicyMng(ItemFamily* family)
1686 eItemKind kind = family->itemKind();
1689 return createNodeFamilyPolicyMng(family);
1691 return createEdgeFamilyPolicyMng(family);
1693 return createFaceFamilyPolicyMng(family);
1695 return createCellFamilyPolicyMng(family);
1697 return createParticleFamilyPolicyMng(family);
1699 return createDoFFamilyPolicyMng(family);
1701 ARCANE_FATAL(
"Attempting to create an ItemFamily with an unknown item kind.");
1710_buildAndInitFamily(IItemFamily* family)
1714 IItemFamilyPolicyMng* policy_mng = _createFamilyPolicyMng(true_family);
1715 true_family->setPolicyMng(policy_mng);
1722_addFamily(ItemFamily* family)
1724 m_item_families.add(family);
1725 m_true_item_families.add(family);
1733 bool register_modifier_if_created)
1736 if (family->name()==
name && family->itemKind()==ik)
1738 if (create_if_needed){
1740 if(register_modifier_if_created){
1754findItemFamily(
const String&
name,
bool throw_exception)
1757 if (family->name()==
name)
1759 if (throw_exception)
1783_exchangeItems(
bool do_compact)
1792 if (!nb_exchange_str.
null()){
1793 bool is_bad = builtInGetValue(nb_exchange,nb_exchange_str);
1799 if (!exchange_version_str.
null()){
1800 builtInGetValue(exchange_version,exchange_version_str);
1803 info() <<
"DynamicMesh::_echangeItems() do_compact?=" << do_compact
1804 <<
" nb_exchange=" << nb_exchange <<
" version=" << exchange_version;
1807 _multipleExchangeItems(nb_exchange,exchange_version,do_compact);
1810 _exchangeItemsNew();
1815 if (ghostLayerMng()->nbGhostLayer()>1 && !m_use_mesh_item_family_dependencies)
1816 updateGhostLayers(
true);
1817 String check_exchange = platform::getEnvironmentVariable(
"ARCANE_CHECK_EXCHANGE");
1818 if (!check_exchange.null()){
1819 m_mesh_checker->checkGhostCells();
1820 pwarning() <<
"CHECKING SYNCHRONISATION !";
1821 m_mesh_checker->checkVariablesSynchronization();
1822 m_mesh_checker->checkItemGroupsSynchronization();
1824 if (checkLevel()>=2)
1825 m_mesh_checker->checkValidMesh();
1826 else if (checkLevel()>=1)
1827 m_mesh_checker->checkValidConnectivity();
1863_multipleExchangeItems(
Integer nb_exchange,
Integer version,
bool do_compact)
1865 if (version<1 || version>2)
1866 ARCANE_FATAL(
"Invalid value '{0}' for version. Valid values are 1 or 2",version);
1868 info() <<
"** ** MULTIPLE EXCHANGE ITEM version=" << version <<
" nb_exchange=" << nb_exchange;
1880 Int32 new_owner = cells_new_owner[icell];
1881 if (current_owner==new_owner)
1885 phase = (new_owner % nb_exchange);
1886 else if (version==1)
1887 phase = icell.index() / nb_cell;
1888 cells_to_exchange_new_owner[phase].
add(new_owner);
1889 cells_to_exchange_uid[phase].
add(cell.
uniqueId().asInt64());
1896 cells_new_owner[icell] = cell.
owner();
1902 for(
Integer i=0; i<nb_exchange; ++i ){
1906 info() <<
"MultipleExchange current_exchange=" << i <<
" nb_cell=" << nb_cell;
1907 uids_to_lids.
resize(nb_cell);
1912 for(
Integer z=0; z<nb_cell; ++z )
1913 cells_new_owner[cells[uids_to_lids[z]]] = new_owners[z];
1914 cells_new_owner.synchronize();
1915 mesh()->utilities()->changeOwnersFromCells();
1916 _exchangeItemsNew();
1921 bool do_sort = m_properties->getBool(PROPERTY_SORT);
1922 _compactItems(do_sort,
true);
1932 _exchangeItems(m_properties->getBool(PROPERTY_COMPACT));
1942 family->clearItems();
1949class ItemsExchangeInfo2List
1953 ~ItemsExchangeInfo2List()
1975 Trace::Setter mci(traceMng(),_className());
1980 m_need_compact =
true;
1982 if (arcane_debug_load_balancing){
1985 m_node_family->itemsNewOwner().checkIfSync(10);
1986 m_edge_family->itemsNewOwner().checkIfSync(10);
1987 m_face_family->itemsNewOwner().checkIfSync(10);
1988 m_cell_family->itemsNewOwner().checkIfSync(10);
1993 typedef Collection<DynamicMesh*> DynamicMeshCollection;
1994 DynamicMeshCollection all_cascade_meshes = List<DynamicMesh*>();
1995 all_cascade_meshes.add(
this);
1996 for(Integer i=0;i<m_child_meshes.size();++i)
1997 all_cascade_meshes.add(m_child_meshes[i]);
1999 IMeshExchanger* iexchanger = m_mesh_exchange_mng->beginExchange();
2000 MeshExchanger* mesh_exchanger =
ARCANE_CHECK_POINTER(
dynamic_cast<MeshExchanger*
>(iexchanger));
2003 if (mesh_exchanger->computeExchangeInfos()){
2004 info() <<
"No load balance is performed";
2005 m_mesh_exchange_mng->endExchange();
2010 mesh_exchanger->processExchange();
2013 mesh_exchanger->removeNeededItems();
2019 auto action = [](ItemGroup& group)
2024 if (group.internal()->hasComputeFunctor() || group.isLocalToSubDomain())
2027 group.internal()->removeSuppressedItems();
2029 for( DynamicMesh* mesh : all_cascade_meshes ){
2030 meshvisitor::visitGroups(mesh,action);
2042 for( DynamicMesh* child_mesh : m_child_meshes )
2043 child_mesh->m_submesh_tools->removeDeadGhostCells();
2045 for(Integer i_child_mesh=0;i_child_mesh<m_child_meshes.size();++i_child_mesh)
2046 m_child_meshes[i_child_mesh]->m_submesh_tools->removeDeadGhostCells();
2050 mesh_exchanger->allocateReceivedItems();
2054 for( DynamicMesh* mesh : all_cascade_meshes )
2055 mesh->_internalEndUpdateInit(
true);
2057 mesh_exchanger->updateItemGroups();
2060 for( DynamicMesh* mesh : all_cascade_meshes )
2061 mesh->_computeGroupSynchronizeInfos();
2064 mesh_exchanger->updateVariables();
2067 for( DynamicMesh* mesh : all_cascade_meshes ){
2069 bool print_info = (mesh==
this);
2070 mesh->_internalEndUpdateFinal(print_info);
2076 mesh_exchanger->finalizeExchange();
2079 m_mesh_exchange_mng->endExchange();
2087 if (m_extra_ghost_cells_builder->hasBuilder() || m_extra_ghost_particles_builder->hasBuilder())
2088 this->endUpdate(
true,
false);
2099 m_extra_ghost_cells_builder->addExtraGhostCellsBuilder(builder);
2108 m_extra_ghost_cells_builder->removeExtraGhostCellsBuilder(builder);
2117 m_extra_ghost_particles_builder->addExtraGhostParticlesBuilder(builder);
2126 m_extra_ghost_particles_builder->removeExtraGhostParticlesBuilder(builder);
2133_computeExtraGhostCells()
2135 m_extra_ghost_cells_builder->computeExtraGhostCells();
2142_computeExtraGhostParticles()
2144 m_extra_ghost_particles_builder->computeExtraGhostParticles();
2153 const Int32 sid = meshRank();
2158 UniqueArray<Int32> cells_to_remove;
2159 cells_to_remove.reserve(1000);
2161 ItemInternalMap& cells_map = m_cell_family->itemsMap();
2162 cells_map.eachItem([&](Item cell) {
2163 if (cell.owner() != sid)
2164 cells_to_remove.add(cell.localId());
2167 info() <<
"Number of cells to remove: " << cells_to_remove.size();
2168 m_cell_family->removeCells(cells_to_remove);
2171 _updateGroupsAfterRemove();
2180_updateGroupsAfterRemove()
2182 auto action = [&](
const ItemGroup& group){ group.itemFamily()->partialEndUpdateGroup(group); };
2183 meshvisitor::visitGroups(
this,action);
2199updateGhostLayers(
bool remove_old_ghost)
2208 _internalUpdateGhost(
true, remove_old_ghost);
2209 _internalEndUpdateInit(
true);
2210 _synchronizeGroups();
2211 _computeGroupSynchronizeInfos();
2212 _internalEndUpdateResizeVariables();
2213 _synchronizeVariables();
2214 _internalEndUpdateFinal(
true);
2217 for(
Integer i=0;i<m_child_meshes.size();++i) {
2218 m_child_meshes[i]->endUpdate(
true, remove_old_ghost);
2225_removeGhostChildItems()
2227 const Int32 sid = meshRank();
2230 UniqueArray<Int32> cells_to_remove;
2231 cells_to_remove.reserve(1000);
2233 ItemInternalMap& cells_map = m_cell_family->itemsMap();
2234 Integer max_level=0;
2235 cells_map.eachItem([&](impl::ItemBase cell) {
2236 if ((cell.owner() != sid) && (cell.level() != 0))
2237 max_level = math::max(cell.level(),max_level);
2243 cells_map.eachItem([&](impl::ItemBase cell) {
2244 if ((cell.owner() != sid) && (cell.level() == max_level)) {
2245 cells_to_remove.add(cell.localId());
2249 info() <<
"Number of cells to remove: " << cells_to_remove.size();
2250 m_cell_family->removeCells(cells_to_remove);
2253 _updateGroupsAfterRemove();
2260_removeGhostChildItems2(Array<Int64>& cells_to_coarsen)
2262 const Int32 sid = meshRank();
2264 cells_to_coarsen.reserve(1000);
2267 UniqueArray<Cell> cells_to_remove;
2268 cells_to_remove.reserve(1000);
2270 ItemInternalMap& cells_map = m_cell_family->itemsMap();
2272 cells_map.eachItem([&](Cell cell) {
2273 if (cell.owner() != sid)
2275 if (cell.hasFlags(ItemFlags::II_JustCoarsened)) {
2276 cells_to_coarsen.add(cell.uniqueId());
2277 for (Integer c = 0, cs = cell.nbHChildren(); c < cs; c++) {
2278 cells_to_remove.add(cell.hChild(c));
2288 for( Integer i=0, is=cells_to_remove.size(); i<is; ++i )
2289 m_cell_family->removeCell(cells_to_remove[i]);
2292 _updateGroupsAfterRemove();
2299updateGhostLayerFromParent(
Array<Int64>& ghost_cell_to_refine_uid,
2300 Array<Int64>& ghost_cell_to_coarsen_uid,
bool remove_old_ghost)
2303 CHECKPERF( m_perf_counter.start(PerfCounter::UPGHOSTLAYER1) ) ;
2305 m_need_compact =
true;
2310 if(remove_old_ghost){
2311 _removeGhostChildItems2(ghost_cell_to_coarsen_uid) ;
2315 m_face_family->setCheckOrientation(
false);
2317 m_mesh_builder->addGhostChildFromParent(ghost_cell_to_refine_uid);
2318 m_face_family->setCheckOrientation(
true);
2322 m_mesh_builder->printStats();
2323 CHECKPERF( m_perf_counter.stop(PerfCounter::UPGHOSTLAYER1) )
2326 CHECKPERF( m_perf_counter.start(PerfCounter::UPGHOSTLAYER2) )
2331 family->endUpdate();
2333 CHECKPERF( m_perf_counter.stop(PerfCounter::UPGHOSTLAYER2) )
2338 CHECKPERF( m_perf_counter.start(PerfCounter::UPGHOSTLAYER3) )
2344 CHECKPERF( m_perf_counter.stop(PerfCounter::UPGHOSTLAYER3) )
2350 CHECKPERF( m_perf_counter.start(PerfCounter::UPGHOSTLAYER4) )
2352 _synchronizeGroupsAndVariables();
2353 CHECKPERF( m_perf_counter.stop(PerfCounter::UPGHOSTLAYER4) )
2357 CHECKPERF( m_perf_counter.start(PerfCounter::UPGHOSTLAYER5) )
2359 m_cell_family->itemsUniqueIdToLocalId(ghost_cell_to_refine_lid,ghost_cell_to_refine_uid,
true) ;
2361 for (
Integer e = 0, i_size=ghost_cell_to_refine_lid.
size(); e != i_size; ++e){
2362 Cell i_hParent_cell(cells[ghost_cell_to_refine_lid[e]]);
2368 for(
Integer iface=0;iface<nb_face;++iface){
2369 Face face = i_hParent_cell.
face(iface);
2371 for(
Integer icell=0;icell<nb_cell;++icell){
2375 m_face_family->familyTree(childs,cell,
false) ;
2376 for(
Integer i=0,nchilds=childs.
size();i<nchilds;++i){
2385 CHECKPERF( m_perf_counter.stop(PerfCounter::UPGHOSTLAYER5) )
2389 CHECKPERF( m_perf_counter.start(PerfCounter::UPGHOSTLAYER6) )
2390 m_mesh_checker->checkMeshFromReferenceFile();
2397 bool do_compact = m_properties->getBool(PROPERTY_COMPACT);
2399 bool do_sort = m_properties->getBool(PROPERTY_SORT);
2400 _compactItems(do_sort,do_compact);
2402 CHECKPERF( m_perf_counter.stop(PerfCounter::UPGHOSTLAYER6) )
2404 if (arcane_debug_load_balancing){
2405 _writeMesh(
"update-ghost-layer-after");
2412 pinfo() <<
"Proc: " << meshRank()
2413 <<
" cellown=" << m_cell_family->allItems().own().size()
2414 <<
" cellloc=" << m_cell_family->allItems().size();
2418 CHECKPERF( m_perf_counter.start(PerfCounter::UPGHOSTLAYER7) )
2420 m_mesh_checker->updateAMRFaceOrientation(ghost_cell_to_refine_uid);
2422 if (m_mesh_checker->checkLevel()>=1)
2423 m_mesh_checker->checkValidConnectivity();
2424 CHECKPERF( m_perf_counter.stop(PerfCounter::UPGHOSTLAYER7) )
2426#ifdef ACTIVATE_PERF_COUNTER
2427 m_perf_counter.printInfo(
info().file()) ;
2435_internalUpdateGhost(
bool update_ghost_layer,
bool remove_old_ghost)
2437 m_need_compact =
true;
2441 if (update_ghost_layer)
2442 m_submesh_tools->updateGhostMesh();
2445 if (update_ghost_layer){
2446 if(remove_old_ghost){
2447 _removeGhostItems();
2450 m_face_family->setCheckOrientation(
false);
2451 m_mesh_builder->addGhostLayers(
false);
2452 m_face_family->setCheckOrientation(
true);
2453 _computeExtraGhostCells();
2454 _computeExtraGhostParticles();
2463_internalEndUpdateInit(
bool update_ghost_layer)
2470 _finalizeMeshChanged();
2474 if (update_ghost_layer){
2475 info() <<
"ComputeSyncInfos date=" << platform::getCurrentDateTime();
2476 _computeFamilySynchronizeInfos();
2484_internalEndUpdateResizeVariables()
2487 for( IItemFamily* family : m_item_families )
2488 family->_internalApi()->resizeVariables(
true);
2496_internalEndUpdateFinal(
bool print_stat)
2499 m_mesh_checker->checkMeshFromReferenceFile();
2507 _compactItemInternalReferences();
2510 bool do_compact = m_properties->getBool(PROPERTY_COMPACT);
2511 info(4) <<
"DynamicMesh::_internalEndUpdateFinal() compact?=" << do_compact <<
" sort?=" << m_properties->getBool(PROPERTY_SORT);
2513 bool do_sort = m_properties->getBool(PROPERTY_SORT);
2514 _compactItems(do_sort,do_compact);
2519 _notifyEndUpdateForFamilies();
2523 if (m_properties->getBool(PROPERTY_DISPLAY_STATS)){
2531 m_mesh_checker->updateAMRFaceOrientation();
2533 if (m_mesh_checker->checkLevel()>=1)
2534 m_mesh_checker->checkValidConnectivity();
2541_notifyEndUpdateForFamilies()
2544 family->_internalApi()->notifyEndUpdateFromMesh();
2560endUpdate(
bool update_ghost_layer,
bool remove_old_ghost)
2574 _internalUpdateGhost(update_ghost_layer, remove_old_ghost);
2576 _internalEndUpdateInit(update_ghost_layer);
2577 if (update_ghost_layer){
2578 _synchronizeGroups();
2579 _computeGroupSynchronizeInfos();
2581 _internalEndUpdateResizeVariables();
2582 if (update_ghost_layer){
2583 _synchronizeVariables();
2585 _internalEndUpdateFinal(
false);
2588 for( DynamicMesh* child_mesh : m_child_meshes )
2589 child_mesh->endUpdate(update_ghost_layer, remove_old_ghost);
2596synchronizeGroupsAndVariables()
2598 _synchronizeGroupsAndVariables();
2602 for( DynamicMesh* child_mesh : m_child_meshes )
2603 child_mesh->synchronizeGroupsAndVariables();
2610_synchronizeGroupsAndVariables()
2612 _synchronizeGroups();
2613 _synchronizeVariables();
2627 ItemGroupsSynchronize igs(m_edge_family);
2631 ItemGroupsSynchronize igs(m_face_family);
2635 ItemGroupsSynchronize igs(m_cell_family);
2639 for( IItemFamily* family : m_item_families ){
2640 if (family->itemKind()==IK_Particle){
2641 IParticleFamily* pfamily = family->toParticleFamily();
2642 if (pfamily && pfamily->getEnableGhostItems()){
2643 ItemGroupsSynchronize igs(family);
2655_synchronizeVariables()
2667 typedef UniqueArray<IVariableSynchronizer*> OrderedSyncList;
2668 typedef std::map<IVariableSynchronizer*, VariableCollection> SyncList;
2669 OrderedSyncList ordered_sync_list;
2672 VariableCollection used_vars(subDomain()->variableMng()->usedVariables());
2673 for( VariableCollection::Enumerator i_var(used_vars); ++i_var; ) {
2674 IVariable* var = *i_var;
2675 switch(var->itemKind()) {
2681 IVariableSynchronizer * synchronizer = 0;
2682 if (var->isPartial())
2683 synchronizer = var->itemGroup().synchronizer();
2685 synchronizer = var->itemFamily()->allItemsSynchronizer();
2686 IMesh * sync_mesh = synchronizer->itemGroup().mesh();
2687 if (sync_mesh !=
this)
continue;
2688 std::pair<SyncList::iterator,bool> inserter = sync_list.insert(std::make_pair(synchronizer,VariableCollection()));
2689 if (inserter.second) {
2690 ordered_sync_list.add(synchronizer);
2692 VariableCollection & collection = inserter.first->second;
2693 collection.add(var);
2701 for(Integer i_sync = 0; i_sync < ordered_sync_list.size(); ++i_sync) {
2702 IVariableSynchronizer * synchronizer = ordered_sync_list[i_sync];
2703 VariableCollection & collection = sync_list[synchronizer];
2704 synchronizer->synchronize(collection);
2712_sortInternalReferences()
2715 m_node_family->sortInternalReferences();
2722_finalizeMeshChanged()
2725 for( IItemFamily* family : m_item_families ){
2726 debug() <<
"_finalizeMeshChanged on " << family->name() <<
" Family on Mesh " << name();
2727 family->endUpdate();
2730 bool do_sort = m_properties->getBool(PROPERTY_SORT);
2732 _sortInternalReferences();
2733 m_tied_interface_need_prepare_dump =
true;
2740_applyCompactPolicy(
const String& timer_name,
2741 std::function<
void(IItemFamilyCompactPolicy*)> functor)
2743 Timer::Action ts_action(m_sub_domain,timer_name);
2744 for( IItemFamily* family : m_item_families ){
2745 IItemFamilyCompactPolicy* c = family->policyMng()->compactPolicy();
2755_compactItemInternalReferences()
2757 _applyCompactPolicy(
"CompactConnectivityData",[&](IItemFamilyCompactPolicy* c)
2758 { c->compactConnectivityData(); });
2765_compactItems(
bool do_sort,
bool compact_variables_and_groups)
2768 info(4) <<
"Compress and sort the mesh entities " << name() <<
".";
2770 info(4) <<
"Compress the mesh entities " << name() <<
".";
2772 IMeshCompacter* compacter = m_mesh_compact_mng->beginCompact();
2775 compacter->setSorted(do_sort);
2776 compacter->_setCompactVariablesAndGroups(compact_variables_and_groups);
2778 compacter->doAllActions();
2781 m_mesh_compact_mng->endCompact();
2784 m_mesh_compact_mng->endCompact();
2787 Timer::Action ts_action(m_sub_domain,
"CompactItemSortReferences");
2790 _sortInternalReferences();
2793 m_need_compact =
false;
2804setEstimatedCells(Integer nb_cell0)
2807 if (m_parallel_mng->isParallel())
2810 Integer nb_node = Convert::toInteger(nb_cell0 * 1.2 * factor);
2811 Integer nb_edge = Convert::toInteger(nb_cell0 * 6.8 * factor);
2812 Integer nb_face = Convert::toInteger(nb_cell0 * 3.4 * factor);
2813 Integer nb_cell = Convert::toInteger(nb_cell0 * 1.0 * factor);
2814 info() <<
"Estimating the number of entities:"
2815 <<
" Node=" << nb_node
2816 <<
" Edge=" << nb_edge
2817 <<
" Face=" << nb_face
2818 <<
" Cell=" << nb_cell;
2819 m_node_family->preAllocate(nb_node);
2820 m_edge_family->preAllocate(nb_edge);
2821 m_face_family->preAllocate(nb_face);
2822 m_cell_family->preAllocate(nb_cell);
2846 ARCANE_ASSERT((m_parent_mesh != NULL),(
"Unexpected NULL Mesh"));
2850 m_child_meshes.resize(n_sub_mesh);
2851 for(
Integer i=0;i<n_sub_mesh;++i)
2854 DynamicMesh* dynamic_child_mesh =
dynamic_cast<DynamicMesh*
>(child_mesh);
2855 if (dynamic_child_mesh == 0)
2856 ARCANE_FATAL(
"Cannot associate sub mesh from a different concrete type");
2857 m_child_meshes[i] = dynamic_child_mesh;
2863 for(
Integer i=0; i<nb_item_family; ++i ){
2864 info(5) <<
"Found family: I=" << i
2873 for(
Integer i=0; i<nb_item_family; ++i ){
2881 if (!m_is_sub_connectivity_set)
2882 _setSubConnectivity();
2886 family->readFromDump();
2890 _notifyEndUpdateForFamilies();
2893 m_item_internal_list.nodes = m_node_family->itemsInternal();
2894 m_item_internal_list.edges = m_edge_family->itemsInternal();
2895 m_item_internal_list.faces = m_face_family->itemsInternal();
2896 m_item_internal_list.cells = m_cell_family->itemsInternal();
2897 m_item_internal_list.mesh =
this;
2899 m_tied_interface_mng->readTiedInterfacesFromDump();
2901 m_mesh_builder->readFromDump();
2911 return m_tied_interface_mng->hasTiedInterface();
2920 return m_tied_interface_mng->tiedInterfaces();
2929 return m_tied_interface_mng->trueTiedInterfaces();
2936computeTiedInterfaces(
const XmlNode& mesh_node)
2938 m_tied_interface_mng->computeTiedInterfaces(mesh_node);
2948 _checkConnectivity();
2958 ARCANE_FATAL(
"DynamicMesh::setDimension(): mesh is already allocated");
2959 info() <<
"Mesh name=" << name() <<
" set dimension = " << dim;
2960 m_mesh_dimension = dim;
2961 const bool is_non_manifold = meshKind().isNonManifold();
2964 if (is_non_manifold){
2965 info() <<
"Force no-renumbering of edge and face uid because we are using non manifold mesh";
2966 m_mesh_unique_id_mng->setFaceBuilderVersion(0);
2967 m_mesh_unique_id_mng->setEdgeBuilderVersion(0);
2969 bool v = m_mesh_unique_id_mng->isUseNodeUniqueIdToGenerateEdgeAndFaceUniqueId();
2975 if (!v && is_non_manifold) {
2977 info() <<
"Force using edge and face uid generation from nodes because we are using non manifold mesh";
2979 if (m_mesh_builder){
2980 auto* adder = m_mesh_builder->oneMeshItemAdder();
2982 adder->setUseNodeUniqueIdToGenerateEdgeAndFaceUniqueId(v);
2986 if (dim == 3 && is_non_manifold) {
2987 Connectivity c(m_mesh_connectivity);
2988 if (!c.hasConnectivity(Connectivity::CT_HasEdge)) {
2989 c.enableConnectivity(Connectivity::CT_HasEdge);
2990 info() <<
"Force creating edges for 3D non-manifold mesh";
2999_checkDimension()
const
3001 if (m_mesh_dimension()<0)
3002 ARCANE_FATAL(
"dimension not set. setDimension() must be called before allocating cells");
3011 Connectivity c(m_mesh_connectivity);
3012 if (!c.isFrozen()) {
3014 debug() <<
"Mesh " << name() <<
" connectivity : " << Connectivity::Printer(m_mesh_connectivity());
3015 _setSubConnectivity();
3016 _updateItemFamilyDependencies(m_mesh_connectivity);
3026 if (!m_is_amr_activated)
3027 ARCANE_FATAL(
"DynamicMesh::_checkAMR(): amr activator not set.\t"
3028 "amr='true' must be set in the .arc file");
3035_setSubConnectivity()
3037 m_mesh_builder->setConnectivity(m_mesh_connectivity());
3038 m_node_family->setConnectivity(m_mesh_connectivity());
3039 m_edge_family->setConnectivity(m_mesh_connectivity());
3040 m_face_family->setConnectivity(m_mesh_connectivity());
3041 m_cell_family->setConnectivity(m_mesh_connectivity());
3042 m_is_sub_connectivity_set =
true;
3049_writeCells(
const String& filename)
3051 CellGroup cells(m_cell_family->allItems());
3052 std::ofstream ofile(filename.localstr());
3055 ofile <<
"CELL: uid=" << cell.uniqueId() <<
" isown="
3056 << cell.isOwn() <<
" owner=" << cell.owner() <<
'\n';
3066 return m_node_family->nodesCoordinates();
3073sharedNodesCoordinates()
3085_setOwnersFromCells()
3109 const Integer sid = subDomain()->subDomainId();
3112 if(m_new_item_owner_builder == NULL)
3118 Node node = *i_node;
3119 nodes_owner[node] = m_new_item_owner_builder->ownerOfItem(node);
3121 nodes_owner.synchronize();
3125 Node node = *i_node;
3132 Edge edge = *i_edge;
3133 edges_owner[edge] = m_new_item_owner_builder->ownerOfItem(edge);
3135 edges_owner.synchronize();
3139 Edge edge = *i_edge;
3140 edge.mutableItemBase().setOwner(edges_owner[edge],sid);
3146 Face face = *i_face;
3147 faces_owner[face] = m_new_item_owner_builder->ownerOfItem(face);
3149 faces_owner.synchronize();
3153 Face face = *i_face;
3154 face.mutableItemBase().setOwner(faces_owner[face],sid);
3157 nodeFamily()->notifyItemsOwnerChanged();
3158 edgeFamily()->notifyItemsOwnerChanged();
3159 faceFamily()->notifyItemsOwnerChanged();
3160 _computeFamilySynchronizeInfos();
3169 if (!m_mesh_utilities)
3171 return m_mesh_utilities;
3180 return m_cell_family->allItems().outerFaceGroup();
3190 return m_cell_family->allItems().activeCellGroup();
3198 return m_cell_family->allItems().ownActiveCellGroup();
3204allLevelCells(
const Integer& level)
3206 return m_cell_family->allItems().levelCellGroup(level);
3212ownLevelCells(
const Integer& level)
3214 return m_cell_family->allItems().ownLevelCellGroup(level);
3222 return m_cell_family->allItems().activeFaceGroup();
3230 return m_cell_family->allItems().ownActiveFaceGroup();
3241 return m_cell_family->allItems().innerActiveFaceGroup();
3249 return m_cell_family->allItems().outerActiveFaceGroup();
3266 ARCANE_FATAL(
"Cannot set inconsistant mesh/group parents to mesh '{0}'",
name());
3268 if (m_parent_mesh) {
3269 if (m_parent_mesh !=
mesh)
3270 ARCANE_FATAL(
"Mesh '{0}' already has parent mesh '{1}'",
name(),m_parent_mesh->name());
3271 if (m_parent_group != group.
internal())
3272 ARCANE_FATAL(
"Mesh '{0}' already has parent group '{1}'",
name(),m_parent_group->name());
3275 m_parent_mesh =
mesh;
3280 dimension_shift = 1;
3283 dimension_shift = 0;
3286 ARCANE_FATAL(
"Only SubMesh on FaceGroup or CellGoup is allowed");
3289 _setDimension(
mesh->dimension()-dimension_shift);
3292 const eItemKind kind = family->itemKind();
3297 family->setParentFamily(
mesh->itemFamily(parent_kind));
3309partitionConstraintMng()
3311 return m_partition_constraint_mng;
3320 return m_parent_mesh;
3336addChildMesh(
IMesh * sub_mesh)
3338 DynamicMesh * dynamic_child_mesh =
dynamic_cast<DynamicMesh*
>(sub_mesh);
3339 if (!dynamic_child_mesh)
3340 ARCANE_FATAL(
"Cannot associate sub mesh from a different concrete type");
3341 for(
Integer i=0;i<m_child_meshes.size();++i)
3342 if (m_child_meshes[i] == dynamic_child_mesh)
3344 m_child_meshes.add(dynamic_child_mesh);
3354 for(
Integer i=0;i<m_child_meshes.size(); ++i) {
3355 collection.add(m_child_meshes[i]);
3366 return m_mesh_checker;
3373isPrimaryMesh()
const
3395 return m_node_family->nbItem();
3400 return m_edge_family->nbItem();
3405 return m_face_family->nbItem();
3410 return m_cell_family->nbItem();
3416 return m_node_family;
3422 return m_edge_family;
3428 return m_face_family;
3434 return m_cell_family;
3437DynamicMeshKindInfos::ItemInternalMap& DynamicMesh::
3440 return m_node_family->itemsMap();
3443DynamicMeshKindInfos::ItemInternalMap& DynamicMesh::
3446 return m_edge_family->itemsMap();
3449DynamicMeshKindInfos::ItemInternalMap& DynamicMesh::
3452 return m_face_family->itemsMap();
3455DynamicMeshKindInfos::ItemInternalMap& DynamicMesh::
3458 return m_cell_family->itemsMap();
3470 true_meshes.
add(true_mesh);
3473 merger.mergeMeshes(true_meshes);
3480_printConnectivityPolicy()
3482 info() <<
"Connectivity policy=" << (int)m_connectivity_policy;
3485 ARCANE_FATAL(
"Invalid value '{0}' for InternalConnectivityPolicy. Only '{1}' is allowed",
3495 m_mesh_part_info = mpi;
3505 if (!m_item_family_network)
3508 for (
const auto& con : m_item_family_network->getConnectivities()) {
3509 if (c.hasConnectivity(c.kindsToConnectivity(con->sourceFamily()->itemKind(),con->targetFamily()->itemKind()))){
3510 m_item_family_network->setIsStored(con);
3521 return m_internal_api.get();
3528_modifierInternalApi()
3530 return m_internal_api.get();
3537computeSynchronizeInfos()
3539 _computeSynchronizeInfos();
3545class ARCANE_MESH_EXPORT DynamicMeshFactoryBase
3568 if (is_submesh && m_is_amr)
3581class ARCANE_MESH_EXPORT DynamicMeshFactory
3582:
public DynamicMeshFactoryBase
3586 : DynamicMeshFactoryBase(sbi,
false) {}
3592class ARCANE_MESH_EXPORT DynamicAMRMeshFactory
3593:
public DynamicMeshFactoryBase
3597 : 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.
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.
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)
Informations pour synchroniser les groupes entre sous-domaines.
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.
VariableScalarString m_parent_group_name
Nom du groupe parent.
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é.
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.
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.
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).
Fonctions utilitaires sur un maillage.
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 d'un maillage de manière incrémentale.
Informations pour un échange de maillage entre sous-domaines.
Implémentation d'un maillage.
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()
Recharge le maillage à partir des variables protégés.
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
Liste des interfaces familles d'entités.
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()
Sauve les propriétés avant une protection.
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()
Relit les propriétés depuis une protection.
void checkValidMesh() override
Vérification de la validité des structues internes de maillage (interne)
void _prepareForDump()
Prépare les variables pour une protection.
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.
void addFaces(Integer nb_face, Int64ConstArrayView face_infos, Int32ArrayView faces) override
Ajoute des faces.
Interface du gestionnaire des connectivités incrémentales indexées sur les entités.
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é.
Gestionnaire de numérotation des uniqueId() d'un maillage.
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.