Simpatico  v1.10
List of all members | Public Types | Public Member Functions
DdMd::Exchanger Class Reference

Detailed Description

Class for exchanging Atoms, Ghosts and Groups between processors.

Definition at line 35 of file Exchanger.h.

#include <Exchanger.h>

Public Types

Public Member Functions

 Exchanger ()
 Constructor. More...
 
 ~Exchanger ()
 Destructor. More...
 
void associate (const Domain &domain, const Boundary &boundary, AtomStorage &atomStorage, Buffer &buffer)
 Set pointers to associated objects. More...
 
void addGroupExchanger (GroupExchanger &groupExchanger)
 Add a GroupExchanger to an internal list. More...
 
void allocate ()
 Allocate all required memory. More...
 
void setPairCutoff (double pairCutoff)
 Set width of slab for ghosts. More...
 
void exchange ()
 Exchange local atoms and ghosts. More...
 
void update ()
 Update ghost atom coordinates. More...
 
void reverseUpdate ()
 Update ghost atom forces. More...
 
void outputStatistics (std::ostream &out, double time, int nStep)
 Output statistics. More...
 
DdTimertimer ()
 Return internal timer by reference. More...
 

Member Enumeration Documentation

Enumeration of time stamp identifiers.

Definition at line 128 of file Exchanger.h.

Constructor & Destructor Documentation

DdMd::Exchanger::Exchanger ( )

Constructor.

Definition at line 34 of file Exchanger.cpp.

DdMd::Exchanger::~Exchanger ( )

Destructor.

Definition at line 53 of file Exchanger.cpp.

Member Function Documentation

void DdMd::Exchanger::associate ( const Domain domain,
const Boundary boundary,
AtomStorage atomStorage,
Buffer buffer 
)

Set pointers to associated objects.

Parameters
domainassociated Domain object
boundaryassociated Boundary object
atomStorageassociated AtomStorage object
bufferassociated Buffer object

Definition at line 59 of file Exchanger.cpp.

void DdMd::Exchanger::addGroupExchanger ( GroupExchanger groupExchanger)

Add a GroupExchanger to an internal list.

Parameters
groupExchangerGroupExchanger object to add to list.

Definition at line 71 of file Exchanger.cpp.

void DdMd::Exchanger::allocate ( )

Allocate all required memory.

Must be called after Buffer is initialized.

Definition at line 77 of file Exchanger.cpp.

References Util::Dimension, DdMd::Buffer::ghostCapacity(), DdMd::Buffer::isInitialized(), and UTIL_THROW.

void DdMd::Exchanger::setPairCutoff ( double  pairCutoff)

Set width of slab for ghosts.

Parameters
pairCutoffcutoff radius for pair list (potential + skin).

Definition at line 99 of file Exchanger.cpp.

void DdMd::Exchanger::exchange ( )

Exchange local atoms and ghosts.

This method should be called just before rebuilding the neighbor list on each processor, to exchange ownership of local atoms and to exchange ghost atoms. The lists of which atoms were sent and received as ghosts by this method are used in subsequent calls to update.

Definition at line 106 of file Exchanger.cpp.

