10 #include <ddMd/simulation/Simulation.h> 11 #include <ddMd/communicate/Domain.h> 12 #include <ddMd/communicate/GroupDistributor.tpp> 13 #include <ddMd/communicate/GroupCollector.tpp> 15 #include <ddMd/storage/AtomStorage.h> 17 #include <ddMd/storage/BondStorage.h> 21 #include <ddMd/storage/AngleStorage.h> 24 #include <ddMd/storage/DihedralStorage.h> 27 #include <ddMd/communicate/Buffer.h> 28 #include <ddMd/communicate/GroupCollector.tpp> 29 #include <ddMd/communicate/GroupDistributor.tpp> 30 #include <ddMd/chemistry/Atom.h> 31 #include <ddMd/chemistry/MaskPolicy.h> 32 #include <util/space/Vector.h> 34 #include <util/mpi/MpiLoader.h> 35 #include <util/format/Int.h> 36 #include <util/format/Dbl.h> 57 , dihedralStoragePtr_(0)
75 , dihedralStoragePtr_(0)
138 int ConfigIo::readGroups(std::ifstream& file,
139 const char* sectionLabel,
140 const char* nGroupLabel,
144 if (
domain().isMaster()) {
145 file >>
Label(sectionLabel);
146 file >> Label(nGroupLabel) >> nGroup;
150 for (i = 0; i < nGroup; ++i) {
151 groupPtr = distributor.
newPtr();
153 for (j = 0; j < 2; ++j) {
171 int ConfigIo::writeGroups(std::ofstream& file,
172 const char* sectionLabel,
173 const char* nGroupLabel,
180 nGroup = storage.
nTotal();
181 if (
domain().isMaster()) {
183 file << sectionLabel << std::endl;
184 file << nGroupLabel <<
Int(nGroup, 10) << std::endl;
186 groupPtr = collector.
nextPtr();
188 file << *groupPtr << std::endl;
189 groupPtr = collector.
nextPtr();
205 for ( ; atomIter.
notEnd(); ++atomIter) {
206 atomIter->mask().clear();
210 int atomId0, atomId1;
216 for ( ; bondIter.
notEnd(); ++bondIter) {
217 atomId0 = bondIter->atomId(0);
218 atomId1 = bondIter->atomId(1);
219 atomPtr0 = atomMap.
find(atomId0);
220 atomPtr1 = atomMap.
find(atomId1);
void computeNTotal(MPI::Intracomm &communicator)
Compute and store the number of distinct groups on all processors.
void setup()
Setup master processor for receiving.
AtomStorage & atomStorage()
Get AtomStorage by reference.
void add()
Add a group to the cache for sending, send if necessary.
AtomStorage & atomStorage()
Get the AtomStorage by reference.
Group< N > * nextPtr()
Return a pointer to the next available atom, or null.
BondStorage & bondStorage()
Get BondStorage by reference.
DihedralStorage & dihedralStorage()
Get the DihedralStorage by reference.
Domain & domain()
Get the Domain by reference.
An orthorhombic periodic unit cell.
void associate(Domain &domain, Boundary &boundary, AtomStorage &atomStorage, BondStorage &bondStorage, AngleStorage &angleStorage, DihedralStorage &dihedralStorage, Buffer &buffer)
Associate with related objects.
void append(int id)
Add an Atom to the masked set.
Associative container for finding atoms identified by integer id.
BondStorage & bondStorage()
Get the BondStorage by reference.
A point particle in an MD simulation.
Parallel domain decomposition (DD) MD simulation.
Main object for a domain-decomposition MD simulation.
Class for collecting Groups from processors to master processor.
Iterator for all Group < N > objects owned by a GroupStorage< N >.
bool notEnd() const
Is the current pointer not at the end of the PArray?
Utility classes for scientific computation.
void setAtomMasks()
Set Mask data on all atoms.
const AtomMap & map() const
Return the AtomMap by const reference.
Wrapper for an int, for formatted ostream output.
Group< N > * newPtr()
Returns pointer an address available for a new Group<N>.
Boundary & boundary()
Get Boundary by reference.
A container for all the Group<N> objects on this processor.
Atom * find(int atomId) const
Return pointer to Atom with specified id.
void send()
Send all atoms that have not be sent previously.
A container for all the atoms and ghost atoms on this processor.
void begin(GroupIterator< N > &iterator)
Set iterator to beginning of the set of groups.
ConfigIo()
Default constructor.
Buffer for interprocessor communication.
A label string in a file format.
Decomposition of the system into domains associated with processors.
int nTotal() const
Return total number of distinct groups on all processors.
void send()
Send all groups on this processor to the master processor.
Container for Group<3> (angle) objects.
void setup()
Initialize Buffer for sending.
This file contains templates for global functions send<T>, recv<T> and bcast<T>.
void receive()
Receive all atoms sent by master processor.
AngleStorage & angleStorage()
Get AngleStorage by reference.
void setClassName(const char *className)
Set class name string.
A group of covalently interacting atoms.
Buffer & buffer()
Get the Buffer by reference.
Boundary & boundary()
Get the Boundary by reference.
Container for Group<4> (dihedral) objects.
DihedralStorage & dihedralStorage()
Get DihedralStorage by reference.
Domain & domain()
Get the Domain by reference.
Iterator for all atoms owned by an AtomStorage.
int atomId(int i) const
Get the id for a specific atom in the Group.
void begin(AtomIterator &iterator)
Set iterator to beginning of the set of atoms.
Mask & mask()
Get the associated Mask by reference.
AngleStorage & angleStorage()
Get the AngleStorage by reference.
virtual ~ConfigIo()
Destructor.
Container for for Group<2> (bond) objects.
Class template for distributing Group<N> objects among processors.