Simpatico  v1.10
List of all members | Public Member Functions
DdMd::GroupStorage< N > Class Template Reference

Detailed Description

template<int N>
class DdMd::GroupStorage< N >

A container for all the Group<N> objects on this processor.

Definition at line 21 of file GroupCollector.h.

#include <GroupStorage.h>

Inheritance diagram for DdMd::GroupStorage< N >:
Util::ParamComposite DdMd::GroupExchanger Util::ParamComponent Util::Serializable Util::MpiFileIo

Public Member Functions

 GroupStorage ()
 Default constructor. More...
 
 ~GroupStorage ()
 Destructor. More...
 
Initialization
void associate (Domain &domain, AtomStorage &atomStorage, Buffer &buffer)
 Create associations for distributor and collector members. More...
 
void initialize (int capacity, int totalCapacity)
 Set parameters, allocate memory and initialize. More...
 
virtual void readParameters (std::istream &in)
 Read parameters, allocate memory and initialize. More...
 
virtual void loadParameters (Serializable::IArchive &ar)
 Load internal state from an archive. More...
 
virtual void save (Serializable::OArchive &ar)
 Save internal state to an archive. More...
 
Group Management
Group< N > * newPtr ()
 Returns an address available for addition of a new Group. More...
 
void add ()
 Complete addition of a new Group. More...
 
Group< N > * add (int id)
 Add a new Group with a specified id, in a single step. More...
 
void returnPtr ()
 Reverts a transaction begun by the newPtr() function. More...
 
void remove (Group< N > *groupPtr)
 Remove a specific Group. More...
 
void clearGroups ()
 Remove all groups. More...
 
int size () const
 Return current number of groups on this processor. More...
 
int capacity () const
 Return capacity for groups on this processor. More...
 
Iteration and Search
void begin (GroupIterator< N > &iterator)
 Set iterator to beginning of the set of groups. More...
 
void begin (ConstGroupIterator< N > &iterator) const
 Set iterator to beginning of the set of groups. More...
 
Group< N > * find (int id) const
 Find local Group<N> indexed by global id. More...
 
Global Group Counting
int totalCapacity () const
 Return maximum allowed number of groups on all processors. More...
 
void computeNTotal (MPI::Intracomm &communicator)
 Compute and store the number of distinct groups on all processors. More...
 
int nTotal () const
 Return total number of distinct groups on all processors. More...
 
void unsetNTotal ()
 Mark nTotal as unknown. More...
 
GroupExchanger Interface (Interprocessor Communication)
virtual void markSpanningGroups (FMatrix< double, Dimension, 2 > &bound, FMatrix< double, Dimension, 2 > &inner, FMatrix< double, Dimension, 2 > &outer, IntVector &gridFlags)
 Find and mark groups that span boundaries. More...
 
virtual void pack (int i, int j, Buffer &buffer)
 Pack groups for exchange. More...
 
virtual void unpack (Buffer &buffer, AtomStorage &atomStorage)
 Unpack groups from buffer and locate available atoms. More...
 
virtual void markGhosts (AtomStorage &atomStorage, FMatrix< GPArray< Atom >, Dimension, 2 > &sendArray, IntVector &gridFlags)
 Set ghost communication flags for all atoms in incomplete groups. More...
 
virtual void findGhosts (AtomStorage &atomStorage)
 Find all ghost members of groups. More...
 
virtual bool isValid (AtomStorage &atomStorage, MPI::Intracomm &communicator, bool hasGhosts)
 Return true if the container is valid, or throw an Exception. More...
 
Statistics
virtual void computeStatistics (MPI::Intracomm &communicator)
 Compute statistics (reduce from all processors). More...
 
void clearStatistics ()
 Clear statistical accumulators (call on all processors). More...
 
void outputStatistics (std::ostream &out)
 Output statistics. More...
 
int maxNGroup () const
 Get the maximum number of primary atoms encountered thus far. More...
 
Miscellaneous Accessors
GroupDistributor< N > & distributor ()
 Get the GroupDistributor by reference. More...
 
GroupCollector< N > & collector ()
 Get the GroupCollector by reference. More...
 
