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 <<
"'\nNo variable with that name exists";
713 String grp_name = i.attrValue(
"groupe");
717 error() <<
"Failed to initialize the variable `" << var_name
718 <<
"' on the group `" << grp_name <<
"'\n"
719 <<
"No group with that name exists";
723 debug() <<
"Read value variable `" << grp_name
724 <<
"' `" << var_name <<
"' " << var;
725 String val_str = i.attrValue(
"valeur");
728 error() <<
"Failed to initialized the variable `" << var_name
729 <<
"' on the group `" << grp_name <<
"'";
735 fatal() <<
"Variable initialization failed";
753 m_mesh_builder->resetAfterDeallocate();
755 m_is_allocated =
false;
765 ARCANE_FATAL_IF(m_is_allocated,
"mesh has already been allocated (via endAllocate() or allocateCells())");
766 if (mesh_nb_cell==0 && !cells_infos.
empty())
767 ARCANE_FATAL(
"Can not dynamically compute the number of cells");
771 setEstimatedCells(mesh_nb_cell);
776 _allocateCells(mesh_nb_cell,cells_infos);
780 info() <<
"Time to build the mesh structures (indirect method) (unit: second): "
790 ARCANE_FATAL_IF(m_is_allocated,
"mesh has already been allocated (via endAllocate() or allocateCells())");
795 _checkConnectivity();
797 bool print_stats =
true;
801 info() <<
"Begin compute face unique ids";
804 m_mesh_builder->computeFacesUniqueIds();
806 info() <<
"Begin compute ghost layer";
809 m_mesh_builder->addGhostLayers(
true);
811 info() <<
"Begin compact items";
814 _allocateCells2(m_mesh_builder);
816 if (m_properties->getBool(PROPERTY_COMPACT_AFTER_ALLOCATE))
817 _compactItems(
true,
false);
819 _compactItemInternalReferences();
821 family->_internalApi()->endAllocate();
826#ifdef ARCANE_DEBUG_DYNAMIC_MESH
828 String file_name(
"mesh-end-allocate");
831 file_name += m_mesh_rank;
838 m_mesh_checker->checkMeshFromReferenceFile();
847 info() <<
"** Set owners from cells";
848 _setOwnersFromCells();
854 _notifyEndUpdateForFamilies();
858 m_is_allocated =
true;
873_allocateCells(
Integer mesh_nb_cell,
876 bool allow_build_face)
880 _checkConnectivity();
881 Int32 rank = meshRank();
882 if (m_use_mesh_item_family_dependencies)
883 m_mesh_builder->addCells3(mesh_nb_cell,cells_infos,rank,cells,allow_build_face);
885 m_mesh_builder->addCells(mesh_nb_cell,cells_infos,rank,cells,allow_build_face);
896 const bool allow_build_face = (m_parallel_mng->commSize() == 1);
897 _allocateCells(nb_cell,cells_infos,cells,allow_build_face);
906 bool allow_build_face = args.isAllowBuildFaces();
910 if (m_parallel_mng->commSize() > 1)
911 allow_build_face =
false;
912 _allocateCells(args.nbCell(),args.cellInfos(),args.cellLocalIds(),allow_build_face);
930 _addCells(buffer,&cells_local_id);
941 _checkConnectivity();
942 if (!itemFamilyNetwork() ||
943 !(itemFamilyNetwork() && itemFamilyNetwork()->isActivated()) ||
944 !IItemFamilyNetwork::plug_serializer) {
947 cell_serializer->deserializeItems(buffer,cells_local_id);
950 _deserializeItems(buffer, cells_local_id, m_cell_family);
958allocate(UnstructuredMeshAllocateBuildInfo& build_info)
960 auto* x = build_info._internal();
961 setDimension(x->meshDimension());
962 allocateCells(x->nbCell(),x->cellsInfos(),
true);
969allocate(CartesianMeshAllocateBuildInfo& build_info)
973 allocateCartesianMesh(
this,build_info);
984 _checkConnectivity();
987 !IItemFamilyNetwork::plug_serializer) {
989 buffer->
setMode(ISerializer::ModeReserve);
990 cell_serializer->serializeItems(buffer,cells_local_id);
993 cell_serializer->serializeItems(buffer,cells_local_id);
996 _serializeItems(buffer, cells_local_id, m_cell_family);
1009 using FamilyLidMap = std::map<String, Int32UniqueArray>;
1010 FamilyLidMap serialized_items;
1011 serialized_items[item_family->
name()] = item_local_ids;
1012 for (
const auto& connectivity :
mesh()->itemFamilyNetwork()->getChildDependencies(item_family)){
1015 auto& connected_family_serialized_items = serialized_items[connectivity->targetFamily()->name()];
1016 connected_family_serialized_items.addRange(connectivity_accessor.connectedItems(
ItemLocalId(item)).localIds());
1020 buffer->
setMode(ISerializer::ModeReserve);
1021 _fillSerializer(buffer, serialized_items);
1023 buffer->
setMode(ISerializer::ModePut);
1024 _fillSerializer(buffer, serialized_items);
1032_deserializeItems(ISerializer* buffer,Int32Array* item_local_ids, IItemFamily* item_family)
1034 ARCANE_UNUSED(item_family);
1035 buffer->setMode(ISerializer::ModeGet);
1036 mesh()->itemFamilyNetwork()->schedule([item_local_ids,buffer](IItemFamily* family) {
1037 auto family_serializer = std::unique_ptr<IItemFamilySerializer>{family->policyMng()->createSerializer()};
1038 family_serializer->deserializeItems(buffer,item_local_ids);
1040 IItemFamilyNetwork::InverseTopologicalOrder);
1041 mesh()->itemFamilyNetwork()->schedule([item_local_ids,buffer](IItemFamily* family) {
1042 auto family_serializer = std::unique_ptr<IItemFamilySerializer>{family->policyMng()->createSerializer()};
1043 family_serializer->deserializeItemRelations(buffer,item_local_ids);
1045 IItemFamilyNetwork::InverseTopologicalOrder);
1052_fillSerializer(ISerializer* buffer, std::map<String, Int32UniqueArray>& serialized_items)
1054 mesh()->itemFamilyNetwork()->schedule([& serialized_items,buffer](IItemFamily* family) {
1055 auto family_serializer = std::unique_ptr<IItemFamilySerializer>{family->policyMng()->createSerializer()};
1056 auto& serialized_items_local_ids = serialized_items[family->name()];
1057 family_serializer->serializeItems(buffer,serialized_items_local_ids);
1059 IItemFamilyNetwork::InverseTopologicalOrder);
1060 mesh()->itemFamilyNetwork()->schedule([& serialized_items,buffer](IItemFamily* family) {
1061 auto family_serializer = std::unique_ptr<IItemFamilySerializer>{family->policyMng()->createSerializer()};
1062 auto& serialized_items_local_ids = serialized_items[family->name()];
1063 family_serializer->serializeItemRelations(buffer,serialized_items_local_ids);
1065 IItemFamilyNetwork::InverseTopologicalOrder);
1072addParentCells(ItemVectorView & items)
1074 Trace::Setter mci(traceMng(),_className());
1076 _checkConnectivity();
1077 m_mesh_builder->addParentCells(items);
1088 _checkConnectivity();
1089 bool allow_build_face =
false ;
1090 m_mesh_builder->addHChildrenCells(parent_cell,nb_cell,cells_infos,meshRank(),cells,allow_build_face);
1097addParentCellToCell(
Cell child,
Cell parent)
1101 _checkConnectivity();
1103 m_cell_family->_addParentCellToCell(child,parent);
1110addChildCellToCell(
Cell parent,
Cell child)
1114 _checkConnectivity();
1116 m_cell_family->_addChildCellToCell2(parent, child);
1123addParentFaceToFace(Face child, Face parent)
1125 Trace::Setter mci(traceMng(), _className());
1127 _checkConnectivity();
1129 m_face_family->_addParentFaceToFace(parent, child);
1136addChildFaceToFace(Face parent, Face child)
1138 Trace::Setter mci(traceMng(), _className());
1140 _checkConnectivity();
1142 m_face_family->_addChildFaceToFace(parent, child);
1149addParentNodeToNode(Node child, Node parent)
1151 Trace::Setter mci(traceMng(), _className());
1153 _checkConnectivity();
1155 m_node_family->_addParentNodeToNode(parent, child);
1162addChildNodeToNode(Node parent, Node child)
1164 Trace::Setter mci(traceMng(), _className());
1166 _checkConnectivity();
1168 m_node_family->_addChildNodeToNode(parent, child);
1178 _checkConnectivity();
1179 Int32 rank = meshRank();
1180 if (m_use_mesh_item_family_dependencies)
1181 m_mesh_builder->addFaces3(nb_face,face_infos,rank,faces);
1183 m_mesh_builder->addFaces(nb_face,face_infos,rank,faces);
1192 addFaces(args.nbFace(),args.faceInfos(),args.faceLocalIds());
1202 _checkConnectivity();
1203 Int32 rank = meshRank();
1204 if (m_use_mesh_item_family_dependencies)
1205 m_mesh_builder->addEdges3(nb_edge,edge_infos,rank,edges);
1207 m_mesh_builder->addEdges(nb_edge,edge_infos,rank,edges);
1217 _checkConnectivity();
1218 Int32 rank = meshRank();
1219 if (m_use_mesh_item_family_dependencies)
1220 m_mesh_builder->addNodes2(nodes_uid,rank,nodes);
1222 m_mesh_builder->addNodes(nodes_uid,rank,nodes);
1231 ARCANE_UNUSED(update_graph);
1233 if (m_use_mesh_item_family_dependencies)
1234 removeItems(m_cell_family,cells_local_id);
1236 m_cell_family->internalRemoveItems(cells_local_id);
1238 if(m_item_family_network)
1240 m_item_family_network->removeConnectedDoFsFromCells(cells_local_id) ;
1248removeItems(IItemFamily* item_family, Int32ConstArrayView cells_local_id)
1250 ARCANE_UNUSED(item_family);
1251 ARCANE_ASSERT((itemFamilyNetwork()),(
"Cannot call DynamicMesh::removeItems if no ItemFamilyNetwork available"))
1253 if (cells_local_id.empty())
1257 ItemDataList item_data_list;
1258 ItemData& cell_data = item_data_list.itemData(Integer(m_cell_family->itemKind()),
1259 cells_local_id.size(),cells_local_id.size(),Int32ArrayView(),
1260 m_cell_family,(IItemFamilyModifier*)(m_cell_family),m_parallel_mng->commRank());
1262 for (auto local_id : cells_local_id) {
1264 cell_data.itemInfos()[i++] = (Int64)local_id;
1266 itemFamilyNetwork()->schedule([&item_data_list](IItemFamily* family){
1268 family->removeItems2(item_data_list);
1270 IItemFamilyNetwork::TopologicalOrder);
1280 if (m_use_mesh_item_family_dependencies)
1281 m_cell_family->detachCells2(cells_local_id);
1284 for(
Integer i=0, is=cells_local_id.
size(); i<is; ++i )
1285 m_cell_family->detachCell(cells[cells_local_id[i]]);
1296 if (m_use_mesh_item_family_dependencies)
1297 removeItems(m_cell_family,cells_local_id);
1300 for(
Integer i=0, is=cells_local_id.
size(); i<is; ++i )
1301 m_cell_family->removeDetachedCell(cells[cells_local_id[i]]);
1325 m_mesh_refinement->flagCellToCoarsen(lids);
1336 _checkConnectivity();
1338 m_mesh_refinement->refineItems(
true);
1346 Trace::Setter mci(traceMng(),_className());
1348 _checkConnectivity();
1350 m_mesh_refinement->coarsenItems(
true);
1357coarsenItemsV2(
bool update_parent_flag)
1359 Trace::Setter mci(traceMng(), _className());
1361 _checkConnectivity();
1363 if (m_amr_type != eMeshAMRKind::Cell) {
1364 ARCANE_FATAL(
"This method is not compatible with Cartesian Mesh Patch AMR");
1366 m_mesh_refinement->coarsenItemsV2(update_parent_flag);
1375 Trace::Setter mci(traceMng(),_className());
1377 _checkConnectivity();
1379 if(m_mesh_refinement->needUpdate())
1380 m_mesh_refinement->update() ;
1381 return m_mesh_refinement->refineAndCoarsenItems(
true);
1390 _compactItems(
false,
true);
1397registerCallBack(IAMRTransportFunctor* f)
1399 Trace::Setter mci(traceMng(),_className());
1401 m_mesh_refinement->registerCallBack(f);
1407unRegisterCallBack(IAMRTransportFunctor* f)
1409 Trace::Setter mci(traceMng(),_className());
1411 m_mesh_refinement->unRegisterCallBack(f);
1418_allocateCells2(DynamicMeshIncrementalBuilder* mib)
1420 Trace::Setter mci(traceMng(),_className());
1422 _finalizeMeshChanged();
1426#ifdef ARCANE_DEBUG_DYNAMIC_MESH
1427 OCStringStream ostr;
1429 info() << ostr.str();
1437_writeMesh(
const String& base_name)
1439 StringBuilder file_name(base_name);
1441 IParallelMng* pm = m_parallel_mng;
1442 bool is_parallel = pm->isParallel();
1443 Int32 rank = meshRank();
1445 file_name += subDomain()->commonVariables().globalIteration();
1449 mesh_utils::writeMeshConnectivity(
this,file_name.toString());
1451 auto writer(ServiceBuilder<IMeshWriter>::createReference(subDomain(),
"Lima"));
1453 String mesh_file_name = file_name.toString() +
".mli";
1454 writer->writeMeshToFile(
this,mesh_file_name);
1462_printMesh(std::ostream& ostr)
1464 ostr <<
"----------- Mesh\n";
1465 ostr <<
" Nodes: " << nbNode() <<
'\n';
1466 ostr <<
" Edges: " << nbEdge() <<
'\n';
1467 ostr <<
" Faces: " << nbFace() <<
'\n';
1468 ostr <<
" Cells: " << nbCell() <<
'\n';
1469 mesh_utils::printItems(ostr,
"Nodes",allNodes());
1470 mesh_utils::printItems(ostr,
"Edges",allEdges());
1471 mesh_utils::printItems(ostr,
"Faces",allFaces());
1472 mesh_utils::printItems(ostr,
"Cells",allCells());
1483 info(4) <<
"DynamicMesh::_saveProperties() name=" <<
name()
1486 auto p = m_properties;
1487 p->setInt32(
"nb-ghostlayer",
ghostLayerMng()->nbGhostLayer());
1488 p->setInt32(
"ghostlayer-builder-version",
ghostLayerMng()->builderVersion());
1489 p->setInt32(
"part-info-part-rank",m_mesh_part_info.partRank());
1490 p->setInt32(
"part-info-nb-part",m_mesh_part_info.nbPart());
1491 p->setInt32(
"part-info-replication-rank",m_mesh_part_info.replicationRank());
1492 p->setInt32(
"part-info-nb-replication",m_mesh_part_info.nbReplication());
1493 p->setBool(
"has-itemsharedinfo-variables",
true);
1494 p->setInt64(
"mesh-timestamp",m_timestamp);
1495 if (!m_do_not_save_need_compact)
1496 p->setBool(
"need-compact",m_need_compact);
1507 auto p = m_properties;
1509 info(4) <<
"DynamicMesh::_readProperties() name=" <<
name()
1510 <<
" mesh-version=" << p->getInt32WithDefault(PROPERTY_MESH_VERSION,-1);
1515 if (p->get(
"nb-ghostlayer",x))
1517 if (p->get(
"ghostlayer-builder-version",x))
1519 if (p->get(
"part-info-part-rank",x))
1520 m_mesh_part_info.setPartRank(x);
1521 if (p->get(
"part-info-nb-part",x))
1522 m_mesh_part_info.setNbPart(x);
1523 if (p->get(
"part-info-replication-rank",x))
1524 m_mesh_part_info.setReplicationRank(x);
1525 if (p->get(
"part-info-nb-replication",x))
1526 m_mesh_part_info.setNbReplication(x);
1527 if (!m_do_not_save_need_compact){
1529 if (p->get(
"need-compact",xb))
1530 m_need_compact = xb;
1533 if (p->get(
"mesh-timestamp",x2))
1546 bool want_dump = m_properties->getBool(PROPERTY_DUMP);
1547 info(4) <<
"DynamicMesh::prepareForDump() name=" <<
name()
1548 <<
" need_compact?=" << m_need_compact
1549 <<
" want_dump?=" << want_dump
1550 <<
" timestamp=" << m_timestamp;
1554 m_mesh_events.eventObservable(t).notify(
MeshEventArgs(
this,t));
1569 m_mesh_events.eventObservable(t).notify(
MeshEventArgs(
this,t));
1579_prepareForDumpReal()
1581 if (m_need_compact){
1584 _compactItems(
true,
true);
1589 if (m_parent_mesh) {
1590 ARCANE_ASSERT((m_parent_group != NULL),(
"Unexpected NULL parent group"));
1594 ARCANE_ASSERT((m_parent_group == NULL),(
"Unexpected non-NULL parent group"));
1598 const Integer n_sub_mesh = m_child_meshes.size();
1600 for(
Integer i=0;i<n_sub_mesh; ++i)
1618 family->prepareForDump();
1621 if (m_tied_interface_need_prepare_dump){
1622 m_tied_interface_mng->prepareTiedInterfacesForDump();
1623 m_tied_interface_need_prepare_dump =
false;
1635 ARCANE_FATAL(
"Attempting to create a family that already exists '{0}'",
name);
1637 debug() <<
"Creating the entities family "
1643 _buildAndInitFamily(family);
1668 ARCANE_FATAL(
"Attempting to create an ItemFamily with an unknown item kind.");
1676IItemFamilyPolicyMng* DynamicMesh::
1677_createFamilyPolicyMng(ItemFamily* family)
1679 eItemKind kind = family->itemKind();
1682 return createNodeFamilyPolicyMng(family);
1684 return createEdgeFamilyPolicyMng(family);
1686 return createFaceFamilyPolicyMng(family);
1688 return createCellFamilyPolicyMng(family);
1690 return createParticleFamilyPolicyMng(family);
1692 return createDoFFamilyPolicyMng(family);
1694 ARCANE_FATAL(
"Attempting to create an ItemFamily with an unknown item kind.");
1703_buildAndInitFamily(IItemFamily* family)
1707 IItemFamilyPolicyMng* policy_mng = _createFamilyPolicyMng(true_family);
1708 true_family->setPolicyMng(policy_mng);
1715_addFamily(ItemFamily* family)
1717 m_item_families.add(family);
1718 m_true_item_families.add(family);
1726 bool register_modifier_if_created)
1729 if (family->name()==
name && family->itemKind()==ik)
1731 if (create_if_needed){
1733 if(register_modifier_if_created){
1747findItemFamily(
const String&
name,
bool throw_exception)
1750 if (family->name()==
name)
1752 if (throw_exception)
1776_exchangeItems(
bool do_compact)
1785 if (!nb_exchange_str.
null()){
1786 bool is_bad = builtInGetValue(nb_exchange,nb_exchange_str);
1792 if (!exchange_version_str.
null()){
1793 builtInGetValue(exchange_version,exchange_version_str);
1796 info() <<
"DynamicMesh::_echangeItems() do_compact?=" << do_compact
1797 <<
" nb_exchange=" << nb_exchange <<
" version=" << exchange_version;
1800 _multipleExchangeItems(nb_exchange,exchange_version,do_compact);
1803 _exchangeItemsNew();
1808 if (ghostLayerMng()->nbGhostLayer()>1 && !m_use_mesh_item_family_dependencies)
1809 updateGhostLayers(
true);
1810 String check_exchange = platform::getEnvironmentVariable(
"ARCANE_CHECK_EXCHANGE");
1811 if (!check_exchange.null()){
1812 m_mesh_checker->checkGhostCells();
1813 pwarning() <<
"CHECKING SYNCHRONISATION !";
1814 m_mesh_checker->checkVariablesSynchronization();
1815 m_mesh_checker->checkItemGroupsSynchronization();
1817 if (checkLevel()>=2)
1818 m_mesh_checker->checkValidMesh();
1819 else if (checkLevel()>=1)
1820 m_mesh_checker->checkValidConnectivity();
1856_multipleExchangeItems(
Integer nb_exchange,
Integer version,
bool do_compact)
1858 if (version<1 || version>2)
1859 ARCANE_FATAL(
"Invalid value '{0}' for version. Valid values are 1 or 2",version);
1861 info() <<
"** ** MULTIPLE EXCHANGE ITEM version=" << version <<
" nb_exchange=" << nb_exchange;
1873 Int32 new_owner = cells_new_owner[icell];
1874 if (current_owner==new_owner)
1878 phase = (new_owner % nb_exchange);
1879 else if (version==1)
1880 phase = icell.index() / nb_cell;
1881 cells_to_exchange_new_owner[phase].
add(new_owner);
1882 cells_to_exchange_uid[phase].
add(cell.
uniqueId().asInt64());
1889 cells_new_owner[icell] = cell.
owner();
1895 for(
Integer i=0; i<nb_exchange; ++i ){
1899 info() <<
"MultipleExchange current_exchange=" << i <<
" nb_cell=" << nb_cell;
1900 uids_to_lids.
resize(nb_cell);
1905 for(
Integer z=0; z<nb_cell; ++z )
1906 cells_new_owner[cells[uids_to_lids[z]]] = new_owners[z];
1907 cells_new_owner.synchronize();
1908 mesh()->utilities()->changeOwnersFromCells();
1909 _exchangeItemsNew();
1914 bool do_sort = m_properties->getBool(PROPERTY_SORT);
1915 _compactItems(do_sort,
true);
1925 _exchangeItems(m_properties->getBool(PROPERTY_COMPACT));
1935 family->clearItems();
1942class ItemsExchangeInfo2List
1946 ~ItemsExchangeInfo2List()
1968 Trace::Setter mci(traceMng(),_className());
1973 m_need_compact =
true;
1975 if (arcane_debug_load_balancing){
1978 m_node_family->itemsNewOwner().checkIfSync(10);
1979 m_edge_family->itemsNewOwner().checkIfSync(10);
1980 m_face_family->itemsNewOwner().checkIfSync(10);
1981 m_cell_family->itemsNewOwner().checkIfSync(10);
1986 typedef Collection<DynamicMesh*> DynamicMeshCollection;
1987 DynamicMeshCollection all_cascade_meshes = List<DynamicMesh*>();
1988 all_cascade_meshes.add(
this);
1989 for(Integer i=0;i<m_child_meshes.size();++i)
1990 all_cascade_meshes.add(m_child_meshes[i]);
1992 IMeshExchanger* iexchanger = m_mesh_exchange_mng->beginExchange();
1993 MeshExchanger* mesh_exchanger =
ARCANE_CHECK_POINTER(
dynamic_cast<MeshExchanger*
>(iexchanger));
1996 if (mesh_exchanger->computeExchangeInfos()){
1997 info() <<
"No load balance is performed";
1998 m_mesh_exchange_mng->endExchange();
2003 mesh_exchanger->processExchange();
2006 mesh_exchanger->removeNeededItems();
2012 auto action = [](ItemGroup& group)
2017 if (group.internal()->hasComputeFunctor() || group.isLocalToSubDomain())
2020 group.internal()->removeSuppressedItems();
2022 for( DynamicMesh* mesh : all_cascade_meshes ){
2023 meshvisitor::visitGroups(mesh,action);
2035 for( DynamicMesh* child_mesh : m_child_meshes )
2036 child_mesh->m_submesh_tools->removeDeadGhostCells();
2038 for(Integer i_child_mesh=0;i_child_mesh<m_child_meshes.size();++i_child_mesh)
2039 m_child_meshes[i_child_mesh]->m_submesh_tools->removeDeadGhostCells();
2043 mesh_exchanger->allocateReceivedItems();
2047 for( DynamicMesh* mesh : all_cascade_meshes )
2048 mesh->_internalEndUpdateInit(
true);
2050 mesh_exchanger->updateItemGroups();
2053 for( DynamicMesh* mesh : all_cascade_meshes )
2054 mesh->_computeGroupSynchronizeInfos();
2057 mesh_exchanger->updateVariables();
2060 for( DynamicMesh* mesh : all_cascade_meshes ){
2062 bool print_info = (mesh==
this);
2063 mesh->_internalEndUpdateFinal(print_info);
2069 mesh_exchanger->finalizeExchange();
2072 m_mesh_exchange_mng->endExchange();
2080 if (m_extra_ghost_cells_builder->hasBuilder() || m_extra_ghost_particles_builder->hasBuilder())
2081 this->endUpdate(
true,
false);
2092 m_extra_ghost_cells_builder->addExtraGhostCellsBuilder(builder);
2101 m_extra_ghost_cells_builder->removeExtraGhostCellsBuilder(builder);
2110 m_extra_ghost_particles_builder->addExtraGhostParticlesBuilder(builder);
2119 m_extra_ghost_particles_builder->removeExtraGhostParticlesBuilder(builder);
2126_computeExtraGhostCells()
2128 m_extra_ghost_cells_builder->computeExtraGhostCells();
2135_computeExtraGhostParticles()
2137 m_extra_ghost_particles_builder->computeExtraGhostParticles();
2146 const Int32 sid = meshRank();
2151 UniqueArray<Int32> cells_to_remove;
2152 cells_to_remove.reserve(1000);
2154 ItemInternalMap& cells_map = m_cell_family->itemsMap();
2155 cells_map.eachItem([&](Item cell) {
2156 if (cell.owner() != sid)
2157 cells_to_remove.add(cell.localId());
2160 info() <<
"Number of cells to remove: " << cells_to_remove.size();
2161 m_cell_family->removeCells(cells_to_remove);
2164 _updateGroupsAfterRemove();
2173_updateGroupsAfterRemove()
2175 auto action = [&](
const ItemGroup& group){ group.itemFamily()->partialEndUpdateGroup(group); };
2176 meshvisitor::visitGroups(
this,action);
2192updateGhostLayers(
bool remove_old_ghost)
2201 _internalUpdateGhost(
true, remove_old_ghost);
2202 _internalEndUpdateInit(
true);
2203 _synchronizeGroups();
2204 _computeGroupSynchronizeInfos();
2205 _internalEndUpdateResizeVariables();
2206 _synchronizeVariables();
2207 _internalEndUpdateFinal(
true);
2210 for(
Integer i=0;i<m_child_meshes.size();++i) {
2211 m_child_meshes[i]->endUpdate(
true, remove_old_ghost);
2218_removeGhostChildItems()
2220 const Int32 sid = meshRank();
2223 UniqueArray<Int32> cells_to_remove;
2224 cells_to_remove.reserve(1000);
2226 ItemInternalMap& cells_map = m_cell_family->itemsMap();
2227 Integer max_level=0;
2228 cells_map.eachItem([&](impl::ItemBase cell) {
2229 if ((cell.owner() != sid) && (cell.level() != 0))
2230 max_level = math::max(cell.level(),max_level);
2236 cells_map.eachItem([&](impl::ItemBase cell) {
2237 if ((cell.owner() != sid) && (cell.level() == max_level)) {
2238 cells_to_remove.add(cell.localId());
2242 info() <<
"Number of cells to remove: " << cells_to_remove.size();
2243 m_cell_family->removeCells(cells_to_remove);
2246 _updateGroupsAfterRemove();
2253_removeGhostChildItems2(Array<Int64>& cells_to_coarsen)
2255 const Int32 sid = meshRank();
2257 cells_to_coarsen.reserve(1000);
2260 UniqueArray<Cell> cells_to_remove;
2261 cells_to_remove.reserve(1000);
2263 ItemInternalMap& cells_map = m_cell_family->itemsMap();
2265 cells_map.eachItem([&](Cell cell) {
2266 if (cell.owner() != sid)
2268 if (cell.hasFlags(ItemFlags::II_JustCoarsened)) {
2269 cells_to_coarsen.add(cell.uniqueId());
2270 for (Integer c = 0, cs = cell.nbHChildren(); c < cs; c++) {
2271 cells_to_remove.add(cell.hChild(c));
2281 for( Integer i=0, is=cells_to_remove.size(); i<is; ++i )
2282 m_cell_family->removeCell(cells_to_remove[i]);
2285 _updateGroupsAfterRemove();
2292updateGhostLayerFromParent(
Array<Int64>& ghost_cell_to_refine_uid,
2293 Array<Int64>& ghost_cell_to_coarsen_uid,
bool remove_old_ghost)
2296 CHECKPERF( m_perf_counter.start(PerfCounter::UPGHOSTLAYER1) ) ;
2298 m_need_compact =
true;
2303 if(remove_old_ghost){
2304 _removeGhostChildItems2(ghost_cell_to_coarsen_uid) ;
2308 m_face_family->setCheckOrientation(
false);
2310 m_mesh_builder->addGhostChildFromParent(ghost_cell_to_refine_uid);
2311 m_face_family->setCheckOrientation(
true);
2315 m_mesh_builder->printStats();
2316 CHECKPERF( m_perf_counter.stop(PerfCounter::UPGHOSTLAYER1) )
2319 CHECKPERF( m_perf_counter.start(PerfCounter::UPGHOSTLAYER2) )
2324 family->endUpdate();
2326 CHECKPERF( m_perf_counter.stop(PerfCounter::UPGHOSTLAYER2) )
2331 CHECKPERF( m_perf_counter.start(PerfCounter::UPGHOSTLAYER3) )
2337 CHECKPERF( m_perf_counter.stop(PerfCounter::UPGHOSTLAYER3) )
2343 CHECKPERF( m_perf_counter.start(PerfCounter::UPGHOSTLAYER4) )
2345 _synchronizeGroupsAndVariables();
2346 CHECKPERF( m_perf_counter.stop(PerfCounter::UPGHOSTLAYER4) )
2350 CHECKPERF( m_perf_counter.start(PerfCounter::UPGHOSTLAYER5) )
2352 m_cell_family->itemsUniqueIdToLocalId(ghost_cell_to_refine_lid,ghost_cell_to_refine_uid,
true) ;
2354 for (
Integer e = 0, i_size=ghost_cell_to_refine_lid.
size(); e != i_size; ++e){
2355 Cell i_hParent_cell(cells[ghost_cell_to_refine_lid[e]]);
2361 for(
Integer iface=0;iface<nb_face;++iface){
2362 Face face = i_hParent_cell.
face(iface);
2364 for(
Integer icell=0;icell<nb_cell;++icell){
2368 m_face_family->familyTree(childs,cell,
false) ;
2369 for(
Integer i=0,nchilds=childs.
size();i<nchilds;++i){
2378 CHECKPERF( m_perf_counter.stop(PerfCounter::UPGHOSTLAYER5) )
2382 CHECKPERF( m_perf_counter.start(PerfCounter::UPGHOSTLAYER6) )
2383 m_mesh_checker->checkMeshFromReferenceFile();
2390 bool do_compact = m_properties->getBool(PROPERTY_COMPACT);
2392 bool do_sort = m_properties->getBool(PROPERTY_SORT);
2393 _compactItems(do_sort,do_compact);
2395 CHECKPERF( m_perf_counter.stop(PerfCounter::UPGHOSTLAYER6) )
2397 if (arcane_debug_load_balancing){
2398 _writeMesh(
"update-ghost-layer-after");
2405 pinfo() <<
"Proc: " << meshRank()
2406 <<
" cellown=" << m_cell_family->allItems().own().size()
2407 <<
" cellloc=" << m_cell_family->allItems().size();
2411 CHECKPERF( m_perf_counter.start(PerfCounter::UPGHOSTLAYER7) )
2413 m_mesh_checker->updateAMRFaceOrientation(ghost_cell_to_refine_uid);
2415 if (m_mesh_checker->checkLevel()>=1)
2416 m_mesh_checker->checkValidConnectivity();
2417 CHECKPERF( m_perf_counter.stop(PerfCounter::UPGHOSTLAYER7) )
2419#ifdef ACTIVATE_PERF_COUNTER
2420 m_perf_counter.printInfo(
info().file()) ;
2428_internalUpdateGhost(
bool update_ghost_layer,
bool remove_old_ghost)
2430 m_need_compact =
true;
2434 if (update_ghost_layer)
2435 m_submesh_tools->updateGhostMesh();
2438 if (update_ghost_layer){
2439 if(remove_old_ghost){
2440 _removeGhostItems();
2443 m_face_family->setCheckOrientation(
false);
2444 m_mesh_builder->addGhostLayers(
false);
2445 m_face_family->setCheckOrientation(
true);
2446 _computeExtraGhostCells();
2447 _computeExtraGhostParticles();
2456_internalEndUpdateInit(
bool update_ghost_layer)
2463 _finalizeMeshChanged();
2467 if (update_ghost_layer){
2468 info() <<
"ComputeSyncInfos date=" << platform::getCurrentDateTime();
2469 _computeFamilySynchronizeInfos();
2477_internalEndUpdateResizeVariables()
2480 for( IItemFamily* family : m_item_families )
2481 family->_internalApi()->resizeVariables(
true);
2489_internalEndUpdateFinal(
bool print_stat)
2492 m_mesh_checker->checkMeshFromReferenceFile();
2500 _compactItemInternalReferences();
2503 bool do_compact = m_properties->getBool(PROPERTY_COMPACT);
2504 info(4) <<
"DynamicMesh::_internalEndUpdateFinal() compact?=" << do_compact <<
" sort?=" << m_properties->getBool(PROPERTY_SORT);
2506 bool do_sort = m_properties->getBool(PROPERTY_SORT);
2507 _compactItems(do_sort,do_compact);
2512 _notifyEndUpdateForFamilies();
2516 if (m_properties->getBool(PROPERTY_DISPLAY_STATS)){
2524 m_mesh_checker->updateAMRFaceOrientation();
2526 if (m_mesh_checker->checkLevel()>=1)
2527 m_mesh_checker->checkValidConnectivity();
2534_notifyEndUpdateForFamilies()
2537 family->_internalApi()->notifyEndUpdateFromMesh();
2553endUpdate(
bool update_ghost_layer,
bool remove_old_ghost)
2567 _internalUpdateGhost(update_ghost_layer, remove_old_ghost);
2569 _internalEndUpdateInit(update_ghost_layer);
2570 if (update_ghost_layer){
2571 _synchronizeGroups();
2572 _computeGroupSynchronizeInfos();
2574 _internalEndUpdateResizeVariables();
2575 if (update_ghost_layer){
2576 _synchronizeVariables();
2578 _internalEndUpdateFinal(
false);
2581 for( DynamicMesh* child_mesh : m_child_meshes )
2582 child_mesh->endUpdate(update_ghost_layer, remove_old_ghost);
2589synchronizeGroupsAndVariables()
2591 _synchronizeGroupsAndVariables();
2595 for( DynamicMesh* child_mesh : m_child_meshes )
2596 child_mesh->synchronizeGroupsAndVariables();
2603_synchronizeGroupsAndVariables()
2605 _synchronizeGroups();
2606 _synchronizeVariables();
2620 ItemGroupsSynchronize igs(m_edge_family);
2624 ItemGroupsSynchronize igs(m_face_family);
2628 ItemGroupsSynchronize igs(m_cell_family);
2632 for( IItemFamily* family : m_item_families ){
2633 if (family->itemKind()==IK_Particle){
2634 IParticleFamily* pfamily = family->toParticleFamily();
2635 if (pfamily && pfamily->getEnableGhostItems()){
2636 ItemGroupsSynchronize igs(family);
2648_synchronizeVariables()
2660 typedef UniqueArray<IVariableSynchronizer*> OrderedSyncList;
2661 typedef std::map<IVariableSynchronizer*, VariableCollection> SyncList;
2662 OrderedSyncList ordered_sync_list;
2665 VariableCollection used_vars(subDomain()->variableMng()->usedVariables());
2666 for( VariableCollection::Enumerator i_var(used_vars); ++i_var; ) {
2667 IVariable* var = *i_var;
2668 switch(var->itemKind()) {
2674 IVariableSynchronizer * synchronizer = 0;
2675 if (var->isPartial())
2676 synchronizer = var->itemGroup().synchronizer();
2678 synchronizer = var->itemFamily()->allItemsSynchronizer();
2679 IMesh * sync_mesh = synchronizer->itemGroup().mesh();
2680 if (sync_mesh !=
this)
continue;
2681 std::pair<SyncList::iterator,bool> inserter = sync_list.insert(std::make_pair(synchronizer,VariableCollection()));
2682 if (inserter.second) {
2683 ordered_sync_list.add(synchronizer);
2685 VariableCollection & collection = inserter.first->second;
2686 collection.add(var);
2694 for(Integer i_sync = 0; i_sync < ordered_sync_list.size(); ++i_sync) {
2695 IVariableSynchronizer * synchronizer = ordered_sync_list[i_sync];
2696 VariableCollection & collection = sync_list[synchronizer];
2697 synchronizer->synchronize(collection);
2705_sortInternalReferences()
2708 m_node_family->sortInternalReferences();
2715_finalizeMeshChanged()
2718 for( IItemFamily* family : m_item_families ){
2719 debug() <<
"_finalizeMeshChanged on " << family->name() <<
" Family on Mesh " << name();
2720 family->endUpdate();
2723 bool do_sort = m_properties->getBool(PROPERTY_SORT);
2725 _sortInternalReferences();
2726 m_tied_interface_need_prepare_dump =
true;
2733_applyCompactPolicy(
const String& timer_name,
2734 std::function<
void(IItemFamilyCompactPolicy*)> functor)
2736 Timer::Action ts_action(m_sub_domain,timer_name);
2737 for( IItemFamily* family : m_item_families ){
2738 IItemFamilyCompactPolicy* c = family->policyMng()->compactPolicy();
2748_compactItemInternalReferences()
2750 _applyCompactPolicy(
"CompactConnectivityData",[&](IItemFamilyCompactPolicy* c)
2751 { c->compactConnectivityData(); });
2758_compactItems(
bool do_sort,
bool compact_variables_and_groups)
2761 info(4) <<
"Compress and sort the mesh entities " << name() <<
".";
2763 info(4) <<
"Compress the mesh entities " << name() <<
".";
2765 IMeshCompacter* compacter = m_mesh_compact_mng->beginCompact();
2768 compacter->setSorted(do_sort);
2769 compacter->_setCompactVariablesAndGroups(compact_variables_and_groups);
2771 compacter->doAllActions();
2774 m_mesh_compact_mng->endCompact();
2777 m_mesh_compact_mng->endCompact();
2780 Timer::Action ts_action(m_sub_domain,
"CompactItemSortReferences");
2783 _sortInternalReferences();
2786 m_need_compact =
false;
2797setEstimatedCells(Integer nb_cell0)
2800 if (m_parallel_mng->isParallel())
2803 Integer nb_node = Convert::toInteger(nb_cell0 * 1.2 * factor);
2804 Integer nb_edge = Convert::toInteger(nb_cell0 * 6.8 * factor);
2805 Integer nb_face = Convert::toInteger(nb_cell0 * 3.4 * factor);
2806 Integer nb_cell = Convert::toInteger(nb_cell0 * 1.0 * factor);
2807 info() <<
"Estimating the number of entities:"
2808 <<
" Node=" << nb_node
2809 <<
" Edge=" << nb_edge
2810 <<
" Face=" << nb_face
2811 <<
" Cell=" << nb_cell;
2812 m_node_family->preAllocate(nb_node);
2813 m_edge_family->preAllocate(nb_edge);
2814 m_face_family->preAllocate(nb_face);
2815 m_cell_family->preAllocate(nb_cell);
2839 ARCANE_ASSERT((m_parent_mesh != NULL),(
"Unexpected NULL Mesh"));
2843 m_child_meshes.resize(n_sub_mesh);
2844 for(
Integer i=0;i<n_sub_mesh;++i)
2847 DynamicMesh* dynamic_child_mesh =
dynamic_cast<DynamicMesh*
>(child_mesh);
2848 if (dynamic_child_mesh == 0)
2849 ARCANE_FATAL(
"Cannot associate sub mesh from a different concrete type");
2850 m_child_meshes[i] = dynamic_child_mesh;
2856 for(
Integer i=0; i<nb_item_family; ++i ){
2857 info(5) <<
"Found family: I=" << i
2866 for(
Integer i=0; i<nb_item_family; ++i ){
2874 if (!m_is_sub_connectivity_set)
2875 _setSubConnectivity();
2879 family->readFromDump();
2883 _notifyEndUpdateForFamilies();
2886 m_item_internal_list.nodes = m_node_family->itemsInternal();
2887 m_item_internal_list.edges = m_edge_family->itemsInternal();
2888 m_item_internal_list.faces = m_face_family->itemsInternal();
2889 m_item_internal_list.cells = m_cell_family->itemsInternal();
2890 m_item_internal_list.mesh =
this;
2892 m_tied_interface_mng->readTiedInterfacesFromDump();
2894 m_mesh_builder->readFromDump();
2904 return m_tied_interface_mng->hasTiedInterface();
2913 return m_tied_interface_mng->tiedInterfaces();
2922 return m_tied_interface_mng->trueTiedInterfaces();
2929computeTiedInterfaces(
const XmlNode& mesh_node)
2931 m_tied_interface_mng->computeTiedInterfaces(mesh_node);
2941 _checkConnectivity();
2951 ARCANE_FATAL(
"DynamicMesh::setDimension(): mesh is already allocated");
2952 info() <<
"Mesh name=" << name() <<
" set dimension = " << dim;
2953 m_mesh_dimension = dim;
2954 const bool is_non_manifold = meshKind().isNonManifold();
2957 if (is_non_manifold){
2958 info() <<
"Force no-renumbering of edge and face uid because we are using non manifold mesh";
2959 m_mesh_unique_id_mng->setFaceBuilderVersion(0);
2960 m_mesh_unique_id_mng->setEdgeBuilderVersion(0);
2962 bool v = m_mesh_unique_id_mng->isUseNodeUniqueIdToGenerateEdgeAndFaceUniqueId();
2968 if (!v && is_non_manifold) {
2970 info() <<
"Force using edge and face uid generation from nodes because we are using non manifold mesh";
2972 if (m_mesh_builder){
2973 auto* adder = m_mesh_builder->oneMeshItemAdder();
2975 adder->setUseNodeUniqueIdToGenerateEdgeAndFaceUniqueId(v);
2979 if (dim == 3 && is_non_manifold) {
2980 Connectivity c(m_mesh_connectivity);
2981 if (!c.hasConnectivity(Connectivity::CT_HasEdge)) {
2982 c.enableConnectivity(Connectivity::CT_HasEdge);
2983 info() <<
"Force creating edges for 3D non-manifold mesh";
2992_checkDimension()
const
2994 if (m_mesh_dimension()<0)
2995 ARCANE_FATAL(
"dimension not set. setDimension() must be called before allocating cells");
3004 Connectivity c(m_mesh_connectivity);
3005 if (!c.isFrozen()) {
3007 debug() <<
"Mesh " << name() <<
" connectivity : " << Connectivity::Printer(m_mesh_connectivity());
3008 _setSubConnectivity();
3009 _updateItemFamilyDependencies(m_mesh_connectivity);
3019 if (!m_is_amr_activated)
3020 ARCANE_FATAL(
"DynamicMesh::_checkAMR(): amr activator not set.\t"
3021 "amr='true' must be set in the .arc file");
3028_setSubConnectivity()
3030 m_mesh_builder->setConnectivity(m_mesh_connectivity());
3031 m_node_family->setConnectivity(m_mesh_connectivity());
3032 m_edge_family->setConnectivity(m_mesh_connectivity());
3033 m_face_family->setConnectivity(m_mesh_connectivity());
3034 m_cell_family->setConnectivity(m_mesh_connectivity());
3035 m_is_sub_connectivity_set =
true;
3042_writeCells(
const String& filename)
3044 CellGroup cells(m_cell_family->allItems());
3045 std::ofstream ofile(filename.localstr());
3048 ofile <<
"CELL: uid=" << cell.uniqueId() <<
" isown="
3049 << cell.isOwn() <<
" owner=" << cell.owner() <<
'\n';
3059 return m_node_family->nodesCoordinates();
3066sharedNodesCoordinates()
3078_setOwnersFromCells()
3102 const Integer sid = subDomain()->subDomainId();
3105 if(m_new_item_owner_builder == NULL)
3111 Node node = *i_node;
3112 nodes_owner[node] = m_new_item_owner_builder->ownerOfItem(node);
3114 nodes_owner.synchronize();
3118 Node node = *i_node;
3125 Edge edge = *i_edge;
3126 edges_owner[edge] = m_new_item_owner_builder->ownerOfItem(edge);
3128 edges_owner.synchronize();
3132 Edge edge = *i_edge;
3133 edge.mutableItemBase().setOwner(edges_owner[edge],sid);
3139 Face face = *i_face;
3140 faces_owner[face] = m_new_item_owner_builder->ownerOfItem(face);
3142 faces_owner.synchronize();
3146 Face face = *i_face;
3147 face.mutableItemBase().setOwner(faces_owner[face],sid);
3150 nodeFamily()->notifyItemsOwnerChanged();
3151 edgeFamily()->notifyItemsOwnerChanged();
3152 faceFamily()->notifyItemsOwnerChanged();
3153 _computeFamilySynchronizeInfos();
3162 if (!m_mesh_utilities)
3164 return m_mesh_utilities;
3173 return m_cell_family->allItems().outerFaceGroup();
3183 return m_cell_family->allItems().activeCellGroup();
3191 return m_cell_family->allItems().ownActiveCellGroup();
3197allLevelCells(
const Integer& level)
3199 return m_cell_family->allItems().levelCellGroup(level);
3205ownLevelCells(
const Integer& level)
3207 return m_cell_family->allItems().ownLevelCellGroup(level);
3215 return m_cell_family->allItems().activeFaceGroup();
3223 return m_cell_family->allItems().ownActiveFaceGroup();
3234 return m_cell_family->allItems().innerActiveFaceGroup();
3242 return m_cell_family->allItems().outerActiveFaceGroup();
3259 ARCANE_FATAL(
"Cannot set inconsistant mesh/group parents to mesh '{0}'",
name());
3261 if (m_parent_mesh) {
3262 if (m_parent_mesh !=
mesh)
3263 ARCANE_FATAL(
"Mesh '{0}' already has parent mesh '{1}'",
name(),m_parent_mesh->name());
3264 if (m_parent_group != group.
internal())
3265 ARCANE_FATAL(
"Mesh '{0}' already has parent group '{1}'",
name(),m_parent_group->name());
3268 m_parent_mesh =
mesh;
3273 dimension_shift = 1;
3276 dimension_shift = 0;
3279 ARCANE_FATAL(
"Only SubMesh on FaceGroup or CellGoup is allowed");
3282 _setDimension(
mesh->dimension()-dimension_shift);
3285 const eItemKind kind = family->itemKind();
3290 family->setParentFamily(
mesh->itemFamily(parent_kind));
3302partitionConstraintMng()
3304 return m_partition_constraint_mng;
3313 return m_parent_mesh;
3329addChildMesh(
IMesh * sub_mesh)
3331 DynamicMesh * dynamic_child_mesh =
dynamic_cast<DynamicMesh*
>(sub_mesh);
3332 if (!dynamic_child_mesh)
3333 ARCANE_FATAL(
"Cannot associate sub mesh from a different concrete type");
3334 for(
Integer i=0;i<m_child_meshes.size();++i)
3335 if (m_child_meshes[i] == dynamic_child_mesh)
3337 m_child_meshes.add(dynamic_child_mesh);
3347 for(
Integer i=0;i<m_child_meshes.size(); ++i) {
3348 collection.add(m_child_meshes[i]);
3359 return m_mesh_checker;
3366isPrimaryMesh()
const
3388 return m_node_family->nbItem();
3393 return m_edge_family->nbItem();
3398 return m_face_family->nbItem();
3403 return m_cell_family->nbItem();
3409 return m_node_family;
3415 return m_edge_family;
3421 return m_face_family;
3427 return m_cell_family;
3430DynamicMeshKindInfos::ItemInternalMap& DynamicMesh::
3433 return m_node_family->itemsMap();
3436DynamicMeshKindInfos::ItemInternalMap& DynamicMesh::
3439 return m_edge_family->itemsMap();
3442DynamicMeshKindInfos::ItemInternalMap& DynamicMesh::
3445 return m_face_family->itemsMap();
3448DynamicMeshKindInfos::ItemInternalMap& DynamicMesh::
3451 return m_cell_family->itemsMap();
3463 true_meshes.
add(true_mesh);
3466 merger.mergeMeshes(true_meshes);
3473_printConnectivityPolicy()
3475 info() <<
"Connectivity policy=" << (int)m_connectivity_policy;
3478 ARCANE_FATAL(
"Invalid value '{0}' for InternalConnectivityPolicy. Only '{1}' is allowed",
3488 m_mesh_part_info = mpi;
3498 if (!m_item_family_network)
3501 for (
const auto& con : m_item_family_network->getConnectivities()) {
3502 if (c.hasConnectivity(c.kindsToConnectivity(con->sourceFamily()->itemKind(),con->targetFamily()->itemKind()))){
3503 m_item_family_network->setIsStored(con);
3514 return m_internal_api.get();
3521_modifierInternalApi()
3523 return m_internal_api.get();
3530computeSynchronizeInfos()
3532 _computeSynchronizeInfos();
3538class ARCANE_MESH_EXPORT DynamicMeshFactoryBase
3561 if (is_submesh && m_is_amr)
3574class ARCANE_MESH_EXPORT DynamicMeshFactory
3575:
public DynamicMeshFactoryBase
3579 : DynamicMeshFactoryBase(sbi,
false) {}
3585class ARCANE_MESH_EXPORT DynamicAMRMeshFactory
3586:
public DynamicMeshFactoryBase
3590 : 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.
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 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.
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.
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.
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.