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

Information for a mesh exchange between sub-domains. More...

#include <arcane/mesh/MeshExchanger.h>

Inheritance diagram for Arcane::mesh::MeshExchanger:
Collaboration diagram for Arcane::mesh::MeshExchanger:

Public Member Functions

 MeshExchanger (IMesh *mesh, ITimeStats *stats)
bool computeExchangeInfos () override
 Calculates the information to send/receive from other subdomains.
void processExchange () override
 Performs the exchange of information between subdomains.
void removeNeededItems () override
 Deletes from this subdomain the entities that should no longer be there following the exchange.
void allocateReceivedItems () override
 Allocates the entities received from other subdomains.
void updateItemGroups () override
 Update of entity groups.
void updateVariables () override
 Update of variables.
void finalizeExchange () override
 Finalizes the exchanges.
IPrimaryMeshmesh () const override
 Mesh associated with this exchanger.
void build ()
IItemFamilyExchangerfindExchanger (IItemFamily *family) override
 Exchanger associated with the family. Throws an exception if not found.
ePhase phase () const override
 Phase of the exchange we are currently in.
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

Protected Member Functions

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

Private Types

typedef std::map< IItemFamily *, IItemFamilyExchanger * > ItemFamilyExchangerMap

Private Member Functions

void _checkPhase (ePhase wanted_phase)
void _buildWithItemFamilyNetwork ()
void _addItemFamilyExchanger (IItemFamily *family)

Private Attributes

IMeshm_mesh
List< IItemFamilyExchanger * > m_family_exchangers
ItemFamilyExchangerMap m_family_exchanger_map
ITimeStatsm_time_stats
ePhase m_phase
ParallelExchangerOptions m_exchanger_option

Additional Inherited Members

Public Types inherited from Arcane::IMeshExchanger
enum class  ePhase {
  Init = 0 , ComputeInfos , ProcessExchange , RemoveItems ,
  AllocateItems , UpdateItemGroups , UpdateVariables , Finalize ,
  Ended
}
 Indicates the different phases of the exchange. More...

Detailed Description

Information for a mesh exchange between sub-domains.

Definition at line 41 of file MeshExchanger.h.

Member Typedef Documentation

◆ ItemFamilyExchangerMap

typedef std::map<IItemFamily*, IItemFamilyExchanger*> Arcane::mesh::MeshExchanger::ItemFamilyExchangerMap
private

Definition at line 47 of file MeshExchanger.h.

Constructor & Destructor Documentation

◆ MeshExchanger()

Arcane::mesh::MeshExchanger::MeshExchanger ( IMesh * mesh,
ITimeStats * stats )

Definition at line 41 of file MeshExchanger.cc.

◆ ~MeshExchanger()

Arcane::mesh::MeshExchanger::~MeshExchanger ( )

Definition at line 67 of file MeshExchanger.cc.

Member Function Documentation

◆ _addItemFamilyExchanger()

void Arcane::mesh::MeshExchanger::_addItemFamilyExchanger ( IItemFamily * family)
private

Definition at line 178 of file MeshExchanger.cc.

◆ _buildWithItemFamilyNetwork()

void Arcane::mesh::MeshExchanger::_buildWithItemFamilyNetwork ( )
private

Definition at line 160 of file MeshExchanger.cc.

◆ _checkPhase()

void Arcane::mesh::MeshExchanger::_checkPhase ( ePhase wanted_phase)
private

Definition at line 190 of file MeshExchanger.cc.

◆ _setNextPhase()

void Arcane::mesh::MeshExchanger::_setNextPhase ( ePhase next_phase)
protected

Definition at line 457 of file MeshExchanger.cc.

◆ allocateReceivedItems()

void Arcane::mesh::MeshExchanger::allocateReceivedItems ( )
overridevirtual

Allocates the entities received from other subdomains.

This operation is collective.

Precondition
phase()==ePhase::AllocateItems
Postcondition
phase()==ePhase::UpdateItemGroups

Implements Arcane::IMeshExchanger.

Definition at line 335 of file MeshExchanger.cc.

References Arcane::platform::getCurrentDateTime(), and Arcane::TraceAccessor::info().

Here is the call graph for this function:

◆ build()

void Arcane::mesh::MeshExchanger::build ( )

Definition at line 80 of file MeshExchanger.cc.

◆ computeExchangeInfos()

bool Arcane::mesh::MeshExchanger::computeExchangeInfos ( )
overridevirtual

Calculates the information to send/receive from other subdomains.

This operation is collective.

The calculation of information to send is done by knowing the new owner of each entity. This information is stored in the IItemFamily::itemsNewOwner() variable. For example, a cell will be migrated if the new owner is different from the current owner (which is given by Item::owner()).

After calling this method, each mesh entity is modified as follows:

  • the Item::owner() field indicates the new owner.
  • the entities that will be deleted after the exchange are marked by the flag ItemFlags::II_NeedRemove (except for now for particles without the concept of ghosts, but this is temporary).

Returns true if there is no exchange to perform.

Precondition
phase()==ePhase::ComputeInfos
Postcondition
phase()==ePhase::ProcessExchange

Implements Arcane::IMeshExchanger.

Definition at line 201 of file MeshExchanger.cc.