bool isValid ()
 Return true if the container is valid, or throw an Exception. More...
 
- Public Member Functions inherited from Util::ParamComposite
 ParamComposite ()
 Constructor. More...
 
 ParamComposite (const ParamComposite &other)
 Copy constructor. More...
 
 ParamComposite (int capacity)
 Constructor. More...
 
virtual ~ParamComposite ()
 Virtual destructor. More...
 
void resetParam ()
 Resets ParamComposite to its empty state. More...
 
virtual void readParam (std::istream &in)
 Read the parameter file block. More...
 
virtual void readParamOptional (std::istream &in)
 Read optional parameter file block. More...
 
virtual void writeParam (std::ostream &out)
 Write all parameters to an output stream. More...
 
virtual void load (Serializable::IArchive &ar)
 Load all parameters from an input archive. More...
 
virtual void loadOptional (Serializable::IArchive &ar)
 Load an optional ParamComposite. More...
 
void saveOptional (Serializable::OArchive &ar)
 Saves isActive flag, and then calls save() iff isActive is true. More...
 
void readParamComposite (std::istream &in, ParamComposite &child, bool next=true)
 Add and read a required child ParamComposite. More...
 
void readParamCompositeOptional (std::istream &in, ParamComposite &child, bool next=true)
 Add and attempt to read an optional child ParamComposite. More...
 
template<typename Type >
ScalarParam< Type > & read (std::istream &in, const char *label, Type &value)
 Add and read a new required ScalarParam < Type > object. More...
 
template<typename Type >
ScalarParam< Type > & readOptional (std::istream &in, const char *label, Type &value)
 Add and read a new optional ScalarParam < Type > object. More...
 
template<typename Type >
CArrayParam< Type > & readCArray (std::istream &in, const char *label, Type *value, int n)
 Add and read a required C array parameter. More...
 
template<typename Type >
CArrayParam< Type > & readOptionalCArray (std::istream &in, const char *label, Type *value, int n)
 Add and read an optional C array parameter. More...
 
template<typename Type >
DArrayParam< Type > & readDArray (std::istream &in, const char *label, DArray< Type > &array, int n)
 Add and read a required DArray < Type > parameter. More...
 
template<typename Type >
DArrayParam< Type > & readOptionalDArray (std::istream &in, const char *label, DArray< Type > &array, int n)
 Add and read an optional DArray < Type > parameter. More...
 
template<typename Type , int N>
FArrayParam< Type, N > & readFArray (std::istream &in, const char *label, FArray< Type, N > &array)
 Add and read a required FArray < Type, N > array parameter. More...
 
template<typename Type , int N>
FArrayParam< Type, N > & readOptionalFArray (std::istream &in, const char *label, FArray< Type, N > &array)
 Add and read an optional FArray < Type, N > array parameter. More...
 
template<typename Type >
CArray2DParam< Type > & readCArray2D (std::istream &in, const char *label, Type *value, int m, int n, int np)
 Add and read a required CArray2DParam < Type > 2D C-array. More...
 
template<typename Type >
CArray2DParam< Type > & readOptionalCArray2D (std::istream &in, const char *label, Type *value, int m, int n, int np)
 Add and read an optional CArray2DParam < Type > 2D C-array parameter. More...
 
template<typename Type >
DMatrixParam< Type > & readDMatrix (std::istream &in, const char *label, DMatrix< Type > &matrix, int m, int n)
 Add and read a required DMatrix < Type > matrix parameter. More...
 
template<typename Type >
DMatrixParam< Type > & readOptionalDMatrix (std::istream &in, const char *label, DMatrix< Type > &matrix, int m, int n)
 Add and read an optional DMatrix < Type > matrix parameter. More...
 
template<typename Type >
DSymmMatrixParam< Type > & readDSymmMatrix (std::istream &in, const char *label, DMatrix< Type > &matrix, int n)
 Add and read a required symmetrix DMatrix. More...
 
template<typename Type >
DSymmMatrixParam< Type > & readOptionalDSymmMatrix (std::istream &in, const char *label, DMatrix< Type > &matrix, int n)
 Add and read an optional DMatrix matrix parameter. More...
 