References DdMd::AtomStorage::addNewAtom(), DdMd::AtomStorage::addNewGhost(), DdMd::AtomStorage::begin(), DdMd::Buffer::beginRecvBlock(), DdMd::Buffer::beginSendBlock(), DdMd::Plan::clearFlags(), DdMd::Plan::clearGhost(), DdMd::AtomStorage::clearGhosts(), DdMd::Buffer::clearSendBuffer(), DdMd::Domain::communicator(), DdMd::AtomStorage::computeNAtomTotal(), DdMd::Atom::copyLocalGhost(), DdMd::Domain::destRank(), Util::Dimension, Util::Grid::dimension(), DdMd::Domain::domainBound(), DdMd::Buffer::endRecvBlock(), DdMd::Buffer::endSendBlock(), DdMd::Plan::exchange(), DdMd::Plan::flags(), DdMd::Plan::ghost(), DdMd::Domain::grid(), DdMd::Domain::gridRank(), DdMd::Domain::hasBoundary(), DdMd::Atom::id(), DdMd::AtomStorage::isCartesian(), DdMd::Domain::isInitialized(), DdMd::Buffer::isInitialized(), DdMd::AtomStorage::isValid(), Simp::OrthorhombicBoundary::lengths(), DdMd::AtomStorage::nAtomTotal(), DdMd::AtomStorage::newAtomPtr(), DdMd::AtomStorage::newGhostPtr(), DdMd::AtomStorage::nGhost(), Util::PArrayIterator< Data >::notEnd(), DdMd::Atom::packGhost(), DdMd::Atom::plan(), DdMd::Atom::position(), DdMd::Buffer::recvSize(), DdMd::AtomStorage::removeAtom(), DdMd::Buffer::sendRecv(), DdMd::Plan::setExchange(), DdMd::Plan::setFlags(), DdMd::Plan::setGhost(), DdMd::Atom::setId(), DdMd::Atom::setTypeId(), DdMd::Domain::shift(), DdMd::Domain::sourceRank(), DdMd::Atom::typeId(), DdMd::Atom::unpackAtom(), DdMd::Atom::unpackGhost(), and UTIL_THROW.

Referenced by DdMd::TwoStepIntegrator::run(), and DdMd::Integrator::setupAtoms().

void DdMd::Exchanger::update ( )

Update ghost atom coordinates.

This method should be called every time step for which there is no exhange of atom ownership. It communicates ghost coordinates for the same ghosts as those sent by the most recent call to the exchangeGhosts() methods.

Definition at line 821 of file Exchanger.cpp.

References Simp::OrthorhombicBoundary::applyShift(), DdMd::Buffer::beginRecvBlock(), DdMd::Buffer::beginSendBlock(), DdMd::Buffer::clearSendBuffer(), DdMd::Domain::communicator(), DdMd::Atom::copyLocalUpdate(), DdMd::Domain::destRank(), Util::Dimension, DdMd::Buffer::endRecvBlock(), DdMd::Buffer::endSendBlock(), DdMd::AtomStorage::isCartesian(), DdMd::Atom::packUpdate(), DdMd::Atom::position(), DdMd::Buffer::sendRecv(), DdMd::Domain::shift(), DdMd::Domain::sourceRank(), DdMd::Atom::unpackUpdate(), and UTIL_THROW.

Referenced by DdMd::TwoStepIntegrator::run().

void DdMd::Exchanger::reverseUpdate ( )

Update ghost atom forces.

This method reverse the communication pattern used to communicate ghost atom positions in update() to reverse communicate forces acting on ghost atoms. It should be called only if reverse force communication is enabled, in which case it should be called after all force calculation on every time step for which update() is called.

Definition at line 902 of file Exchanger.cpp.

References DdMd::Buffer::beginRecvBlock(), DdMd::Buffer::beginSendBlock(), DdMd::Buffer::clearSendBuffer(), DdMd::Domain::communicator(), DdMd::Domain::destRank(), Util::Dimension, DdMd::Buffer::endRecvBlock(), DdMd::Buffer::endSendBlock(), DdMd::Atom::force(), DdMd::Atom::packForce(), DdMd::Buffer::sendRecv(), DdMd::Domain::sourceRank(), and DdMd::Atom::unpackForce().

Referenced by DdMd::Integrator::computeForces(), and DdMd::Integrator::computeForcesAndVirial().

void DdMd::Exchanger::outputStatistics ( std::ostream &  out,
double  time,
int  nStep 
)
DdTimer & DdMd::Exchanger::timer ( )
inline

Return internal timer by reference.

Definition at line 234 of file Exchanger.h.

References DdMd::DdTimer::stamp().

Referenced by DdMd::Integrator::clear(), and DdMd::TwoStepIntegrator::run().


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