Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::mesh::GhostLayerBuilder2 Class Reference

Construction of ghost layers. More...

Inheritance diagram for Arcane::mesh::GhostLayerBuilder2:
Collaboration diagram for Arcane::mesh::GhostLayerBuilder2:

Classes

class  BoundaryNodeInfo
 Structure containing boundary node information. More...
class  BoundaryNodeBitonicSortTraits
 Functor for sorting BoundaryNodeInfo via bitonic sort. More...
class  BoundaryNodeToSendInfo

Public Types

using ItemInternalMap = DynamicMeshKindInfos::ItemInternalMap
using SubDomainItemMap = HashTableMapT<Int32, SharedArray<Int32>>

Public Member Functions

 GhostLayerBuilder2 (DynamicMeshIncrementalBuilder *mesh_builder, bool is_allocate, Int32 version)
 Constructs an instance for the mesh mesh.
void addGhostLayers ()
 Adds ghost cell layers.
Public Member Functions inherited from Arcane::TraceAccessor
 TraceAccessor (ITraceMng *m)
 Constructs an accessor via the trace manager m.
 TraceAccessor (const TraceAccessor &rhs)
 Copy constructor.
TraceAccessoroperator= (const TraceAccessor &rhs)
 Copy assignment operator.
virtual ~TraceAccessor ()
 Frees resources.
ITraceMngtraceMng () const
 Trace manager.
TraceMessage info () const
 Flow for an information message.
TraceMessage pinfo () const
 Flow for a parallel information message.
TraceMessage info (char category) const
 Flow for an information message of a given category.
TraceMessage pinfo (char category) const
 Flow for a parallel information message of a given category.
TraceMessage info (bool v) const
 Flow for an information message.
TraceMessage warning () const
 Flow for a warning message.
TraceMessage pwarning () const
TraceMessage error () const
 Flow for an error message.
TraceMessage perror () const
TraceMessage log () const
 Flow for a log message.
TraceMessage plog () const
 Flow for a log message.
TraceMessage logdate () const
 Flow for a log message preceded by the date.
TraceMessage fatal () const
 Flow for a fatal error message.
TraceMessage pfatal () const
 Flow for a parallel fatal error message.
TraceMessageDbg debug (Trace::eDebugLevel=Trace::Medium) const
 Flow for a debug message.
Trace::eDebugLevel configDbgLevel () const
 Debug level of the configuration file.
TraceMessage info (Int32 verbose_level) const
 Flow for an information message of a given level.
TraceMessage linfo () const
 Flow for an information message with the local information level of this instance.
TraceMessage linfo (Int32 relative_level) const
 Flow for an information message with the local information level of this instance.
void fatalMessage (const StandaloneTraceMessage &o) const

Private Member Functions

void _printItem (ItemInternal *ii, std::ostream &o)
void _markBoundaryItems (ArrayView< Int32 > node_layer)
 Marks the entities at the edge of the sub-domain.
void _sendAndReceiveCells (SubDomainItemMap &cells_to_send)
void _sortBoundaryNodeList (Array< BoundaryNodeInfo > &boundary_node_list)
 Parallel sorting of the list of boundary node information.
void _addGhostLayer (Integer current_layer, Int32ConstArrayView node_layer)
void _markBoundaryNodes (ArrayView< Int32 > node_layer)
 Determines the boundary nodes.
void _markBoundaryNodesFromEdges (ArrayView< Int32 > node_layer)

Private Attributes

DynamicMeshm_mesh = nullptr
DynamicMeshIncrementalBuilderm_mesh_builder = nullptr
IParallelMngm_parallel_mng = nullptr
bool m_is_verbose = false
bool m_is_allocate = false
Int32 m_version = -1
bool m_use_optimized_node_layer = true
bool m_use_only_minimal_cell_uid = true

Additional Inherited Members

Protected Member Functions inherited from Arcane::TraceAccessor
void _setLocalVerboseLevel (Int32 v)
Int32 _localVerboseLevel () const

Detailed Description

Construction of ghost layers.

Definition at line 49 of file GhostLayerBuilder2.cc.

Member Typedef Documentation

◆ ItemInternalMap