BeginreadBegin (std::istream &in, const char *label, bool isRequired=true)
 Add and read a class label and opening bracket. More...
 
EndreadEnd (std::istream &in)
 Add and read the closing bracket. More...
 
BlankreadBlank (std::istream &in)
 Add and read a new Blank object, representing a blank line. More...
 
void loadParamComposite (Serializable::IArchive &ar, ParamComposite &child, bool next=true)
 Add and load a required child ParamComposite. More...
 
void loadParamCompositeOptional (Serializable::IArchive &ar, ParamComposite &child, bool next=true)
 Add and load an optional child ParamComposite if isActive. More...
 
template<typename Type >
ScalarParam< Type > & loadParameter (Serializable::IArchive &ar, const char *label, Type &value, bool isRequired)
 Add and load a new ScalarParam < Type > object. More...
 
template<typename Type >
ScalarParam< Type > & loadParameter (Serializable::IArchive &ar, const char *label, Type &value)
 Add and load new required ScalarParam < Type > object. More...
 
template<typename Type >
CArrayParam< Type > & loadCArray (Serializable::IArchive &ar, const char *label, Type *value, int n, bool isRequired)
 Add a C array parameter and load its elements. More...
 
template<typename Type >
CArrayParam< Type > & loadCArray (Serializable::IArchive &ar, const char *label, Type *value, int n)
 Add and load a required CArrayParam< Type > array parameter. More...
 
template<typename Type >
DArrayParam< Type > & loadDArray (Serializable::IArchive &ar, const char *label, DArray< Type > &array, int n, bool isRequired)
 Add an load a DArray < Type > array parameter. More...
 
template<typename Type >
DArrayParam< Type > & loadDArray (Serializable::IArchive &ar, const char *label, DArray< Type > &array, int n)
 Add and load a required DArray< Type > array parameter. More...
 
template<typename Type , int N>
FArrayParam< Type, N > & loadFArray (Serializable::IArchive &ar, const char *label, FArray< Type, N > &array, bool isRequired)
 Add and load an FArray < Type, N > fixed-size array parameter. More...
 
template<typename Type , int N>
FArrayParam< Type, N > & loadFArray (Serializable::IArchive &ar, const char *label, FArray< Type, N > &array)
 Add and load a required FArray < Type > array parameter. More...
 
template<typename Type >
CArray2DParam< Type > & loadCArray2D (Serializable::IArchive &ar, const char *label, Type *value, int m, int n, int np, bool isRequired)
 Add and load a CArray2DParam < Type > C 2D array parameter. More...
 
template<typename Type >
CArray2DParam< Type > & loadCArray2D (Serializable::IArchive &ar, const char *label, Type *value, int m, int n, int np)
 Add and load a required < Type > matrix parameter. More...
 
template<typename Type >
DMatrixParam< Type > & loadDMatrix (Serializable::IArchive &ar, const char *label, DMatrix< Type > &matrix, int m, int n, bool isRequired)
 Add and load a DMatrixParam < Type > matrix parameter. More...
 
template<typename Type >
DMatrixParam< Type > & loadDMatrix (Serializable::IArchive &ar, const char *label, DMatrix< Type > &matrix, int m, int n)
 Add and load a required DMatrixParam < Type > matrix parameter. More...
 
template<typename Type >
DSymmMatrixParam< Type > & loadDSymmMatrix (Serializable::IArchive &ar, const char *label, DMatrix< Type > &matrix, int n, bool isRequired)
 Add and load a symmetric DSymmMatrixParam < Type > matrix parameter. More...
 
template<typename Type >
DSymmMatrixParam< Type > & loadDSymmMatrix (Serializable::IArchive &ar, const char *label, DMatrix< Type > &matrix, int n)
 Add and load a required DSymmMatrixParam < Type > matrix parameter. More...
 
void addParamComposite (ParamComposite &child, bool next=true)
 Add a child ParamComposite object to the format array. More...
 
BeginaddBegin (const char *label)
 Add a Begin object representing a class name and bracket. More...
 
EndaddEnd ()
 Add a closing bracket. More...
 