References Arcane::IItemFamily::allItems(), Arcane::IItemFamilyExchanger::computeExchangeInfos(), Arcane::mesh::MeshExchange::computeInfos(), ENUMERATE_ITEM, findExchanger(), Arcane::platform::getCurrentDateTime(), Arcane::IParticleFamily::getEnableGhostItems(), Arcane::mesh::MeshExchange::getItemsToSend(), Arcane::TraceAccessor::info(), Arcane::IItemFamily::itemsNewOwner(), Arcane::Item::mutableItemBase(), Arcane::IItemFamily::name(), Arcane::IItemFamily::notifyItemsOwnerChanged(), Arcane::TraceAccessor::pwarning(), Arcane::IItemFamilyExchanger::setExchangeItems(), Arcane::MutableItemBase::setOwner(), and Arcane::IItemFamily::toParticleFamily().

Here is the call graph for this function:

◆ finalizeExchange()

void Arcane::mesh::MeshExchanger::finalizeExchange ( )
overridevirtual

Finalizes the exchanges.

This operation is collective.

This method performs the last necessary operations during the exchange.

Precondition
phase()==ePhase::Finalize
Postcondition
phase()==ePhase::Ended

Implements Arcane::IMeshExchanger.

Definition at line 415 of file MeshExchanger.cc.

◆ findExchanger()

IItemFamilyExchanger * Arcane::mesh::MeshExchanger::findExchanger ( IItemFamily * family)
overridevirtual

Exchanger associated with the family. Throws an exception if not found.

Implements Arcane::IMeshExchanger.

Definition at line 436 of file MeshExchanger.cc.

References ARCANE_FATAL, and Arcane::IItemFamily::name().

Referenced by computeExchangeInfos().

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

◆ mesh()

IPrimaryMesh * Arcane::mesh::MeshExchanger::mesh ( ) const
overridevirtual

Mesh associated with this exchanger.

Implements Arcane::IMeshExchanger.

Definition at line 448 of file MeshExchanger.cc.

References Arcane::IMesh::toPrimaryMesh().

Here is the call graph for this function:

◆ phase()

ePhase Arcane::mesh::MeshExchanger::phase ( ) const
inlineoverridevirtual

Phase of the exchange we are currently in.

Implements Arcane::IMeshExchanger.

Definition at line 66 of file MeshExchanger.h.

◆ processExchange()

void Arcane::mesh::MeshExchanger::processExchange ( )
overridevirtual

Performs the exchange of information between subdomains.

This operation is collective.

This operation makes no modification to the mesh. It simply sends and receives the necessary information for mesh update.

Precondition
phase()==ePhase::ProcessExchange
Postcondition
phase()==ePhase::RemoveItems

Implements Arcane::IMeshExchanger.

Definition at line 280 of file MeshExchanger.cc.

References Arcane::platform::getCurrentDateTime(), Arcane::platform::getMemoryUsed(), and Arcane::TraceAccessor::info().

Here is the call graph for this function:

◆ removeNeededItems()

void Arcane::mesh::MeshExchanger::removeNeededItems ( )
overridevirtual

Deletes from this subdomain the entities that should no longer be there following the exchange.

All entities marked with the ItemFlags::II_NeedRemove flag are deleted.

Precondition
phase()==ePhase::RemoveItems
Postcondition
phase()==ePhase::AllocateItems

Implements Arcane::IMeshExchanger.

Definition at line 302 of file MeshExchanger.cc.

References Arcane::platform::getCurrentDateTime(), Arcane::IParticleFamily::getEnableGhostItems(), Arcane::TraceAccessor::info(), Arcane::IParticleFamily::itemFamily(), and Arcane::IItemFamily::toParticleFamily().

Here is the call graph for this function:

◆ updateItemGroups()

void Arcane::mesh::MeshExchanger::updateItemGroups ( )
overridevirtual

Update of entity groups.

This operation is collective.

Precondition
phase()==ePhase::UpdateItemGroups
Postcondition
phase()==ePhase::UpdateVariables

Implements Arcane::IMeshExchanger.

Definition at line 381 of file MeshExchanger.cc.

References Arcane::platform::getCurrentDateTime(), and Arcane::TraceAccessor::info().

Here is the call graph for this function:

◆ updateVariables()

void Arcane::mesh::MeshExchanger::updateVariables ( )
overridevirtual

Update of variables.

This operation is collective.

Precondition
phase()==ePhase::UpdateVariables
Postcondition
phase()==ePhase::Finalize

Implements Arcane::IMeshExchanger.

Definition at line 397 of file MeshExchanger.cc.

References Arcane::platform::getCurrentDateTime(), and Arcane::TraceAccessor::info().

Here is the call graph for this function:

Member Data Documentation

◆ m_exchanger_option

ParallelExchangerOptions Arcane::mesh::MeshExchanger::m_exchanger_option
private

Definition at line 79 of file MeshExchanger.h.

◆ m_family_exchanger_map

ItemFamilyExchangerMap Arcane::mesh::MeshExchanger::m_family_exchanger_map
private

Definition at line 76 of file MeshExchanger.h.

◆ m_family_exchangers

List<IItemFamilyExchanger*> Arcane::mesh::MeshExchanger::m_family_exchangers
private

Definition at line 75 of file MeshExchanger.h.

◆ m_mesh

IMesh* Arcane::mesh::MeshExchanger::m_mesh
private

Definition at line 74 of file MeshExchanger.h.

◆ m_phase

ePhase Arcane::mesh::MeshExchanger::m_phase
private

Definition at line 78 of file MeshExchanger.h.

◆ m_time_stats

ITimeStats* Arcane::mesh::MeshExchanger::m_time_stats
private

Definition at line 77 of file MeshExchanger.h.


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