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

Grid mesh partitioner. More...

Inheritance diagram for Arcane::SimpleGridMeshPartitioner:
Collaboration diagram for Arcane::SimpleGridMeshPartitioner:

Classes

class  GhostCellsBuilder
 Information about extra ghost cells. More...
class  GridInfo

Public Member Functions

 SimpleGridMeshPartitioner (const ServiceBuildInfo &sbi)
void build () override
 Build-level construction of the service.
IPrimaryMeshprimaryMesh () override
 Associated mesh.
void partitionMesh (bool initial_partition) override
void notifyEndPartition () override
 Notification when a re-partitioning finishes (after entity exchange).
void setBoundingBox (Real3 min_val, Real3 max_val) override
 Positions the bounding box of our subdomain.
void setPartIndex (Int32 i, Int32 j, Int32 k) override
 Index (i,j,k) of the part.
void applyMeshPartitioning (IMesh *mesh) override
 Applies the repartitioning to the mesh mesh.
Public Member Functions inherited from Arcane::BasicService
 ~BasicService () override
 Releases resources.
virtual ISubDomainsubDomain ()
Public Member Functions inherited from Arcane::AbstractService
 ~AbstractService () override
 Destructor.
IServiceInfoserviceInfo () const override
 Access to service information. See IServiceInfo for details.
IBaseserviceParent () const override
 Access to the base interface of main Arcane objects.
IServiceserviceInterface () override
 Returns the low-level IService interface of the service.
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
Public Member Functions inherited from Arcane::IService
virtual ~IService ()
 Releases resources.
Public Member Functions inherited from Arcane::MeshAccessor
 MeshAccessor (ISubDomain *sd)
 MeshAccessor (IMesh *mesh)
 MeshAccessor (const MeshHandle &mesh_handle)
Integer nbCell () const
 Returns the number of cells in the mesh.
Integer nbFace () const
 Returns the number of faces in the mesh.
Integer nbEdge () const
 Returns the number of edges in the mesh.
Integer nbNode () const
 Returns the number of nodes in the mesh.
VariableNodeReal3nodesCoordinates () const
 Returns the coordinates of the mesh nodes.
NodeGroup allNodes () const
 Returns the group containing all nodes.
EdgeGroup allEdges () const
 Returns the group containing all edges.
FaceGroup allFaces () const
 Returns the group containing all faces.
CellGroup allCells () const
 Returns the group containing all cells.
FaceGroup outerFaces () const
 Returns the group containing all boundary faces.
NodeGroup ownNodes () const
 Returns the group containing all nodes specific to this domain.
CellGroup ownCells () const
 Returns the group containing all cells specific to this domain.
FaceGroup ownFaces () const
 Group containing all faces specific to this domain.
EdgeGroup ownEdges () const
 Group containing all edges specific to this domain.
IMeshmesh () const
const MeshHandlemeshHandle () const
Public Member Functions inherited from Arcane::CommonVariables
 CommonVariables (IModule *c)
 Constructs the references of the common variables for the module c.
 CommonVariables (IVariableMng *variable_mng)
 Constructs the references of the common variables for the manager variable_mng.
 CommonVariables (ISubDomain *sd)
 Constructs the references of the common variables for the subdomain sd.
virtual ~CommonVariables ()
 Releases resources.
Int32 globalIteration () const
 Current iteration number.
Real globalTime () const
 Current time.
Real globalOldTime () const
 Previous current time.
Real globalFinalTime () const
 Final time of the simulation.
Real globalDeltaT () const
 Current Delta T.
Real globalCPUTime () const
 CPU time used (in seconds).
Real globalOldCPUTime () const
 Previous CPU time used (in seconds).
Real globalElapsedTime () const
 Clock time (elapsed) used (in seconds).
Real globalOldElapsedTime () const
 Previous clock time (elapsed) used (in seconds).
Public Member Functions inherited from Arcane::IMeshPartitionerBase
virtual ~IMeshPartitionerBase ()=default
 Releases resources.

Private Member Functions

Int32 _findPart (RealConstArrayView coords, Real center)
 Returns the index in coords of the value immediately lower than position.
void _addGhostCell (Int32 rank, Cell cell)
void _buildGridInfo ()
void _computeSpecificGhostLayer ()
void _addCellToIntersectedParts (Cell cell, std::array< Int32, 3 > min_part, std::array< Int32, 3 > nb_part)

Private Attributes