BlankaddBlank ()
 Create and add a new Blank object, representing a blank line. More...
 
std::string className () const
 Get class name string. More...
 
bool isRequired () const
 Is this ParamComposite required in the input file? More...
 
bool isActive () const
 Is this parameter active? More...
 
- Public Member Functions inherited from Util::ParamComponent
virtual ~ParamComponent ()
 Destructor. More...
 
void setIndent (const ParamComponent &parent, bool next=true)
 Set indent level. More...
 
std::string indent () const
 Return indent string for this object (string of spaces). More...
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 Serialize this ParamComponent as a string. More...
 
- Public Member Functions inherited from Util::Serializable
virtual ~Serializable ()
 Destructor. More...
 
- Public Member Functions inherited from Util::MpiFileIo
 MpiFileIo ()
 Constructor. More...
 
 MpiFileIo (const MpiFileIo &other)
 Copy constructor. More...
 
bool isIoProcessor () const
 Can this processor do file I/O ? More...
 
void setIoCommunicator (MPI::Intracomm &communicator)
 Set the communicator. More...
 
void clearCommunicator ()
 Clear (nullify) the communicator. More...
 
bool hasIoCommunicator () const
 Does this object have an associated MPI communicator? More...
 
MPI::Intracomm & ioCommunicator () const
 Get the MPI communicator by reference. More...
 
- Public Member Functions inherited from DdMd::GroupExchanger
 GroupExchanger ()
 Default constructor. More...
 
virtual ~GroupExchanger ()
 Destructor. More...
 

Additional Inherited Members

- Public Types inherited from Util::Serializable
typedef BinaryFileOArchive OArchive
 Type of output archive used by save method. More...
 
typedef BinaryFileIArchive IArchive
 Type of input archive used by load method. More...
 
- Static Public Member Functions inherited from Util::ParamComponent
static void initStatic ()
 Initialize static echo member to false. More...
 
static void setEcho (bool echo=true)
 Enable or disable echoing for all subclasses of ParamComponent. More...
 
static bool echo ()
 Get echo parameter. More...
 
- Protected Member Functions inherited from Util::ParamComposite
void setClassName (const char *className)
 Set class name string. More...
 
void setIsRequired (bool isRequired)
 Set or unset the isActive flag. More...
 
void setIsActive (bool isActive)
 Set or unset the isActive flag. More...
 
void setParent (ParamComponent &param, bool next=true)
 Set this to the parent of a child component. More...
 
void addComponent (ParamComponent &param, bool isLeaf=true)
 Add a new ParamComponent object to the format array. More...
 
template<typename Type >
ScalarParam< Type > & add (std::istream &in, const char *label, Type &value, bool isRequired=true)
 Add a new required ScalarParam < Type > object. More...
 
template<typename Type >
CArrayParam< Type > & addCArray (std::istream &in, const char *label, Type *value, int n, bool isRequired=true)
 Add (but do not read) a required C array parameter. More...
 
template<typename Type >
DArrayParam< Type > & addDArray (std::istream &in, const char *label, DArray< Type > &array, int n, bool isRequired=true)
 Add (but do not read) a DArray < Type > parameter. More...
 
template<typename Type , int N>
FArrayParam< Type, N > & addFArray (std::istream &in, const char *label, FArray< Type, N > &array, bool isRequired=true)
 Add (but do not read) a FArray < Type, N > array parameter. More...
 
template<typename Type >
CArray2DParam< Type > & addCArray2D (std::istream &in, const char *label, Type *value, int m, int n, int np, bool isRequired=true)
 Add (but do not read) a CArray2DParam < Type > 2D C-array. More...
 
template<typename Type >
DMatrixParam< Type > & addDMatrix (std::istream &in, const char *label, DMatrix< Type > &matrix, int m, int n, bool isRequired=true)
 Add and read a required DMatrix < Type > matrix parameter. More...
 
- Protected Member Functions inherited from Util::ParamComponent
 ParamComponent ()
 Constructor. More...
 
 ParamComponent (const ParamComponent &other)
 Copy constructor. More...
 

Constructor & Destructor Documentation

template<int N>
DdMd::GroupStorage< N >::GroupStorage ( )