using Arcane::mesh::GhostLayerBuilder2::ItemInternalMap = DynamicMeshKindInfos::ItemInternalMap

Definition at line 58 of file GhostLayerBuilder2.cc.

◆ SubDomainItemMap

using Arcane::mesh::GhostLayerBuilder2::SubDomainItemMap = HashTableMapT<Int32, SharedArray<Int32>>

Definition at line 59 of file GhostLayerBuilder2.cc.

Constructor & Destructor Documentation

◆ GhostLayerBuilder2()

Arcane::mesh::GhostLayerBuilder2::GhostLayerBuilder2 ( DynamicMeshIncrementalBuilder * mesh_builder,
bool is_allocate,
Int32 version )

Constructs an instance for the mesh mesh.

Definition at line 95 of file GhostLayerBuilder2.cc.

References Arcane::TraceAccessor::TraceAccessor(), and Arcane::TraceAccessor::traceMng().

Here is the call graph for this function:

Member Function Documentation

◆ _addGhostLayer()

void Arcane::mesh::GhostLayerBuilder2::_addGhostLayer ( Integer current_layer,
Int32ConstArrayView node_layer )
private

Definition at line 466 of file GhostLayerBuilder2.cc.

◆ _markBoundaryItems()

void Arcane::mesh::GhostLayerBuilder2::_markBoundaryItems ( ArrayView< Int32 > node_layer)
private

Marks the entities at the edge of the sub-domain.

This assumes that the faces have already been marked with the II_Boundary flag and that their owner is correctly positioned (i.e.: the same for all sub-domains).

Definition at line 963 of file GhostLayerBuilder2.cc.

References Arcane::MutableItemBase::addFlags(), Arcane::Face::cell(), Arcane::IParallelMng::commRank(), Arcane::mesh::ItemInternalMap::eachItem(), Arcane::Face::edges(), Arcane::ItemBase::flags(), Arcane::ItemFlags::II_Boundary, Arcane::ItemFlags::II_Shared, Arcane::ItemFlags::II_SubDomainBoundary, Arcane::Item::itemBase(), Arcane::Item::mutableItemBase(), Arcane::Face::nbCell(), Arcane::ItemWithNodes::nodes(), and Arcane::Item::owner().

Referenced by addGhostLayers().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _markBoundaryNodes()

void Arcane::mesh::GhostLayerBuilder2::_markBoundaryNodes ( ArrayView< Int32 > node_layer)
private

Determines the boundary nodes.

This algorithm works even if there are already ghost cells. To determine the boundary nodes, you must first determine the boundary faces. A face is boundary if it falls into one of two cases:

  • it has only one connected cell belonging to this subdomain.
  • it is connected to two cells, exactly one of which belongs to this domain. Once the boundary faces are found, we consider that the boundary nodes are those that belong to a boundary face.

Definition at line 435 of file GhostLayerBuilder2.cc.

References Arcane::MutableItemBase::addFlags(), Arcane::Face::cell(), Arcane::IParallelMng::commRank(), Arcane::mesh::ItemInternalMap::eachItem(), Arcane::Face::edges(), Arcane::ItemFlags::II_Shared, Arcane::ItemFlags::II_SubDomainBoundary, Arcane::Item::mutableItemBase(), Arcane::Face::nbCell(), Arcane::ItemWithNodes::nodes(), and Arcane::Item::owner().

Referenced by addGhostLayers().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _markBoundaryNodesFromEdges()

void Arcane::mesh::GhostLayerBuilder2::_markBoundaryNodesFromEdges ( ArrayView< Int32 > node_layer)
private

Definition at line 996 of file GhostLayerBuilder2.cc.

◆ _printItem()

void Arcane::mesh::GhostLayerBuilder2::_printItem ( ItemInternal * ii,
std::ostream & o )
private

Definition at line 117 of file GhostLayerBuilder2.cc.

◆ _sendAndReceiveCells()

void Arcane::mesh::GhostLayerBuilder2::_sendAndReceiveCells ( SubDomainItemMap & cells_to_send)
private

Definition at line 912 of file GhostLayerBuilder2.cc.

◆ _sortBoundaryNodeList()