Real3 m_min_box
Real3 m_max_box
std::array< Int32, 3 > m_ijk_part
bool m_is_bounding_box_set = false
bool m_is_ijk_set = false
bool m_is_verbose = false
GhostCellsBuilderm_ghost_cells_builder = nullptr
ScopedPtrT< GridInfom_grid_info

Additional Inherited Members

Public Attributes inherited from Arcane::CommonVariables
VariableScalarInt32 m_global_iteration
 Current iteration.
VariableScalarReal m_global_time
 Current time.
VariableScalarReal m_global_deltat
 Global Delta T.
VariableScalarReal m_global_old_time
 Time previous to the current time.
VariableScalarReal m_global_old_deltat
 Delta T at the time previous to the global time.
VariableScalarReal m_global_final_time
 Final time of the case.
VariableScalarReal m_global_old_cpu_time
 Previous CPU time used (in seconds).
VariableScalarReal m_global_cpu_time
 CPU time used (in seconds).
VariableScalarReal m_global_old_elapsed_time
 Previous clock time used (in seconds).
VariableScalarReal m_global_elapsed_time
 Clock time used (in seconds).
Protected Member Functions inherited from Arcane::BasicService
 BasicService (const ServiceBuildInfo &)
Protected Member Functions inherited from Arcane::AbstractService
 AbstractService (const ServiceBuildInfo &)
 Constructor from a ServiceBuildInfo.
Protected Member Functions inherited from Arcane::TraceAccessor
void _setLocalVerboseLevel (Int32 v)
Int32 _localVerboseLevel () const
Protected Member Functions inherited from Arcane::IService
 IService ()
 Constructor.

Detailed Description

Grid mesh partitioner.

Definition at line 45 of file SimpleGridMeshPartitioner.cc.

Constructor & Destructor Documentation

◆ SimpleGridMeshPartitioner()

Arcane::SimpleGridMeshPartitioner::SimpleGridMeshPartitioner ( const ServiceBuildInfo & sbi)
explicit

Definition at line 159 of file SimpleGridMeshPartitioner.cc.

Member Function Documentation

◆ _addCellToIntersectedParts()

void Arcane::SimpleGridMeshPartitioner::_addCellToIntersectedParts ( Cell cell,
std::array< Int32, 3 > min_part,
std::array< Int32, 3 > nb_part )
private

Iterates over all parts that intersect the cell cell and sends this cell as a ghost cell.

Definition at line 352 of file SimpleGridMeshPartitioner.cc.

References Arcane::Item::owner().

Here is the call graph for this function:

◆ _addGhostCell()

void Arcane::SimpleGridMeshPartitioner::_addGhostCell ( Int32 rank,
Cell cell )
private

Definition at line 204 of file SimpleGridMeshPartitioner.cc.

◆ _buildGridInfo()

void Arcane::SimpleGridMeshPartitioner::_buildGridInfo ( )
private

Definition at line 213 of file SimpleGridMeshPartitioner.cc.

◆ _computeSpecificGhostLayer()

void Arcane::SimpleGridMeshPartitioner::_computeSpecificGhostLayer ( )
private

Definition at line 375 of file SimpleGridMeshPartitioner.cc.

◆ _findPart()

Int32 Arcane::SimpleGridMeshPartitioner::_findPart ( RealConstArrayView coords,
Real position )
private

Returns the index in coords of the value immediately lower than position.

The array coords must be sorted in ascending order. // TODO: use a dichotomy.

Definition at line 177 of file SimpleGridMeshPartitioner.cc.

References Arcane::TraceAccessor::info(), Arcane::math::isNearlyEqual(), and Arcane::ConstArrayView< T >::size().

Referenced by partitionMesh().

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

◆ applyMeshPartitioning()

void Arcane::SimpleGridMeshPartitioner::applyMeshPartitioning ( IMesh * mesh)
overridevirtual

Applies the repartitioning to the mesh mesh.

The setPartIndex() and setBoundingBox() methods must have been called previously. This method can only be called once per instance.

The partitioning uses a specific algorithm for calculating ghost cells to ensure that every cell in mesh that intersects the part specified in setBoundingBox() will be in this subdomain, possibly as a ghost cell.

Implements Arcane::IGridMeshPartitioner.

Definition at line 456 of file SimpleGridMeshPartitioner.cc.

References ARCANE_FATAL, and Arcane::PtrT< T >::get().

Here is the call graph for this function:

◆ build()