Default constructor.

Definition at line 29 of file GroupStorage.tpp.

template<int N>
DdMd::GroupStorage< N >::~GroupStorage ( )

Destructor.

Definition at line 45 of file GroupStorage.tpp.

Member Function Documentation

template<int N>
void DdMd::GroupStorage< N >::associate ( Domain domain,
AtomStorage atomStorage,
Buffer buffer 
)

Create associations for distributor and collector members.

Parameters
domainDomain object (defines processor grid)
atomStorageAtomStorage object
bufferBuffer object (holds memory for communication)

Definition at line 52 of file GroupStorage.tpp.

template<int N>
void DdMd::GroupStorage< N >::initialize ( int  capacity,
int  totalCapacity 
)

Set parameters, allocate memory and initialize.

Call on all processors. Call either this or initialize, but not both. The initialize function is provided for unit testing.

Parameters
capacitymax number of groups owned by processor.
totalCapacitymax number of groups on all processors.

Definition at line 63 of file GroupStorage.tpp.

References DdMd::GroupStorage< N >::capacity(), and DdMd::GroupStorage< N >::totalCapacity().

template<int N>
void DdMd::GroupStorage< N >::readParameters ( std::istream &  in)
virtual

Read parameters, allocate memory and initialize.

Call on all processors. Call either this or initialize, but not both.

Parameter file format:

  • capacity [int] max number of groups owned by processor.
  • totalcapacity [int] max number of groups on all processors.
Parameters
ininput stream from which to read parameters.

Reimplemented from Util::ParamComposite.

Reimplemented in DdMd::DihedralStorage, DdMd::AngleStorage, and DdMd::BondStorage.

Definition at line 74 of file GroupStorage.tpp.

Referenced by DdMd::AngleStorage::readParameters(), DdMd::BondStorage::readParameters(), and DdMd::DihedralStorage::readParameters().

template<int N>
void DdMd::GroupStorage< N >::loadParameters ( Serializable::IArchive ar)
virtual

Load internal state from an archive.

Call on all processors.

Parameters
arinput/loading archive

Reimplemented from Util::ParamComposite.

Definition at line 85 of file GroupStorage.tpp.

References Util::MpiLoader< IArchive >::load(), and Util::Setable< T >::set().

template<int N>
void DdMd::GroupStorage< N >::save ( Serializable::OArchive ar)
virtual

Save internal state to an archive.

Call only on ioProcessor (master).

Parameters
aroutput/saving archive

Reimplemented from Util::ParamComposite.

Definition at line 100 of file GroupStorage.tpp.

References Util::Setable< T >::value().

template<int N>
Group< N > * DdMd::GroupStorage< N >::newPtr ( )

Returns an address available for addition of a new Group.

This function begins a transaction that adds a new Group<N> object by returning the address of a currently unused Group<N> object. The address of this new object is popped off the reservoir of unused objects and assigned to an internal "new" pointer (newPtr_) before the function returns. This function does not modify the object id or add the Group to the set of local Group<N> objects. It must thus be followed by either a call to add(), which completes the transaction by adding the object to the local set, or by a call to returnPtr(), which reverts the transaction and pushes the new pointer back onto the reservoir.

Returns
address available for a new group.

Definition at line 137 of file GroupStorage.tpp.

References UTIL_THROW.

Referenced by DdMd::GroupStorage< N >::add(), and DdMd::GroupStorage< N >::unpack().

template<int N>
void DdMd::GroupStorage< N >::add ( )

Complete addition of a new Group.

This function completes the transaction begun by a previous call to newPtr() by adding the new Group whose address was returned by newPtr() to the set of local groups and nullifying the new Ptr. The invoking function must assign the new group a valid, previously unused global group id before calling the add() function.

Usage:

GroupStorage<N> storage;
Group<N>* ptr = storage.newPtr();
ptr->setId(id);
storage.add();

The group id must be set before calling add(), but other properties may be set either before or after calling add().

Preconditions: 1) newPtr() must have been called since the last add(). 2) The new Group must have been a assigned a valid global group id. 3) A Group with the specified id may not already be in the set.

