OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
oofem::ProblemCommunicator Class Referenceabstract

Class representing communicator for engng model. More...

#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)
 Constructor. More...
 
virtual ~ProblemCommunicator ()
 Destructor. More...
 
virtual void setUpCommunicationMaps (EngngModel *emodel, bool excludeSelfCommFlag, bool forceReinit=false)=0
 Service for setting up the communication patterns with other remote process. More...
 
virtual int setProcessCommunicatorToSendArry (ProcessCommunicator *processComm, IntArray &map)=0
 Assigns given map to given process communicator. More...
 
virtual int setProcessCommunicatorToRecvArry (ProcessCommunicator *processComm, IntArray &map)=0
 Assigns given map to given process communicator. More...
 
int DofManCmp (int, int)
 Global dofManager number comparison function. More...
 
int ElemCmp (int, int)
 Global element comparison function. More...
 
- Public Member Functions inherited from oofem::Communicator
 Communicator (EngngModel *emodel, CommunicatorBuff *buff, int rank, int size, CommunicatorMode mode=CommMode_Static)
 Constructor. More...
 
virtual ~Communicator ()
 Destructor. More...
 
ProcessCommunicatorgiveProcessCommunicator (int i)
 Returns i-th problem communicator. More...
 
template<class T >
int packAllData (T *ptr, int(T::*packFunc)(ProcessCommunicator &))
 Pack all problemCommunicators data to their send buffers. More...
 
template<class T , class P >
int packAllData (T *ptr, P *src, int(T::*packFunc)(P *, ProcessCommunicator &))
 Pack all problemCommuncators data to their send buffers. More...
 
template<class T >
int unpackAllData (T *ptr, int(T::*unpackFunc)(ProcessCommunicator &))
 Unpack all problemCommuncators data from recv buffers. More...
 
template<class T , class P >
int unpackAllData (T *ptr, P *src, int(T::*unpackFunc)(P *, ProcessCommunicator &))
 Unpack all problemCommuncators data from recv buffers. More...
 
int initExchange (int tag)
 Initializes data exchange with all problems. More...
 
int initSend (int tag)
 Initializes data send exchange with all problems. More...
 
int initReceive (int tag)
 Initializes data receive exchange with all problems. More...
 
int finishExchange ()
 Finishes the exchange. More...
 
void clearBuffers ()
 Clears all buffer content. More...
 
virtual void setUpCommunicationMaps (EngngModel *pm)
 Service for setting up the communication patterns with other remote processes. More...
 
std::string errorInfo (const char *func) const
 Returns string for prepending output (used by error reporting macros). More...
 

Protected Member Functions

void sortCommMap (IntArray &map, int(ProblemCommunicator::*cmp)(int, int))
 Sorts given communication map, containing local DofManager numbers according to their corresponding global numbers. More...
 
void quickSortCommMap (IntArray &map, int l, int r, int(ProblemCommunicator::*cmp)(int, int))
 Implementation of quicksort algorithm. More...
 
int quickSortPartition (IntArray &map, int l, int r, int(ProblemCommunicator::*cmp)(int, int))
 Partitioning used in quicksort. More...
 

Protected Attributes

bool initialized
 
- Protected Attributes inherited from oofem::Communicator
int rank
 Rank of process. More...
 
int size
 Number of processes. More...
 
ProcessCommunicator ** processComms
 Array of process communicators. More...
 
EngngModelengngModel
 Engineering model. More...
 
CommunicatorMode mode
 Mode. More...
 

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

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 initialized.

oofem::ProblemCommunicator::~ProblemCommunicator ( )
virtual

Destructor.

Definition at line 56 of file problemcomm.C.

Member Function Documentation

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

Implementation of quicksort algorithm.

Definition at line 409 of file problemcomm.C.

References quickSortPartition().

Referenced by sortCommMap().

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

Partitioning used in quicksort.

Definition at line 422 of file problemcomm.C.

References oofem::IntArray::at().

Referenced by quickSortCommMap().

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.

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.

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.

Referenced by oofem::DirectErrorIndicatorRC::estimateMeshDensities(), oofem::EngngModel::initializeCommMaps(), and oofem::StaticStructural::solveYourself().

void oofem::ProblemCommunicator::sortCommMap ( IntArray map,
int(ProblemCommunicator::*)(int, int)  cmp 
)
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 402 of file problemcomm.C.

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

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

Member Data Documentation

bool oofem::ProblemCommunicator::initialized
protected

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

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:39 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011