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);
451 m_internal_api->build();
460 return m_parallel_mng;
470 ARCANE_FATAL(
"INTERNAL: DynamicMesh: invalid use of a null entity");
489 info() <<
"Reloading the mesh " <<
name();
490 m_is_allocated =
true;
495 m_mesh_checker->checkMeshFromReferenceFile();
497 info() <<
"Time to reallocate the mesh structures (direct method) (unit: second): "
507 m_mesh_checker->setCheckLevel(level);
516 return m_mesh_checker->checkLevel();
527 m_mesh_checker->checkValidMesh();
538 m_mesh_checker->checkValidMeshFull();
545checkValidConnectivity()
547 m_mesh_checker->checkValidConnectivity();
557 family->destroyGroups();
569 group = family->findGroup(
name);
584 return family->
findGroup(name,create_if_needed);
595 ARCANE_CHECK_PTR(family);
602ItemGroup DynamicMesh::
603createGroup(
const String& name,
const ItemGroup& parent)
605 IItemFamily* family = parent.itemFamily();
606 ARCANE_CHECK_PTR(family);
607 return family->createGroup(name,parent);
614_computeSynchronizeInfos()
616 _computeFamilySynchronizeInfos();
617 _computeGroupSynchronizeInfos();
624_computeFamilySynchronizeInfos()
626 info() <<
"Computing family synchronization information for " << name();
627 for( IItemFamily* family : m_item_families ){
628 family->computeSynchronizeInfos();
632 if (!platform::getEnvironmentVariable(
"ARCANE_DUMP_VARIABLE_SYNCHRONIZER_TOPOLOGY").null()){
633 auto* var_syncer = cellFamily()->allItemsSynchronizer();
634 Int32 iteration = subDomain()->commonVariables().globalIteration();
635 String file_name = String::format(
"{0}_sync_topology_iter{1}.json",name(),iteration);
636 mesh_utils::dumpSynchronizerTopologyJSON(var_syncer,file_name);
644_computeGroupSynchronizeInfos()
646 auto action = [](ItemGroup& group)
648 if (group.hasSynchronizer())
649 group.synchronizer()->compute();
652 info() <<
"Computing group synchronization information for " << name();
653 meshvisitor::visitGroups(
this,action);
676initializeVariables(
const XmlNode& init_node)
684 items_owner[iitem] = item.
owner();
693 bool has_error =
false;
696 for(
const auto& i : child_list ){
697 String var_name = i.attrValue(
"nom");
700 error() <<
"Failed to initialize the variable `" << var_name
701 <<
"'\nNo variable with that name exists";
709 String grp_name = i.attrValue(
"groupe");
713 error() <<
"Failed to initialize the variable `" << var_name
714 <<
"' on the group `" << grp_name <<
"'\n"
715 <<
"No group with that name exists";
719 debug() <<
"Read value variable `" << grp_name
720 <<
"' `" << var_name <<
"' " << var;
721 String val_str = i.attrValue(
"valeur");
724 error() <<
"Failed to initialized the variable `" << var_name
725 <<
"' on the group `" << grp_name <<
"'";
731 fatal() <<
"Variable initialization failed";
749 m_mesh_builder->resetAfterDeallocate();
751 m_is_allocated =
false;
761 if (mesh_nb_cell==0 && !cells_infos.
empty())
762 ARCANE_FATAL(
"Can not dynamically compute the number of cells");
766 setEstimatedCells(mesh_nb_cell);
771 _allocateCells(mesh_nb_cell,cells_infos);
775 info() <<
"Time to build the mesh structures (indirect method) (unit: second): "
789 _checkConnectivity();
791 bool print_stats =
true;
795 info() <<
"Begin compute face unique ids";
798 m_mesh_builder->computeFacesUniqueIds();
800 info() <<
"Begin compute ghost layer";
803 m_mesh_builder->addGhostLayers(
true);
805 info() <<
"Begin compact items";
808 _allocateCells2(m_mesh_builder);
810 if (m_properties->getBool(PROPERTY_COMPACT_AFTER_ALLOCATE))
811 _compactItems(
true,
false);
813 _compactItemInternalReferences();
815 family->_internalApi()->endAllocate();
820#ifdef ARCANE_DEBUG_DYNAMIC_MESH
822 String file_name(
"mesh-end-allocate");
825 file_name += m_mesh_rank;
832 m_mesh_checker->checkMeshFromReferenceFile();
841 info() <<
"** Set owners from cells";
842 _setOwnersFromCells();
848 _notifyEndUpdateForFamilies();
852 m_is_allocated =
true;
867_allocateCells(
Integer mesh_nb_cell,
870 bool allow_build_face)
874 _checkConnectivity();
875 Int32 rank = meshRank();
876 if (m_use_mesh_item_family_dependencies)
877 m_mesh_builder->addCells3(mesh_nb_cell,cells_infos,rank,cells,allow_build_face);
879 m_mesh_builder->addCells(mesh_nb_cell,cells_infos,rank,cells,allow_build_face);
890 const bool allow_build_face = (m_parallel_mng->commSize() == 1);
891 _allocateCells(nb_cell,cells_infos,cells,allow_build_face);
900 bool allow_build_face = args.isAllowBuildFaces();
904 if (m_parallel_mng->commSize() > 1)
905 allow_build_face =
false;
906 _allocateCells(args.nbCell(),args.cellInfos(),args.cellLocalIds(),allow_build_face);
924 _addCells(buffer,&cells_local_id);
935 _checkConnectivity();
936 if (!itemFamilyNetwork() ||
937 !(itemFamilyNetwork() && itemFamilyNetwork()->isActivated()) ||
938 !IItemFamilyNetwork::plug_serializer) {
941 cell_serializer->deserializeItems(buffer,cells_local_id);
944 _deserializeItems(buffer, cells_local_id, m_cell_family);
952allocate(UnstructuredMeshAllocateBuildInfo& build_info)
954 auto* x = build_info._internal();
955 setDimension(x->meshDimension());
956 allocateCells(x->nbCell(),x->cellsInfos(),
true);
963allocate(CartesianMeshAllocateBuildInfo& build_info)
967 allocateCartesianMesh(
this,build_info);
978 _checkConnectivity();
981 !IItemFamilyNetwork::plug_serializer) {
983 buffer->
setMode(ISerializer::ModeReserve);
984 cell_serializer->serializeItems(buffer,cells_local_id);
987 cell_serializer->serializeItems(buffer,cells_local_id);
990 _serializeItems(buffer, cells_local_id, m_cell_family);
1003 using FamilyLidMap = std::map<String, Int32UniqueArray>;
1004 FamilyLidMap serialized_items;
1005 serialized_items[item_family->
name()] = item_local_ids;
1006 for (
const auto& connectivity :
mesh()->itemFamilyNetwork()->getChildDependencies(item_family)){
1009 auto& connected_family_serialized_items = serialized_items[connectivity->targetFamily()->name()];
1010 connected_family_serialized_items.addRange(connectivity_accessor.connectedItems(
ItemLocalId(item)).localIds());
1014 buffer->
setMode(ISerializer::ModeReserve);
1015 _fillSerializer(buffer, serialized_items);
1017 buffer->
setMode(ISerializer::ModePut);
1018 _fillSerializer(buffer, serialized_items);
1026_deserializeItems(ISerializer* buffer,Int32Array* item_local_ids, IItemFamily* item_family)
1028 ARCANE_UNUSED(item_family);
1029 buffer->setMode(ISerializer::ModeGet);
1030 mesh()->itemFamilyNetwork()->schedule([item_local_ids,buffer](IItemFamily* family) {
1031 auto family_serializer = std::unique_ptr<IItemFamilySerializer>{family->policyMng()->createSerializer()};
1032 family_serializer->deserializeItems(buffer,item_local_ids);
1034 IItemFamilyNetwork::InverseTopologicalOrder);
1035 mesh()->itemFamilyNetwork()->schedule([item_local_ids,buffer](IItemFamily* family) {
1036 auto family_serializer = std::unique_ptr<IItemFamilySerializer>{family->policyMng()->createSerializer()};
1037 family_serializer->deserializeItemRelations(buffer,item_local_ids);
1039 IItemFamilyNetwork::InverseTopologicalOrder);
1046_fillSerializer(ISerializer* buffer, std::map<String, Int32UniqueArray>& serialized_items)
1048 mesh()->itemFamilyNetwork()->schedule([& serialized_items,buffer](IItemFamily* family) {
1049 auto family_serializer = std::unique_ptr<IItemFamilySerializer>{family->policyMng()->createSerializer()};
1050 auto& serialized_items_local_ids = serialized_items[family->name()];
1051 family_serializer->serializeItems(buffer,serialized_items_local_ids);
1053 IItemFamilyNetwork::InverseTopologicalOrder);
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->serializeItemRelations(buffer,serialized_items_local_ids);
1059 IItemFamilyNetwork::InverseTopologicalOrder);
1066addParentCells(ItemVectorView & items)
1068 Trace::Setter mci(traceMng(),_className());
1070 _checkConnectivity();
1071 m_mesh_builder->addParentCells(items);
1082 _checkConnectivity();
1083 bool allow_build_face =
false ;
1084 m_mesh_builder->addHChildrenCells(parent_cell,nb_cell,cells_infos,meshRank(),cells,allow_build_face);
1091addParentCellToCell(
Cell child,
Cell parent)
1095 _checkConnectivity();
1097 m_cell_family->_addParentCellToCell(child,parent);
1104addChildCellToCell(
Cell parent,
Cell child)
1108 _checkConnectivity();
1110 m_cell_family->_addChildCellToCell2(parent, child);
1117addParentFaceToFace(Face child, Face parent)
1119 Trace::Setter mci(traceMng(), _className());
1121 _checkConnectivity();
1123 m_face_family->_addParentFaceToFace(parent, child);
1130addChildFaceToFace(Face parent, Face child)
1132 Trace::Setter mci(traceMng(), _className());
1134 _checkConnectivity();
1136 m_face_family->_addChildFaceToFace(parent, child);
1143addParentNodeToNode(Node child, Node parent)
1145 Trace::Setter mci(traceMng(), _className());
1147 _checkConnectivity();
1149 m_node_family->_addParentNodeToNode(parent, child);
1156addChildNodeToNode(Node parent, Node child)
1158 Trace::Setter mci(traceMng(), _className());
1160 _checkConnectivity();
1162 m_node_family->_addChildNodeToNode(parent, child);
1172 _checkConnectivity();
1173 Int32 rank = meshRank();
1174 if (m_use_mesh_item_family_dependencies)
1175 m_mesh_builder->addFaces3(nb_face,face_infos,rank,faces);
1177 m_mesh_builder->addFaces(nb_face,face_infos,rank,faces);
1186 addFaces(args.nbFace(),args.faceInfos(),args.faceLocalIds());
1196 _checkConnectivity();
1197 Int32 rank = meshRank();
1198 if (m_use_mesh_item_family_dependencies)
1199 m_mesh_builder->addEdges3(nb_edge,edge_infos,rank,edges);
1201 m_mesh_builder->addEdges(nb_edge,edge_infos,rank,edges);
1211 _checkConnectivity();
1212 Int32 rank = meshRank();
1213 if (m_use_mesh_item_family_dependencies)
1214 m_mesh_builder->addNodes2(nodes_uid,rank,nodes);
1216 m_mesh_builder->addNodes(nodes_uid,rank,nodes);
1225 ARCANE_UNUSED(update_graph);
1227 if (m_use_mesh_item_family_dependencies)
1228 removeItems(m_cell_family,cells_local_id);
1230 m_cell_family->internalRemoveItems(cells_local_id);
1232 if(m_item_family_network)
1234 m_item_family_network->removeConnectedDoFsFromCells(cells_local_id) ;
1242removeItems(IItemFamily* item_family, Int32ConstArrayView cells_local_id)
1244 ARCANE_UNUSED(item_family);
1245 ARCANE_ASSERT((itemFamilyNetwork()),(
"Cannot call DynamicMesh::removeItems if no ItemFamilyNetwork available"))
1247 if (cells_local_id.empty())
1251 ItemDataList item_data_list;
1252 ItemData& cell_data = item_data_list.itemData(Integer(m_cell_family->itemKind()),
1253 cells_local_id.size(),cells_local_id.size(),Int32ArrayView(),
1254 m_cell_family,(IItemFamilyModifier*)(m_cell_family),m_parallel_mng->commRank());
1256 for (auto local_id : cells_local_id) {
1258 cell_data.itemInfos()[i++] = (Int64)local_id;
1260 itemFamilyNetwork()->schedule([&item_data_list](IItemFamily* family){
1262 family->removeItems2(item_data_list);
1264 IItemFamilyNetwork::TopologicalOrder);
1274 if (m_use_mesh_item_family_dependencies)
1275 m_cell_family->detachCells2(cells_local_id);
1278 for(
Integer i=0, is=cells_local_id.
size(); i<is; ++i )
1279 m_cell_family->detachCell(cells[cells_local_id[i]]);
1290 if (m_use_mesh_item_family_dependencies)
1291 removeItems(m_cell_family,cells_local_id);
1294 for(
Integer i=0, is=cells_local_id.
size(); i<is; ++i )
1295 m_cell_family->removeDetachedCell(cells[cells_local_id[i]]);
1319 m_mesh_refinement->flagCellToCoarsen(lids);
1330 _checkConnectivity();
1332 m_mesh_refinement->refineItems(
true);
1340 Trace::Setter mci(traceMng(),_className());
1342 _checkConnectivity();
1344 m_mesh_refinement->coarsenItems(
true);
1351coarsenItemsV2(
bool update_parent_flag)
1353 Trace::Setter mci(traceMng(), _className());
1355 _checkConnectivity();
1357 if (m_amr_type != eMeshAMRKind::Cell) {
1358 ARCANE_FATAL(
"This method is not compatible with Cartesian Mesh Patch AMR");
1360 m_mesh_refinement->coarsenItemsV2(update_parent_flag);
1369 Trace::Setter mci(traceMng(),_className());
1371 _checkConnectivity();
1373 if(m_mesh_refinement->needUpdate())
1374 m_mesh_refinement->update() ;
1375 return m_mesh_refinement->refineAndCoarsenItems(
true);
1384 _compactItems(
false,
true);
1391registerCallBack(IAMRTransportFunctor* f)
1393 Trace::Setter mci(traceMng(),_className());
1395 m_mesh_refinement->registerCallBack(f);
1401unRegisterCallBack(IAMRTransportFunctor* f)
1403 Trace::Setter mci(traceMng(),_className());
1405 m_mesh_refinement->unRegisterCallBack(f);
1412_allocateCells2(DynamicMeshIncrementalBuilder* mib)
1414 Trace::Setter mci(traceMng(),_className());
1416 _finalizeMeshChanged();
1420#ifdef ARCANE_DEBUG_DYNAMIC_MESH
1421 OCStringStream ostr;
1423 info() << ostr.str();
1431_writeMesh(
const String& base_name)
1433 StringBuilder file_name(base_name);
1435 IParallelMng* pm = m_parallel_mng;
1436 bool is_parallel = pm->isParallel();
1437 Int32 rank = meshRank();
1439 file_name += subDomain()->commonVariables().globalIteration();
1443 mesh_utils::writeMeshConnectivity(
this,file_name.toString());
1445 auto writer(ServiceBuilder<IMeshWriter>::createReference(subDomain(),
"Lima"));
1447 String mesh_file_name = file_name.toString() +
".mli";
1448 writer->writeMeshToFile(
this,mesh_file_name);
1456_printMesh(std::ostream& ostr)
1458 ostr <<
"----------- Mesh\n";
1459 ostr <<
" Nodes: " << nbNode() <<
'\n';
1460 ostr <<
" Edges: " << nbEdge() <<
'\n';
1461 ostr <<
" Faces: " << nbFace() <<
'\n';
1462 ostr <<
" Cells: " << nbCell() <<
'\n';
1463 mesh_utils::printItems(ostr,
"Nodes",allNodes());
1464 mesh_utils::printItems(ostr,
"Edges",allEdges());
1465 mesh_utils::printItems(ostr,
"Faces",allFaces());
1466 mesh_utils::printItems(ostr,
"Cells",allCells());
1477 info(4) <<
"DynamicMesh::_saveProperties() name=" <<
name()
1480 auto p = m_properties;
1481 p->setInt32(
"nb-ghostlayer",
ghostLayerMng()->nbGhostLayer());
1482 p->setInt32(
"ghostlayer-builder-version",
ghostLayerMng()->builderVersion());
1483 p->setInt32(
"part-info-part-rank",m_mesh_part_info.partRank());
1484 p->setInt32(
"part-info-nb-part",m_mesh_part_info.nbPart());
1485 p->setInt32(
"part-info-replication-rank",m_mesh_part_info.replicationRank());
1486 p->setInt32(
"part-info-nb-replication",m_mesh_part_info.nbReplication());
1487 p->setBool(
"has-itemsharedinfo-variables",
true);
1488 p->setInt64(
"mesh-timestamp",m_timestamp);
1489 if (!m_do_not_save_need_compact)
1490 p->setBool(
"need-compact",m_need_compact);
1501 auto p = m_properties;
1503 info(4) <<
"DynamicMesh::_readProperties() name=" <<
name()
1504 <<
" mesh-version=" << p->getInt32WithDefault(PROPERTY_MESH_VERSION,-1);
1509 if (p->get(
"nb-ghostlayer",x))
1511 if (p->get(
"ghostlayer-builder-version",x))
1513 if (p->get(
"part-info-part-rank",x))
1514 m_mesh_part_info.setPartRank(x);
1515 if (p->get(
"part-info-nb-part",x))
1516 m_mesh_part_info.setNbPart(x);
1517 if (p->get(
"part-info-replication-rank",x))
1518 m_mesh_part_info.setReplicationRank(x);
1519 if (p->get(
"part-info-nb-replication",x))
1520 m_mesh_part_info.setNbReplication(x);
1521 if (!m_do_not_save_need_compact){
1523 if (p->get(
"need-compact",xb))
1524 m_need_compact = xb;
1527 if (p->get(
"mesh-timestamp",x2))
1540 bool want_dump = m_properties->getBool(PROPERTY_DUMP);
1541 info(4) <<
"DynamicMesh::prepareForDump() name=" <<
name()
1542 <<
" need_compact?=" << m_need_compact
1543 <<
" want_dump?=" << want_dump
1544 <<
" timestamp=" << m_timestamp;
1548 m_mesh_events.eventObservable(t).notify(
MeshEventArgs(
this,t));
1563 m_mesh_events.eventObservable(t).notify(
MeshEventArgs(
this,t));
1573_prepareForDumpReal()
1575 if (m_need_compact){
1578 _compactItems(
true,
true);
1583 if (m_parent_mesh) {
1584 ARCANE_ASSERT((m_parent_group != NULL),(
"Unexpected NULL parent group"));
1588 ARCANE_ASSERT((m_parent_group == NULL),(
"Unexpected non-NULL parent group"));
1592 const Integer n_sub_mesh = m_child_meshes.size();
1594 for(
Integer i=0;i<n_sub_mesh; ++i)
1612 family->prepareForDump();
1615 if (m_tied_interface_need_prepare_dump){
1616 m_tied_interface_mng->prepareTiedInterfacesForDump();
1617 m_tied_interface_need_prepare_dump =
false;
1629 ARCANE_FATAL(
"Attempting to create a family that already exists '{0}'",
name);
1631 debug() <<
"Creating the entities family "
1637 _buildAndInitFamily(family);
1662 ARCANE_FATAL(
"Attempting to create an ItemFamily with an unknown item kind.");
1670IItemFamilyPolicyMng* DynamicMesh::
1671_createFamilyPolicyMng(ItemFamily* family)
1673 eItemKind kind = family->itemKind();
1676 return createNodeFamilyPolicyMng(family);
1678 return createEdgeFamilyPolicyMng(family);
1680 return createFaceFamilyPolicyMng(family);
1682 return createCellFamilyPolicyMng(family);
1684 return createParticleFamilyPolicyMng(family);
1686 return createDoFFamilyPolicyMng(family);
1688 ARCANE_FATAL(
"Attempting to create an ItemFamily with an unknown item kind.");
1697_buildAndInitFamily(IItemFamily* family)
1701 IItemFamilyPolicyMng* policy_mng = _createFamilyPolicyMng(true_family);
1702 true_family->setPolicyMng(policy_mng);
1709_addFamily(ItemFamily* family)
1711 m_item_families.add(family);
1712 m_true_item_families.add(family);
1720 bool register_modifier_if_created)
1723 if (family->name()==
name && family->itemKind()==ik)
1725 if (create_if_needed){
1727 if(register_modifier_if_created){
1741findItemFamily(
const String&
name,
bool throw_exception)
1744 if (family->name()==
name)
1746 if (throw_exception)
1770_exchangeItems(
bool do_compact)
1779 if (!nb_exchange_str.
null()){
1780 bool is_bad = builtInGetValue(nb_exchange,nb_exchange_str);
1786 if (!exchange_version_str.
null()){
1787 builtInGetValue(exchange_version,exchange_version_str);
1790 info() <<
"DynamicMesh::_echangeItems() do_compact?=" << do_compact
1791 <<
" nb_exchange=" << nb_exchange <<
" version=" << exchange_version;
1794 _multipleExchangeItems(nb_exchange,exchange_version,do_compact);
1797 _exchangeItemsNew();
1802 if (ghostLayerMng()->nbGhostLayer()>1 && !m_use_mesh_item_family_dependencies)
1803 updateGhostLayers(
true);
1804 String check_exchange = platform::getEnvironmentVariable(
"ARCANE_CHECK_EXCHANGE");
1805 if (!check_exchange.null()){
1806 m_mesh_checker->checkGhostCells();
1807 pwarning() <<
"CHECKING SYNCHRONISATION !";
1808 m_mesh_checker->checkVariablesSynchronization();
1809 m_mesh_checker->checkItemGroupsSynchronization();
1811 if (checkLevel()>=2)
1812 m_mesh_checker->checkValidMesh();
1813 else if (checkLevel()>=1)
1814 m_mesh_checker->checkValidConnectivity();
1850_multipleExchangeItems(
Integer nb_exchange,
Integer version,
bool do_compact)
1852 if (version<1 || version>2)
1853 ARCANE_FATAL(
"Invalid value '{0}' for version. Valid values are 1 or 2",version);
1855 info() <<
"** ** MULTIPLE EXCHANGE ITEM version=" << version <<
" nb_exchange=" << nb_exchange;
1867 Int32 new_owner = cells_new_owner[icell];
1868 if (current_owner==new_owner)
1872 phase = (new_owner % nb_exchange);
1873 else if (version==1)
1874 phase = icell.index() / nb_cell;
1875 cells_to_exchange_new_owner[phase].
add(new_owner);
1876 cells_to_exchange_uid[phase].
add(cell.
uniqueId().asInt64());
1883 cells_new_owner[icell] = cell.
owner();
1889 for(
Integer i=0; i<nb_exchange; ++i ){
1893 info() <<
"MultipleExchange current_exchange=" << i <<
" nb_cell=" << nb_cell;
1894 uids_to_lids.
resize(nb_cell);
1899 for(
Integer z=0; z<nb_cell; ++z )
1900 cells_new_owner[cells[uids_to_lids[z]]] = new_owners[z];
1901 cells_new_owner.synchronize();
1902 mesh()->utilities()->changeOwnersFromCells();
1903 _exchangeItemsNew();
1908 bool do_sort = m_properties->getBool(PROPERTY_SORT);
1909 _compactItems(do_sort,
true);
1919 _exchangeItems(m_properties->getBool(PROPERTY_COMPACT));
1929 family->clearItems();
1936class ItemsExchangeInfo2List
1940 ~ItemsExchangeInfo2List()
1962 Trace::Setter mci(traceMng(),_className());
1967 m_need_compact =
true;
1969 if (arcane_debug_load_balancing){
1972 m_node_family->itemsNewOwner().checkIfSync(10);
1973 m_edge_family->itemsNewOwner().checkIfSync(10);
1974 m_face_family->itemsNewOwner().checkIfSync(10);
1975 m_cell_family->itemsNewOwner().checkIfSync(10);
1980 typedef Collection<DynamicMesh*> DynamicMeshCollection;
1981 DynamicMeshCollection all_cascade_meshes = List<DynamicMesh*>();
1982 all_cascade_meshes.add(
this);
1983 for(Integer i=0;i<m_child_meshes.size();++i)
1984 all_cascade_meshes.add(m_child_meshes[i]);
1986 IMeshExchanger* iexchanger = m_mesh_exchange_mng->beginExchange();
1987 MeshExchanger* mesh_exchanger =
ARCANE_CHECK_POINTER(
dynamic_cast<MeshExchanger*
>(iexchanger));
1990 if (mesh_exchanger->computeExchangeInfos()){
1991 info() <<
"No load balance is performed";
1992 m_mesh_exchange_mng->endExchange();
1997 mesh_exchanger->processExchange();
2000 mesh_exchanger->removeNeededItems();
2006 auto action = [](ItemGroup& group)
2011 if (group.internal()->hasComputeFunctor() || group.isLocalToSubDomain())
2014 group.internal()->removeSuppressedItems();
2016 for( DynamicMesh* mesh : all_cascade_meshes ){
2017 meshvisitor::visitGroups(mesh,action);
2029 for( DynamicMesh* child_mesh : m_child_meshes )
2030 child_mesh->m_submesh_tools->removeDeadGhostCells();
2032 for(Integer i_child_mesh=0;i_child_mesh<m_child_meshes.size();++i_child_mesh)
2033 m_child_meshes[i_child_mesh]->m_submesh_tools->removeDeadGhostCells();
2037 mesh_exchanger->allocateReceivedItems();
2041 for( DynamicMesh* mesh : all_cascade_meshes )
2042 mesh->_internalEndUpdateInit(
true);
2044 mesh_exchanger->updateItemGroups();
2047 for( DynamicMesh* mesh : all_cascade_meshes )
2048 mesh->_computeGroupSynchronizeInfos();
2051 mesh_exchanger->updateVariables();
2054 for( DynamicMesh* mesh : all_cascade_meshes ){
2056 bool print_info = (mesh==
this);
2057 mesh->_internalEndUpdateFinal(print_info);
2063 mesh_exchanger->finalizeExchange();
2066 m_mesh_exchange_mng->endExchange();
2074 if (m_extra_ghost_cells_builder->hasBuilder() || m_extra_ghost_particles_builder->hasBuilder())
2075 this->endUpdate(
true,
false);
2086 m_extra_ghost_cells_builder->addExtraGhostCellsBuilder(builder);
2095 m_extra_ghost_cells_builder->removeExtraGhostCellsBuilder(builder);
2104 m_extra_ghost_particles_builder->addExtraGhostParticlesBuilder(builder);
2113 m_extra_ghost_particles_builder->removeExtraGhostParticlesBuilder(builder);
2120_computeExtraGhostCells()
2122 m_extra_ghost_cells_builder->computeExtraGhostCells();
2129_computeExtraGhostParticles()
2131 m_extra_ghost_particles_builder->computeExtraGhostParticles();
2140 const Int32 sid = meshRank();
2145 UniqueArray<Int32> cells_to_remove;
2146 cells_to_remove.reserve(1000);
2148 ItemInternalMap& cells_map = m_cell_family->itemsMap();
2149 cells_map.eachItem([&](Item cell) {
2150 if (cell.owner() != sid)
2151 cells_to_remove.add(cell.localId());
2154 info() <<
"Number of cells to remove: " << cells_to_remove.size();
2155 m_cell_family->removeCells(cells_to_remove);
2158 _updateGroupsAfterRemove();
2167_updateGroupsAfterRemove()
2169 auto action = [&](
const ItemGroup& group){ group.itemFamily()->partialEndUpdateGroup(group); };
2170 meshvisitor::visitGroups(
this,action);
2186updateGhostLayers(
bool remove_old_ghost)
2195 _internalUpdateGhost(
true, remove_old_ghost);
2196 _internalEndUpdateInit(
true);
2197 _synchronizeGroups();
2198 _computeGroupSynchronizeInfos();
2199 _internalEndUpdateResizeVariables();
2200 _synchronizeVariables();
2201 _internalEndUpdateFinal(
true);
2204 for(
Integer i=0;i<m_child_meshes.size();++i) {
2205 m_child_meshes[i]->endUpdate(
true, remove_old_ghost);
2212_removeGhostChildItems()
2214 const Int32 sid = meshRank();
2217 UniqueArray<Int32> cells_to_remove;
2218 cells_to_remove.reserve(1000);
2220 ItemInternalMap& cells_map = m_cell_family->itemsMap();
2221 Integer max_level=0;
2222 cells_map.eachItem([&](impl::ItemBase cell) {
2223 if ((cell.owner() != sid) && (cell.level() != 0))
2224 max_level = math::max(cell.level(),max_level);
2230 cells_map.eachItem([&](impl::ItemBase cell) {
2231 if ((cell.owner() != sid) && (cell.level() == max_level)) {
2232 cells_to_remove.add(cell.localId());
2236 info() <<
"Number of cells to remove: " << cells_to_remove.size();
2237 m_cell_family->removeCells(cells_to_remove);
2240 _updateGroupsAfterRemove();
2247_removeGhostChildItems2(Array<Int64>& cells_to_coarsen)
2249 const Int32 sid = meshRank();
2251 cells_to_coarsen.reserve(1000);
2254 UniqueArray<Cell> cells_to_remove;
2255 cells_to_remove.reserve(1000);
2257 ItemInternalMap& cells_map = m_cell_family->itemsMap();
2259 cells_map.eachItem([&](Cell cell) {
2260 if (cell.owner() != sid)
2262 if (cell.hasFlags(ItemFlags::II_JustCoarsened)) {
2263 cells_to_coarsen.add(cell.uniqueId());
2264 for (Integer c = 0, cs = cell.nbHChildren(); c < cs; c++) {
2265 cells_to_remove.add(cell.hChild(c));
2275 for( Integer i=0, is=cells_to_remove.size(); i<is; ++i )
2276 m_cell_family->removeCell(cells_to_remove[i]);
2279 _updateGroupsAfterRemove();
2286updateGhostLayerFromParent(
Array<Int64>& ghost_cell_to_refine_uid,
2287 Array<Int64>& ghost_cell_to_coarsen_uid,
bool remove_old_ghost)
2290 CHECKPERF( m_perf_counter.start(PerfCounter::UPGHOSTLAYER1) ) ;
2292 m_need_compact =
true;
2297 if(remove_old_ghost){
2298 _removeGhostChildItems2(ghost_cell_to_coarsen_uid) ;
2302 m_face_family->setCheckOrientation(
false);
2304 m_mesh_builder->addGhostChildFromParent(ghost_cell_to_refine_uid);
2305 m_face_family->setCheckOrientation(
true);
2309 m_mesh_builder->printStats();
2310 CHECKPERF( m_perf_counter.stop(PerfCounter::UPGHOSTLAYER1) )
2313 CHECKPERF( m_perf_counter.start(PerfCounter::UPGHOSTLAYER2) )
2318 family->endUpdate();
2320 CHECKPERF( m_perf_counter.stop(PerfCounter::UPGHOSTLAYER2) )
2325 CHECKPERF( m_perf_counter.start(PerfCounter::UPGHOSTLAYER3) )
2331 CHECKPERF( m_perf_counter.stop(PerfCounter::UPGHOSTLAYER3) )
2337 CHECKPERF( m_perf_counter.start(PerfCounter::UPGHOSTLAYER4) )
2339 _synchronizeGroupsAndVariables();
2340 CHECKPERF( m_perf_counter.stop(PerfCounter::UPGHOSTLAYER4) )
2344 CHECKPERF( m_perf_counter.start(PerfCounter::UPGHOSTLAYER5) )
2346 m_cell_family->itemsUniqueIdToLocalId(ghost_cell_to_refine_lid,ghost_cell_to_refine_uid,
true) ;
2348 for (
Integer e = 0, i_size=ghost_cell_to_refine_lid.
size(); e != i_size; ++e){
2349 Cell i_hParent_cell(cells[ghost_cell_to_refine_lid[e]]);
2355 for(
Integer iface=0;iface<nb_face;++iface){
2356 Face face = i_hParent_cell.
face(iface);
2358 for(
Integer icell=0;icell<nb_cell;++icell){
2362 m_face_family->familyTree(childs,cell,
false) ;
2363 for(
Integer i=0,nchilds=childs.
size();i<nchilds;++i){
2372 CHECKPERF( m_perf_counter.stop(PerfCounter::UPGHOSTLAYER5) )
2376 CHECKPERF( m_perf_counter.start(PerfCounter::UPGHOSTLAYER6) )
2377 m_mesh_checker->checkMeshFromReferenceFile();
2384 bool do_compact = m_properties->getBool(PROPERTY_COMPACT);
2386 bool do_sort = m_properties->getBool(PROPERTY_SORT);
2387 _compactItems(do_sort,do_compact);
2389 CHECKPERF( m_perf_counter.stop(PerfCounter::UPGHOSTLAYER6) )
2391 if (arcane_debug_load_balancing){
2392 _writeMesh(
"update-ghost-layer-after");
2399 pinfo() <<
"Proc: " << meshRank()
2400 <<
" cellown=" << m_cell_family->allItems().own().size()
2401 <<
" cellloc=" << m_cell_family->allItems().size();
2405 CHECKPERF( m_perf_counter.start(PerfCounter::UPGHOSTLAYER7) )
2407 m_mesh_checker->updateAMRFaceOrientation(ghost_cell_to_refine_uid);
2409 if (m_mesh_checker->checkLevel()>=1)
2410 m_mesh_checker->checkValidConnectivity();
2411 CHECKPERF( m_perf_counter.stop(PerfCounter::UPGHOSTLAYER7) )
2413#ifdef ACTIVATE_PERF_COUNTER
2414 m_perf_counter.printInfo(
info().file()) ;
2422_internalUpdateGhost(
bool update_ghost_layer,
bool remove_old_ghost)
2424 m_need_compact =
true;
2428 if (update_ghost_layer)
2429 m_submesh_tools->updateGhostMesh();
2432 if (update_ghost_layer){
2433 if(remove_old_ghost){
2434 _removeGhostItems();
2437 m_face_family->setCheckOrientation(
false);
2438 m_mesh_builder->addGhostLayers(
false);
2439 m_face_family->setCheckOrientation(
true);
2440 _computeExtraGhostCells();
2441 _computeExtraGhostParticles();
2450_internalEndUpdateInit(
bool update_ghost_layer)
2457 _finalizeMeshChanged();
2461 if (update_ghost_layer){
2462 info() <<
"ComputeSyncInfos date=" << platform::getCurrentDateTime();
2463 _computeFamilySynchronizeInfos();
2471_internalEndUpdateResizeVariables()
2474 for( IItemFamily* family : m_item_families )
2475 family->_internalApi()->resizeVariables(
true);
2483_internalEndUpdateFinal(
bool print_stat)
2486 m_mesh_checker->checkMeshFromReferenceFile();
2494 _compactItemInternalReferences();
2497 bool do_compact = m_properties->getBool(PROPERTY_COMPACT);
2498 info(4) <<
"DynamicMesh::_internalEndUpdateFinal() compact?=" << do_compact <<
" sort?=" << m_properties->getBool(PROPERTY_SORT);
2500 bool do_sort = m_properties->getBool(PROPERTY_SORT);
2501 _compactItems(do_sort,do_compact);
2506 _notifyEndUpdateForFamilies();
2510 if (m_properties->getBool(PROPERTY_DISPLAY_STATS)){
2518 m_mesh_checker->updateAMRFaceOrientation();
2520 if (m_mesh_checker->checkLevel()>=1)
2521 m_mesh_checker->checkValidConnectivity();
2528_notifyEndUpdateForFamilies()
2531 family->_internalApi()->notifyEndUpdateFromMesh();
2547endUpdate(
bool update_ghost_layer,
bool remove_old_ghost)
2561 _internalUpdateGhost(update_ghost_layer, remove_old_ghost);
2563 _internalEndUpdateInit(update_ghost_layer);
2564 if (update_ghost_layer){
2565 _synchronizeGroups();
2566 _computeGroupSynchronizeInfos();
2568 _internalEndUpdateResizeVariables();
2569 if (update_ghost_layer){
2570 _synchronizeVariables();
2572 _internalEndUpdateFinal(
false);
2575 for( DynamicMesh* child_mesh : m_child_meshes )
2576 child_mesh->endUpdate(update_ghost_layer, remove_old_ghost);
2583synchronizeGroupsAndVariables()
2585 _synchronizeGroupsAndVariables();
2589 for( DynamicMesh* child_mesh : m_child_meshes )
2590 child_mesh->synchronizeGroupsAndVariables();
2597_synchronizeGroupsAndVariables()
2599 _synchronizeGroups();
2600 _synchronizeVariables();
2614 ItemGroupsSynchronize igs(m_edge_family);
2618 ItemGroupsSynchronize igs(m_face_family);
2622 ItemGroupsSynchronize igs(m_cell_family);
2626 for( IItemFamily* family : m_item_families ){
2627 if (family->itemKind()==IK_Particle){
2628 IParticleFamily* pfamily = family->toParticleFamily();
2629 if (pfamily && pfamily->getEnableGhostItems()){
2630 ItemGroupsSynchronize igs(family);
2642_synchronizeVariables()
2654 typedef UniqueArray<IVariableSynchronizer*> OrderedSyncList;
2655 typedef std::map<IVariableSynchronizer*, VariableCollection> SyncList;
2656 OrderedSyncList ordered_sync_list;
2659 VariableCollection used_vars(subDomain()->variableMng()->usedVariables());
2660 for( VariableCollection::Enumerator i_var(used_vars); ++i_var; ) {
2661 IVariable* var = *i_var;
2662 switch(var->itemKind()) {
2668 IVariableSynchronizer * synchronizer = 0;
2669 if (var->isPartial())
2670 synchronizer = var->itemGroup().synchronizer();
2672 synchronizer = var->itemFamily()->allItemsSynchronizer();
2673 IMesh * sync_mesh = synchronizer->itemGroup().mesh();
2674 if (sync_mesh !=
this)
continue;
2675 std::pair<SyncList::iterator,bool> inserter = sync_list.insert(std::make_pair(synchronizer,VariableCollection()));
2676 if (inserter.second) {
2677 ordered_sync_list.add(synchronizer);
2679 VariableCollection & collection = inserter.first->second;
2680 collection.add(var);
2688 for(Integer i_sync = 0; i_sync < ordered_sync_list.size(); ++i_sync) {
2689 IVariableSynchronizer * synchronizer = ordered_sync_list[i_sync];
2690 VariableCollection & collection = sync_list[synchronizer];
2691 synchronizer->synchronize(collection);
2699_sortInternalReferences()
2702 m_node_family->sortInternalReferences();
2709_finalizeMeshChanged()
2712 for( IItemFamily* family : m_item_families ){
2713 debug() <<
"_finalizeMeshChanged on " << family->name() <<
" Family on Mesh " << name();
2714 family->endUpdate();
2717 bool do_sort = m_properties->getBool(PROPERTY_SORT);
2719 _sortInternalReferences();
2720 m_tied_interface_need_prepare_dump =
true;
2727_applyCompactPolicy(
const String& timer_name,
2728 std::function<
void(IItemFamilyCompactPolicy*)> functor)
2730 Timer::Action ts_action(m_sub_domain,timer_name);
2731 for( IItemFamily* family : m_item_families ){
2732 IItemFamilyCompactPolicy* c = family->policyMng()->compactPolicy();
2742_compactItemInternalReferences()
2744 _applyCompactPolicy(
"CompactConnectivityData",[&](IItemFamilyCompactPolicy* c)
2745 { c->compactConnectivityData(); });
2752_compactItems(
bool do_sort,
bool compact_variables_and_groups)
2755 info(4) <<
"Compress and sort the mesh entities " << name() <<
".";
2757 info(4) <<
"Compress the mesh entities " << name() <<
".";
2759 IMeshCompacter* compacter = m_mesh_compact_mng->beginCompact();
2762 compacter->setSorted(do_sort);
2763 compacter->_setCompactVariablesAndGroups(compact_variables_and_groups);
2765 compacter->doAllActions();
2768 m_mesh_compact_mng->endCompact();
2771 m_mesh_compact_mng->endCompact();
2774 Timer::Action ts_action(m_sub_domain,
"CompactItemSortReferences");
2777 _sortInternalReferences();
2780 m_need_compact =
false;
2791setEstimatedCells(Integer nb_cell0)
2794 if (m_parallel_mng->isParallel())
2797 Integer nb_node = Convert::toInteger(nb_cell0 * 1.2 * factor);
2798 Integer nb_edge = Convert::toInteger(nb_cell0 * 6.8 * factor);
2799 Integer nb_face = Convert::toInteger(nb_cell0 * 3.4 * factor);
2800 Integer nb_cell = Convert::toInteger(nb_cell0 * 1.0 * factor);
2801 info() <<
"Estimating the number of entities:"
2802 <<
" Node=" << nb_node
2803 <<
" Edge=" << nb_edge
2804 <<
" Face=" << nb_face
2805 <<
" Cell=" << nb_cell;
2806 m_node_family->preAllocate(nb_node);
2807 m_edge_family->preAllocate(nb_edge);
2808 m_face_family->preAllocate(nb_face);
2809 m_cell_family->preAllocate(nb_cell);
2833 ARCANE_ASSERT((m_parent_mesh != NULL),(
"Unexpected NULL Mesh"));
2837 m_child_meshes.resize(n_sub_mesh);
2838 for(
Integer i=0;i<n_sub_mesh;++i)
2841 DynamicMesh* dynamic_child_mesh =
dynamic_cast<DynamicMesh*
>(child_mesh);
2842 if (dynamic_child_mesh == 0)
2843 ARCANE_FATAL(
"Cannot associate sub mesh from a different concrete type");
2844 m_child_meshes[i] = dynamic_child_mesh;
2850 for(
Integer i=0; i<nb_item_family; ++i ){
2851 info(5) <<
"Found family: I=" << i
2860 for(
Integer i=0; i<nb_item_family; ++i ){
2868 if (!m_is_sub_connectivity_set)
2869 _setSubConnectivity();
2873 family->readFromDump();
2877 _notifyEndUpdateForFamilies();
2880 m_item_internal_list.nodes = m_node_family->itemsInternal();
2881 m_item_internal_list.edges = m_edge_family->itemsInternal();
2882 m_item_internal_list.faces = m_face_family->itemsInternal();
2883 m_item_internal_list.cells = m_cell_family->itemsInternal();
2884 m_item_internal_list.mesh =
this;
2886 m_tied_interface_mng->readTiedInterfacesFromDump();
2888 m_mesh_builder->readFromDump();
2898 return m_tied_interface_mng->hasTiedInterface();
2907 return m_tied_interface_mng->tiedInterfaces();
2916 return m_tied_interface_mng->trueTiedInterfaces();
2923computeTiedInterfaces(
const XmlNode& mesh_node)
2925 m_tied_interface_mng->computeTiedInterfaces(mesh_node);
2935 _checkConnectivity();
2945 ARCANE_FATAL(
"DynamicMesh::setDimension(): mesh is already allocated");
2946 info() <<
"Mesh name=" << name() <<
" set dimension = " << dim;
2947 m_mesh_dimension = dim;
2948 const bool is_non_manifold = meshKind().isNonManifold();
2951 if (is_non_manifold){
2952 info() <<
"Force no-renumbering of edge and face uid because we are using non manifold mesh";
2953 m_mesh_unique_id_mng->setFaceBuilderVersion(0);
2954 m_mesh_unique_id_mng->setEdgeBuilderVersion(0);
2956 bool v = m_mesh_unique_id_mng->isUseNodeUniqueIdToGenerateEdgeAndFaceUniqueId();
2962 if (!v && is_non_manifold) {
2964 info() <<
"Force using edge and face uid generation from nodes because we are using non manifold mesh";
2966 if (m_mesh_builder){
2967 auto* adder = m_mesh_builder->oneMeshItemAdder();
2969 adder->setUseNodeUniqueIdToGenerateEdgeAndFaceUniqueId(v);
2973 if (dim == 3 && is_non_manifold) {
2974 Connectivity c(m_mesh_connectivity);
2975 if (!c.hasConnectivity(Connectivity::CT_HasEdge)) {
2976 c.enableConnectivity(Connectivity::CT_HasEdge);
2977 info() <<
"Force creating edges for 3D non-manifold mesh";
2986_checkDimension()
const
2988 if (m_mesh_dimension()<0)
2989 ARCANE_FATAL(
"dimension not set. setDimension() must be called before allocating cells");
2998 Connectivity c(m_mesh_connectivity);
2999 if (!c.isFrozen()) {
3001 debug() <<
"Mesh " << name() <<
" connectivity : " << Connectivity::Printer(m_mesh_connectivity());
3002 _setSubConnectivity();
3003 _updateItemFamilyDependencies(m_mesh_connectivity);
3013 if (!m_is_amr_activated)
3014 ARCANE_FATAL(
"DynamicMesh::_checkAMR(): amr activator not set.\t"
3015 "amr='true' must be set in the .arc file");
3022_setSubConnectivity()
3024 m_mesh_builder->setConnectivity(m_mesh_connectivity());
3025 m_node_family->setConnectivity(m_mesh_connectivity());
3026 m_edge_family->setConnectivity(m_mesh_connectivity());
3027 m_face_family->setConnectivity(m_mesh_connectivity());
3028 m_cell_family->setConnectivity(m_mesh_connectivity());
3029 m_is_sub_connectivity_set =
true;
3036_writeCells(
const String& filename)
3038 CellGroup cells(m_cell_family->allItems());
3039 std::ofstream ofile(filename.localstr());
3042 ofile <<
"CELL: uid=" << cell.uniqueId() <<
" isown="
3043 << cell.isOwn() <<
" owner=" << cell.owner() <<
'\n';
3053 return m_node_family->nodesCoordinates();
3060sharedNodesCoordinates()
3072_setOwnersFromCells()
3096 const Integer sid = subDomain()->subDomainId();
3099 if(m_new_item_owner_builder == NULL)
3105 Node node = *i_node;
3106 nodes_owner[node] = m_new_item_owner_builder->ownerOfItem(node);
3108 nodes_owner.synchronize();
3112 Node node = *i_node;
3119 Edge edge = *i_edge;
3120 edges_owner[edge] = m_new_item_owner_builder->ownerOfItem(edge);
3122 edges_owner.synchronize();
3126 Edge edge = *i_edge;
3127 edge.mutableItemBase().setOwner(edges_owner[edge],sid);
3133 Face face = *i_face;
3134 faces_owner[face] = m_new_item_owner_builder->ownerOfItem(face);
3136 faces_owner.synchronize();
3140 Face face = *i_face;
3141 face.mutableItemBase().setOwner(faces_owner[face],sid);
3144 nodeFamily()->notifyItemsOwnerChanged();
3145 edgeFamily()->notifyItemsOwnerChanged();
3146 faceFamily()->notifyItemsOwnerChanged();
3147 _computeFamilySynchronizeInfos();
3156 if (!m_mesh_utilities)
3158 return m_mesh_utilities;
3167 return m_cell_family->allItems().outerFaceGroup();
3177 return m_cell_family->allItems().activeCellGroup();
3185 return m_cell_family->allItems().ownActiveCellGroup();
3191allLevelCells(
const Integer& level)
3193 return m_cell_family->allItems().levelCellGroup(level);
3199ownLevelCells(
const Integer& level)
3201 return m_cell_family->allItems().ownLevelCellGroup(level);
3209 return m_cell_family->allItems().activeFaceGroup();
3217 return m_cell_family->allItems().ownActiveFaceGroup();
3228 return m_cell_family->allItems().innerActiveFaceGroup();
3236 return m_cell_family->allItems().outerActiveFaceGroup();
3253 ARCANE_FATAL(
"Cannot set inconsistant mesh/group parents to mesh '{0}'",
name());
3255 if (m_parent_mesh) {
3256 if (m_parent_mesh !=
mesh)
3257 ARCANE_FATAL(
"Mesh '{0}' already has parent mesh '{1}'",
name(),m_parent_mesh->name());
3258 if (m_parent_group != group.
internal())
3259 ARCANE_FATAL(
"Mesh '{0}' already has parent group '{1}'",
name(),m_parent_group->name());
3262 m_parent_mesh =
mesh;
3267 dimension_shift = 1;
3270 dimension_shift = 0;
3273 ARCANE_FATAL(
"Only SubMesh on FaceGroup or CellGoup is allowed");
3276 _setDimension(
mesh->dimension()-dimension_shift);
3279 const eItemKind kind = family->itemKind();
3284 family->setParentFamily(
mesh->itemFamily(parent_kind));
3296partitionConstraintMng()
3298 return m_partition_constraint_mng;
3307 return m_parent_mesh;
3323addChildMesh(
IMesh * sub_mesh)
3325 DynamicMesh * dynamic_child_mesh =
dynamic_cast<DynamicMesh*
>(sub_mesh);
3326 if (!dynamic_child_mesh)
3327 ARCANE_FATAL(
"Cannot associate sub mesh from a different concrete type");
3328 for(
Integer i=0;i<m_child_meshes.size();++i)
3329 if (m_child_meshes[i] == dynamic_child_mesh)
3331 m_child_meshes.add(dynamic_child_mesh);
3341 for(
Integer i=0;i<m_child_meshes.size(); ++i) {
3342 collection.add(m_child_meshes[i]);
3353 return m_mesh_checker;
3360isPrimaryMesh()
const
3382 return m_node_family->nbItem();
3387 return m_edge_family->nbItem();
3392 return m_face_family->nbItem();
3397 return m_cell_family->nbItem();
3403 return m_node_family;
3409 return m_edge_family;
3415 return m_face_family;
3421 return m_cell_family;
3424DynamicMeshKindInfos::ItemInternalMap& DynamicMesh::
3427 return m_node_family->itemsMap();
3430DynamicMeshKindInfos::ItemInternalMap& DynamicMesh::
3433 return m_edge_family->itemsMap();
3436DynamicMeshKindInfos::ItemInternalMap& DynamicMesh::
3439 return m_face_family->itemsMap();
3442DynamicMeshKindInfos::ItemInternalMap& DynamicMesh::
3445 return m_cell_family->itemsMap();
3457 true_meshes.
add(true_mesh);
3460 merger.mergeMeshes(true_meshes);
3467_printConnectivityPolicy()
3469 info() <<
"Connectivity policy=" << (int)m_connectivity_policy;
3472 ARCANE_FATAL(
"Invalid value '{0}' for InternalConnectivityPolicy. Only '{1}' is allowed",
3482 m_mesh_part_info = mpi;
3492 if (!m_item_family_network)
3495 for (
const auto& con : m_item_family_network->getConnectivities()) {
3496 if (c.hasConnectivity(c.kindsToConnectivity(con->sourceFamily()->itemKind(),con->targetFamily()->itemKind()))){
3497 m_item_family_network->setIsStored(con);
3508 return m_internal_api.get();
3515_modifierInternalApi()
3517 return m_internal_api.get();
3524computeSynchronizeInfos()
3526 _computeSynchronizeInfos();
3532class ARCANE_MESH_EXPORT DynamicMeshFactoryBase
3555 if (is_submesh && m_is_amr)
3568class ARCANE_MESH_EXPORT DynamicMeshFactory
3569:
public DynamicMeshFactoryBase
3573 : DynamicMeshFactoryBase(sbi,
false) {}
3579class ARCANE_MESH_EXPORT DynamicAMRMeshFactory
3580:
public DynamicMeshFactoryBase
3584 : DynamicMeshFactoryBase(sbi,
true) {}
#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.
bool isOwn() const
true si l'entité est appartient au sous-domaine
Int32 owner() const
Numéro du sous-domaine propriétaire de l'entité
ItemUniqueId uniqueId() const
Identifiant unique sur tous les domaines.
Implémentation d'une collection d'éléments sous forme de vecteur.
Paramètres nécessaires à la construction d'un maillage.
const ItemGroup & parentGroup() const
Groupe parent dans le cas d'un sous-maillage, null sinon.
const MeshKind meshKind() const
Caractéristiques du maillage.
MeshBuildInfo & addMeshKind(const MeshKind &v)
Positionne les caractéristiques du maillage.
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.
@ None
Aucune politique d'exécution.
bool arcaneIsCheck()
Vrai si on est en mode vérification.
Collection< ItemGroup > ItemGroupCollection
Collection de groupes d'éléments du maillage.
std::int64_t Int64
Type entier signé sur 64 bits.
Int32 Integer
Type représentant un entier.
ConstArrayView< Int32 > Int32ConstArrayView
Equivalent C d'un tableau à une dimension d'entiers 32 bits.
ConstArrayView< ItemInternal * > ItemInternalList
Type de la liste interne des entités.
SharedMeshVariableScalarRefT< Node, Real3 > SharedVariableNodeReal3
Grandeur au noeud de type coordonnées.
@ ST_Application
Le service s'utilise au niveau de l'application.
ConstArrayView< Int64 > Int64ConstArrayView
Equivalent C d'un tableau à une dimension d'entiers 64 bits.
eMeshEventType
Evènements générés par IMesh.
@ EndPrepareDump
Evènement envoyé à la fin de prepareForDump()
@ BeginPrepareDump
Evènement envoyé au début de prepareForDump()
UniqueArray< Int32 > Int32UniqueArray
Tableau dynamique à une dimension d'entiers 32 bits.
ArrayView< Int32 > Int32ArrayView
Equivalent C d'un tableau à une dimension d'entiers 32 bits.
eItemKind
Genre d'entité de maillage.
@ IK_Particle
Entité de maillage de genre particule.
@ IK_Node
Entité de maillage de genre noeud.
@ IK_Cell
Entité de maillage de genre maille.
@ IK_Unknown
Entité de maillage de genre inconnu ou non initialisé
@ IK_Face
Entité de maillage de genre face.
@ IK_DoF
Entité de maillage de genre degre de liberte.
@ IK_Edge
Entité de maillage de genre arête.
const char * itemKindName(eItemKind kind)
Nom du genre d'entité.
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.