Definition at line 165 of file GroupStorage.tpp.

References Util::Log::file(), and UTIL_THROW.

Referenced by DdMd::GroupStorage< N >::add(), and DdMd::GroupStorage< N >::unpack().

template<int N>
Group< N > * DdMd::GroupStorage< N >::add ( int  id)

Add a new Group with a specified id, in a single step.

Adds a new Group<N> to the set owned by this function, with a specified global id, and returns a pointer to the new Group. Internally, this function calls newPtr(), and sets the id of the new group, and calls add(). Other member variables must be set after calling this function, using the returned pointer.

Parameters
idglobal id for the new Group.
Returns
pointer to the new Group.

Definition at line 198 of file GroupStorage.tpp.

References DdMd::GroupStorage< N >::add(), DdMd::GroupStorage< N >::newPtr(), and DdMd::Group< N >::setId().

template<int N>
void DdMd::GroupStorage< N >::returnPtr ( )

Reverts a transaction begun by the newPtr() function.

This function pushes the pointer returned by a previous call to newPtr() back onto the reservoir of unused objects, without adding it to the local group set, and the nullifies the "new" pointer.

Definition at line 151 of file GroupStorage.tpp.

References UTIL_THROW.

Referenced by DdMd::GroupStorage< N >::unpack().

template<int N>
void DdMd::GroupStorage< N >::remove ( Group< N > *  groupPtr)

Remove a specific Group.

Exceptions
Exceptionif groupPtr is not address of a Group.
Parameters
groupPtrpointer to the group to be removed

Definition at line 210 of file GroupStorage.tpp.

References Util::Log::file(), DdMd::Group< N >::id(), DdMd::Group< N >::setId(), and UTIL_THROW.

template<int N>
void DdMd::GroupStorage< N >::clearGroups ( )

Remove all groups.

This function resets the GroupStorage to an empty state by pushing the addresses of existing groups onto the reservoir and then clearing the set of groups.

Definition at line 229 of file GroupStorage.tpp.

References DdMd::Group< N >::id(), DdMd::Group< N >::setId(), and UTIL_THROW.

template<int N>
int DdMd::GroupStorage< N >::size ( ) const
inline

Return current number of groups on this processor.

Definition at line 486 of file ddMd/storage/GroupStorage.h.

Referenced by DdMd::GroupStorage< N >::isValid().

template<int N>
int DdMd::GroupStorage< N >::capacity ( ) const
inline
template<int N>
void DdMd::GroupStorage< N >::begin ( GroupIterator< N > &  iterator)
inline
template<int N>
void DdMd::GroupStorage< N >::begin ( ConstGroupIterator< N > &  iterator) const
inline

Set iterator to beginning of the set of groups.

Parameters
iteratoriterator for all groups.

Definition at line 520 of file ddMd/storage/GroupStorage.h.

template<int N>
Group< N > * DdMd::GroupStorage< N >::find ( int  id) const
inline

Find local Group<N> indexed by global id.

Returns
pointer to Group<N> object, or null pointer if absent.

Definition at line 505 of file ddMd/storage/GroupStorage.h.

Referenced by DdMd::GroupStorage< N >::isValid(), and DdMd::GroupStorage< N >::unpack().

template<int N>
int DdMd::GroupStorage< N >::totalCapacity ( ) const
inline

Return maximum allowed number of groups on all processors.

The return value is one greater than the maximum allowed value for an integer group id, i.e., group ids must be in the range 0 <= id <= totalCapacity - 1.

Definition at line 494 of file ddMd/storage/GroupStorage.h.

Referenced by DdMd::GroupStorage< N >::initialize().

template<int N>
void DdMd::GroupStorage< N >::computeNTotal ( MPI::Intracomm &  communicator)

Compute and store the number of distinct groups on all processors.

Compute and store total number of atoms on all processors.

This is an MPI reduce operation, and so must be invoked on all processors. The resulting sum is stored only on the rank 0 processor.

Algorithm: For purposes of counting, each group is assigned to the processor that owns its first atom (index 0), and then values from different processors are summed and stored on the master.

Parameters
communicatorMPI communicator for this system.
Returns
on master node, return total number of groups.