void Arcane::mesh::GhostLayerBuilder2::_sortBoundaryNodeList ( Array< BoundaryNodeInfo > & boundary_node_list)
private

Parallel sorting of the list of boundary node information.

Takes as input a list of boundary nodes and sorts it in parallel ensuring that after sorting the information for the same node is on the same process.

Definition at line 812 of file GhostLayerBuilder2.cc.

References Arcane::Array< T >::add(), Arcane::Array< T >::addRange(), Arcane::Array< T >::clear(), Arcane::IParallelMng::commRank(), Arcane::IParallelMng::commSize(), Arcane::TraceAccessor::info(), Arcane::Parallel::BitonicSort< KeyType, KeyTypeTraits >::keys(), Arcane::IParallelMng::recv(), Arcane::Array< T >::resize(), Arcane::AbstractArray< T >::size(), Arcane::ConstArrayView< T >::size(), Arcane::Parallel::BitonicSort< KeyType, KeyTypeTraits >::sort(), Arcane::ConstArrayView< T >::subConstView(), Arcane::TraceAccessor::traceMng(), and Arcane::IParallelMng::waitAllRequests().

Here is the call graph for this function:

◆ addGhostLayers()

void Arcane::mesh::GhostLayerBuilder2::addGhostLayers ( )

Adds ghost cell layers.

This version uses sorting to determine the info

Before calling this function, there should be no ghost cells: all cells in the mesh must belong to this sub-domain. (TODO: add test for this).

If multiple ghost cell layers are requested, we proceed in multiple steps for the same algorithm. First, we send the first layer, then the first and the second, then three layers, and so on. This is probably not optimal in terms of communication but allows processing all cases, especially the case where multiple sub-domains must be crossed to add ghost cell layers.

Todo

: implement the optimizations specified in the comments in this function.

: ensure that we only work with the cell/node connectivity.

Definition at line 297 of file GhostLayerBuilder2.cc.

References _markBoundaryItems(), _markBoundaryNodes(), ARCANE_FATAL, Arcane::IParallelMng::commRank(), Arcane::mesh::ItemInternalMap::eachItem(), Arcane::ItemBase::flags(), Arcane::ItemFlags::II_Shared, Arcane::TraceAccessor::info(), Arcane::Item::isOwn(), Arcane::IParallelMng::isParallel(), Arcane::Item::itemBase(), Arcane::Item::localId(), Arcane::ItemWithNodes::nodeIds(), Arcane::Item::owner(), and Arcane::TraceAccessor::warning().

Here is the call graph for this function:

Member Data Documentation

◆ m_is_allocate

bool Arcane::mesh::GhostLayerBuilder2::m_is_allocate = false
private

Definition at line 76 of file GhostLayerBuilder2.cc.

◆ m_is_verbose

bool Arcane::mesh::GhostLayerBuilder2::m_is_verbose = false
private

Definition at line 75 of file GhostLayerBuilder2.cc.

◆ m_mesh

DynamicMesh* Arcane::mesh::GhostLayerBuilder2::m_mesh = nullptr
private

Definition at line 72 of file GhostLayerBuilder2.cc.

◆ m_mesh_builder

DynamicMeshIncrementalBuilder* Arcane::mesh::GhostLayerBuilder2::m_mesh_builder = nullptr
private

Definition at line 73 of file GhostLayerBuilder2.cc.

◆ m_parallel_mng

IParallelMng* Arcane::mesh::GhostLayerBuilder2::m_parallel_mng = nullptr
private

Definition at line 74 of file GhostLayerBuilder2.cc.

◆ m_use_only_minimal_cell_uid

bool Arcane::mesh::GhostLayerBuilder2::m_use_only_minimal_cell_uid = true
private

Definition at line 79 of file GhostLayerBuilder2.cc.

◆ m_use_optimized_node_layer

bool Arcane::mesh::GhostLayerBuilder2::m_use_optimized_node_layer = true
private

Definition at line 78 of file GhostLayerBuilder2.cc.

◆ m_version

Int32 Arcane::mesh::GhostLayerBuilder2::m_version = -1
private

Definition at line 77 of file GhostLayerBuilder2.cc.


The documentation for this class was generated from the following file: