OOFEM 3.0
Loading...
Searching...
No Matches
oofem::ProblemCommunicator Class Referenceabstract

#include <problemcomm.h>

Inheritance diagram for oofem::ProblemCommunicator:
Collaboration diagram for oofem::ProblemCommunicator:

Public Member Functions

 ProblemCommunicator (EngngModel *emodel, CommunicatorBuff *b, int rank, int size)
virtual ~ProblemCommunicator ()
 Destructor.
virtual void setUpCommunicationMaps (EngngModel *emodel, bool excludeSelfCommFlag, bool forceReinit=false)=0
virtual int setProcessCommunicatorToSendArry (ProcessCommunicator *processComm, IntArray &map)=0
virtual int setProcessCommunicatorToRecvArry (ProcessCommunicator *processComm, IntArray &map)=0
int DofManCmp (int, int)
 Global dofManager number comparison function.
int ElemCmp (int, int)
 Global element comparison function.
Public Member Functions inherited from oofem::Communicator
 Communicator (EngngModel *emodel, CommunicatorBuff *buff, int rank, int size, CommunicatorMode mode=CommMode_Static)
virtual ~Communicator ()
 Destructor.
ProcessCommunicatorgiveProcessCommunicator (int i)
template<class T>
int packAllData (T *ptr, int(T ::*packFunc)(ProcessCommunicator &))
template<class T, class P>
int packAllData (T *ptr, P *src, int(T ::*packFunc)(P *, ProcessCommunicator &))
template<class T>
int unpackAllData (T *ptr, int(T ::*unpackFunc)(ProcessCommunicator &))
template<class T, class P>
int unpackAllData (T *ptr, P *src, int(T ::*unpackFunc)(P *, ProcessCommunicator &))
int initExchange (int tag)
int initSend (int tag)
int initReceive (int tag)
int finishExchange ()
void clearBuffers ()
virtual void setUpCommunicationMaps (EngngModel *pm)
std::string errorInfo (const char *func) const
 Returns string for prepending output (used by error reporting macros).

Protected Member Functions

void sortCommMap (IntArray &map, int(ProblemCommunicator ::*cmp)(int, int))
void quickSortCommMap (IntArray &map, int l, int r, int(ProblemCommunicator ::*cmp)(int, int))
 Implementation of quicksort algorithm.
int quickSortPartition (IntArray &map, int l, int r, int(ProblemCommunicator ::*cmp)(int, int))
 Partitioning used in quicksort.

Protected Attributes

bool initialized
Protected Attributes inherited from oofem::Communicator
int rank
 Rank of process.
std::vector< ProcessCommunicatorprocessComms
 Array of process communicators.
EngngModelengngModel
 Engineering model.
CommunicatorMode mode
 Mode.

Detailed Description

Class representing communicator for engng model. It is assumed to be an attribute of an engineering model. The communicator provides all services for communication with associated remote partitions. It manages several process communicators.

Definition at line 50 of file problemcomm.h.

Constructor & Destructor Documentation

◆ ProblemCommunicator()

oofem::ProblemCommunicator::ProblemCommunicator ( EngngModel * emodel,
CommunicatorBuff * b,
int rank,
int size )

Constructor.

Parameters
emodelAssociated engineering model.
bBuffer object.
rankRank of associated partition.
sizeNumber of collaborating processes.

Definition at line 49 of file problemcomm.C.

References oofem::Communicator::Communicator(), initialized, and oofem::Communicator::rank.

Referenced by oofem::ElementCommunicator::ElementCommunicator(), oofem::NodeCommunicator::NodeCommunicator(), quickSortCommMap(), quickSortPartition(), setProcessCommunicatorToRecvArry(), and sortCommMap().

◆ ~ProblemCommunicator()

oofem::ProblemCommunicator::~ProblemCommunicator ( )
virtual

Destructor.

Definition at line 56 of file problemcomm.C.

Member Function Documentation

◆ DofManCmp()

int oofem::ProblemCommunicator::DofManCmp ( int i,
int j )

Global dofManager number comparison function.

Definition at line 452 of file problemcomm.C.

References oofem::Communicator::engngModel.

Referenced by setProcessCommunicatorToRecvArry().

◆ ElemCmp()

int oofem::ProblemCommunicator::ElemCmp ( int i,
int j )

Global element comparison function.

Definition at line 458 of file problemcomm.C.

References oofem::Communicator::engngModel.

Referenced by setProcessCommunicatorToRecvArry().

◆ quickSortCommMap()

void oofem::ProblemCommunicator::quickSortCommMap ( IntArray & map,
int l,
int r,
int(ProblemCommunicator ::* cmp )(int, int) )
protected

Implementation of quicksort algorithm.

Definition at line 410 of file problemcomm.C.

References ProblemCommunicator(), quickSortCommMap(), and oofem::quickSortPartition().

Referenced by quickSortCommMap(), setProcessCommunicatorToRecvArry(), and sortCommMap().

◆ quickSortPartition()

int oofem::ProblemCommunicator::quickSortPartition ( IntArray & map,
int l,
int r,
int(ProblemCommunicator ::* cmp )(int, int) )
protected

Partitioning used in quicksort.

Definition at line 423 of file problemcomm.C.

References oofem::IntArray::at(), and ProblemCommunicator().

Referenced by setProcessCommunicatorToRecvArry().

◆ setProcessCommunicatorToRecvArry()

virtual int oofem::ProblemCommunicator::setProcessCommunicatorToRecvArry ( ProcessCommunicator * processComm,
IntArray & map )
pure virtual

Assigns given map to given process communicator. Sorts map according to global entity (dofmanagers or element) numbers to ensure, that local and corresponding remote process have the identical map with same ordering. This will ensure proper packing/unpacking order. The corresponding processCommunicator buffer takes care about resizing itself accordingly to hold all outgoing/incoming data using engngModel->estimateMaxPackSize service.

Parameters
processCommProcess comm which received map will be set.
mapReceived map.

Implemented in oofem::ElementCommunicator, and oofem::NodeCommunicator.

References DofManCmp(), ElemCmp(), ProblemCommunicator(), quickSortCommMap(), quickSortPartition(), and sortCommMap().

◆ setProcessCommunicatorToSendArry()

virtual int oofem::ProblemCommunicator::setProcessCommunicatorToSendArry ( ProcessCommunicator * processComm,
IntArray & map )
pure virtual

Assigns given map to given process communicator. Sorts map according to global entity (dofmanagers or element) numbers to ensure, that local and corresponding remote process have the identical map with same ordering. This will ensure proper packing/unpacking order. The corresponding processCommunicator buffer takes care about resizing itself accordingly to hold all outgoing/incoming data using engngModel->estimateMaxPackSize service.

Parameters
processCommDomain comm which send map will be set.
mapSend map.

Implemented in oofem::ElementCommunicator, and oofem::NodeCommunicator.

◆ setUpCommunicationMaps()

virtual void oofem::ProblemCommunicator::setUpCommunicationMaps ( EngngModel * emodel,
bool excludeSelfCommFlag,
bool forceReinit = false )
pure virtual

Service for setting up the communication patterns with other remote process. Sets up the toSend and toRecv attributes in associated process communicators.

Parameters
emodelAssociated engineering model.
excludeSelfCommFlagIf set to true, the communication map of receiver with itself will be forced to be empty, otherwise it will be assembled.
forceReinitForces reinitilaization.

Implemented in oofem::ElementCommunicator, and oofem::NodeCommunicator.

◆ sortCommMap()

void oofem::ProblemCommunicator::sortCommMap ( IntArray & map,
int(ProblemCommunicator ::* cmp )(int, int) )
protected

Sorts given communication map, containing local DofManager numbers according to their corresponding global numbers. It could not be sorted by standard techniques, because it is necessary to ask DofMAnager form domain and determine its global Number.

Parameters
mapMap to sort.
cmpComparison function must return a negative value if first argument is less than the second, zero if the arguments are equal, and a positive number otherwise.

Definition at line 403 of file problemcomm.C.

References oofem::IntArray::giveSize(), ProblemCommunicator(), and quickSortCommMap().

Referenced by oofem::ElementCommunicator::setProcessCommunicatorToRecvArry(), oofem::NodeCommunicator::setProcessCommunicatorToRecvArry(), setProcessCommunicatorToRecvArry(), oofem::ElementCommunicator::setProcessCommunicatorToSendArry(), and oofem::NodeCommunicator::setProcessCommunicatorToSendArry().

Member Data Documentation

◆ initialized

bool oofem::ProblemCommunicator::initialized
protected

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

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011