Definition at line 296 of file GroupStorage.tpp.

References DdMd::GroupStorage< N >::begin(), DdMd::Atom::isGhost(), Util::Setable< T >::isSet(), Util::PArrayIterator< Group< N > >::notEnd(), and Util::Setable< T >::set().

Referenced by DdMd::ConfigIo::associate(), DdMd::GroupStorage< N >::isValid(), DdMd::SerializeConfigIo::loadConfig(), DdMd::DdMdConfigIo::readConfig(), DdMd::LammpsConfigIo::readConfig(), DdMd::DdMdOrderedConfigIo::readConfig(), and DdMd::LammpsConfigIo::writeConfig().

template<int N>
int DdMd::GroupStorage< N >::nTotal ( ) const
inline

Return total number of distinct groups on all processors.

This function should be called only on the master (rank 0) processor, after calling computeNTotal() on all processors.

Definition at line 498 of file ddMd/storage/GroupStorage.h.

Referenced by DdMd::ConfigIo::associate(), DdMd::GroupStorage< N >::isValid(), DdMd::SerializeConfigIo::loadConfig(), DdMd::DdMdConfigIo::readConfig(), DdMd::LammpsConfigIo::readConfig(), DdMd::DdMdOrderedConfigIo::readConfig(), and DdMd::LammpsConfigIo::writeConfig().

template<int N>
void DdMd::GroupStorage< N >::unsetNTotal ( )

Mark nTotal as unknown.

Call on all processors.

Definition at line 475 of file GroupStorage.tpp.

References Util::Setable< T >::unset().

Referenced by DdMd::GroupStorage< N >::isValid().

template<int N>
void DdMd::GroupStorage< N >::markSpanningGroups ( FMatrix< double, Dimension, 2 > &  bound,
FMatrix< double, Dimension, 2 > &  inner,
FMatrix< double, Dimension, 2 > &  outer,
IntVector gridFlags 
)
virtual

Find and mark groups that span boundaries.

Parameters
boundboundaries of domain for this processor
innerinner slab boundaries (extended domain of neighbors)
outerouter slab boundaries (extended domain of this processor)
gridFlagselement i is 0 iff gridDimension[i] == 1, 1 otherwise

Implements DdMd::GroupExchanger.

Definition at line 501 of file GroupStorage.tpp.

References DdMd::GroupStorage< N >::begin(), Util::Dimension, DdMd::Plan::exchange(), Util::Log::file(), DdMd::Atom::isGhost(), Util::PArrayIterator< Group< N > >::notEnd(), DdMd::Atom::plan(), DdMd::Atom::position(), and UTIL_THROW.

template<int N>
void DdMd::GroupStorage< N >::pack ( int  i,
int  j,
Buffer buffer 
)
virtual

Pack groups for exchange.

Usage: This is called after atom exchange plans are set, but before atoms makred for exchange in direction i, j have been cleared or removed from the atomStorage.

Parameters
iindex of Cartesian communication direction
jindex for sign of direction
bufferBuffer object into which groups are packed

Implements DdMd::GroupExchanger.

Definition at line 640 of file GroupStorage.tpp.

References DdMd::GroupStorage< N >::begin(), DdMd::Buffer::beginSendBlock(), DdMd::Buffer::endSendBlock(), DdMd::Plan::exchange(), Util::PArrayIterator< Group< N > >::notEnd(), and DdMd::Atom::plan().

template<int N>
void DdMd::GroupStorage< N >::unpack ( Buffer buffer,
AtomStorage atomStorage 
)
virtual
template<int N>
void DdMd::GroupStorage< N >::markGhosts ( AtomStorage atomStorage,
FMatrix< GPArray< Atom >, Dimension, 2 > &  sendArray,
IntVector gridFlags 
)
virtual

Set ghost communication flags for all atoms in incomplete groups.

Usage: This is called after exchanging all atoms and groups between processors, but before exchanging ghosts. At this point, atom ownership is finalized, but there are no ghosts.

Parameters
atomStorageAtomStorage object
sendArrayMatrix of arrays of pointers to ghosts to send
gridFlagselement i is 0 iff gridDimension[i] == 1, 1 otherwise

Implements DdMd::GroupExchanger.

Definition at line 732 of file GroupStorage.tpp.

References DdMd::GroupStorage< N >::begin(), Util::Dimension, DdMd::AtomMap::find(), DdMd::Atom::isGhost(), DdMd::AtomStorage::map(), Util::PArrayIterator< Group< N > >::notEnd(), DdMd::Atom::plan(), DdMd::Plan::setGhost(), and UTIL_THROW.

template<int N>
void DdMd::GroupStorage< N >::findGhosts ( AtomStorage atomStorage)
virtual

Find all ghost members of groups.

Usage: This called after all ghosts have been exchanged.

Parameters
atomStorageAtomStorage object used to find atom pointers

Implements DdMd::GroupExchanger.

Definition at line 810 of file GroupStorage.tpp.

References DdMd::GroupStorage< N >::begin(), DdMd::AtomMap::findGroupGhostAtoms(), DdMd::AtomStorage::map(), Util::PArrayIterator< Group< N > >::notEnd(), and UTIL_THROW.

template<int N>
bool DdMd::GroupStorage< N >::isValid ( AtomStorage atomStorage,
MPI::Intracomm &  communicator,
bool  hasGhosts 
)
virtual

Return true if the container is valid, or throw an Exception.

This calls the overloaded isValid() function and then checks consistency of atom pointers in all groups with those in an asociated AtomStorage. If hasGhosts is false, the function requires that no group contain a pointer to a ghost atom. If hasGhosts is true, it requires that every Group be complete.

Parameters
atomStorageassociated AtomStorage object
hasGhoststrue if the atomStorage has ghosts, false otherwise
communicatordomain communicator

Implements DdMd::GroupExchanger.

Definition at line 384 of file GroupStorage.tpp.

References DdMd::GroupStorage< N >::begin(), DdMd::GroupStorage< N >::computeNTotal(), Util::Log::file(), DdMd::AtomMap::find(), DdMd::Atom::isGhost(), Util::Setable< T >::isSet(), DdMd::GroupStorage< N >::isValid(), DdMd::AtomStorage::map(), Util::ConstPArrayIterator< Group< N > >::notEnd(), DdMd::GroupStorage< N >::nTotal(), DdMd::AtomStorage::totalAtomCapacity(), DdMd::GroupStorage< N >::unsetNTotal(), and UTIL_THROW.

Referenced by DdMd::SerializeConfigIo::loadConfig(), DdMd::DdMdConfigIo::readConfig(), DdMd::LammpsConfigIo::readConfig(), and DdMd::DdMdOrderedConfigIo::readConfig().

template<int N>
void DdMd::GroupStorage< N >::computeStatistics ( MPI::Intracomm &  communicator)
virtual

Compute statistics (reduce from all processors).

Call on all processors.

Definition at line 338 of file GroupStorage.tpp.

References Util::Setable< T >::set().

template<int N>
void DdMd::GroupStorage< N >::clearStatistics ( )

Clear statistical accumulators (call on all processors).

Definition at line 358 of file GroupStorage.tpp.

References Util::Setable< T >::unset().

Referenced by DdMd::Integrator::clear().

template<int N>
void DdMd::GroupStorage< N >::outputStatistics ( std::ostream &  out)

Output statistics.

Call on master, after calling computeStatistics on all procs.

Parameters
outoutput stream

Definition at line 368 of file GroupStorage.tpp.

References Util::Setable< T >::value().

template<int N>
int DdMd::GroupStorage< N >::maxNGroup ( ) const

Get the maximum number of primary atoms encountered thus far.

Call only on master.

template<int N>
GroupDistributor< N > & DdMd::GroupStorage< N >::distributor ( )
inline

Get the GroupDistributor by reference.

Definition at line 524 of file ddMd/storage/GroupStorage.h.

template<int N>
GroupCollector< N > & DdMd::GroupStorage< N >::collector ( )
inline

Get the GroupCollector by reference.

Definition at line 528 of file ddMd/storage/GroupStorage.h.

template<int N>
bool DdMd::GroupStorage< N >::isValid ( )

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