void Arcane::SimpleGridMeshPartitioner::build ( void )
inlineoverridevirtual

Build-level construction of the service.

This method is called right after the constructor.

Reimplemented from Arcane::AbstractService.

Definition at line 112 of file SimpleGridMeshPartitioner.cc.

◆ notifyEndPartition()

void Arcane::SimpleGridMeshPartitioner::notifyEndPartition ( )
inlineoverridevirtual

Notification when a re-partitioning finishes (after entity exchange).

Implements Arcane::IMeshPartitionerBase.

Definition at line 115 of file SimpleGridMeshPartitioner.cc.

◆ partitionMesh()

void Arcane::SimpleGridMeshPartitioner::partitionMesh ( bool initial_partition)
overridevirtual

Re-partitions the mesh mesh

This method changes the owners of the entities and fills the IItemFamily::itemsNewOwner() variable of each entity family of the mesh mesh with the number of the new owning subdomain.

Note
This method is reserved for Arcane developers. If a module wishes to perform a re-partitioning, it must call the method IMeshUtilities::partitionAndExchangeMeshWithReplication() which handles both the partitioning and the exchange of information and supports domain replication.

Implements Arcane::IMeshPartitionerBase.

Definition at line 289 of file SimpleGridMeshPartitioner.cc.

References _findPart(), ARCANE_FATAL, Arcane::IParallelMng::commSize(), ENUMERATE_, Arcane::IK_Cell, Arcane::TraceAccessor::info(), Arcane::ItemWithNodes::nbNode(), Arcane::ItemWithNodes::node(), Arcane::IMesh::toPrimaryMesh(), and Arcane::Item::uniqueId().

Here is the call graph for this function:

◆ primaryMesh()

IPrimaryMesh * Arcane::SimpleGridMeshPartitioner::primaryMesh ( )
inlineoverridevirtual

Associated mesh.

Implements Arcane::IMeshPartitionerBase.

Definition at line 113 of file SimpleGridMeshPartitioner.cc.

◆ setBoundingBox()

void Arcane::SimpleGridMeshPartitioner::setBoundingBox ( Real3 min_val,
Real3 max_val )
inlineoverridevirtual

Positions the bounding box of our subdomain.

For the algorithm to work, there must be no overlap between the bounding boxes of the subdomains.

Implements Arcane::IGridMeshPartitioner.

Definition at line 119 of file SimpleGridMeshPartitioner.cc.

◆ setPartIndex()

void Arcane::SimpleGridMeshPartitioner::setPartIndex ( Int32 i,
Int32 j,
Int32 k )
inlineoverridevirtual

Index (i,j,k) of the part.

The indices start at zero. In 1D or 2D, the value of k is (-1). In 1D, the value of j is (-1)

Implements Arcane::IGridMeshPartitioner.

Definition at line 126 of file SimpleGridMeshPartitioner.cc.

Member Data Documentation

◆ m_ghost_cells_builder

GhostCellsBuilder* Arcane::SimpleGridMeshPartitioner::m_ghost_cells_builder = nullptr
private

Definition at line 144 of file SimpleGridMeshPartitioner.cc.

◆ m_grid_info

ScopedPtrT<GridInfo> Arcane::SimpleGridMeshPartitioner::m_grid_info
private

Definition at line 145 of file SimpleGridMeshPartitioner.cc.

◆ m_ijk_part

std::array<Int32, 3> Arcane::SimpleGridMeshPartitioner::m_ijk_part
private

Definition at line 140 of file SimpleGridMeshPartitioner.cc.

◆ m_is_bounding_box_set

bool Arcane::SimpleGridMeshPartitioner::m_is_bounding_box_set = false
private

Definition at line 141 of file SimpleGridMeshPartitioner.cc.

◆ m_is_ijk_set

bool Arcane::SimpleGridMeshPartitioner::m_is_ijk_set = false
private

Definition at line 142 of file SimpleGridMeshPartitioner.cc.

◆ m_is_verbose

bool Arcane::SimpleGridMeshPartitioner::m_is_verbose = false
private

Definition at line 143 of file SimpleGridMeshPartitioner.cc.

◆ m_max_box

Real3 Arcane::SimpleGridMeshPartitioner::m_max_box
private

Definition at line 139 of file SimpleGridMeshPartitioner.cc.

◆ m_min_box

Real3 Arcane::SimpleGridMeshPartitioner::m_min_box
private

Definition at line 138 of file SimpleGridMeshPartitioner.cc.


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