Simpatico
v1.10
|
An array of Atom objects.
Access to atoms provided by an overloaded subscript ([]) operator, which is inherited from Array<Atom> base class. The interface is similar to that of a DArray, except that copy construction and assignment (=) are prohibited (i.e., private and not implemented).
The current implementation places data for some "pseudo-members" of each Atom in separate arrays. The interface of an Atom hides this, allowing pseudo-members to be accessed as if they were true class members. See file Atom.h for further implementation details.
Definition at line 40 of file AtomArray.h.
#include <AtomArray.h>
Public Member Functions | |
AtomArray () | |
Constructor. More... | |
virtual | ~AtomArray () |
Destructor. More... | |
void | allocate (int capacity) |
Allocate memory on the heap. More... | |
void | zeroForces () |
Set force vector to zero for all atoms in this array. More... | |
bool | isAllocated () const |
Return true if this is already allocated, false otherwise. More... | |
![]() | |
virtual | ~Array () |
Destructor. More... | |
int | capacity () const |
Return allocated size. More... | |
void | begin (ArrayIterator< Atom > &iterator) |
Set an iterator to begin this Array. More... | |
void | begin (ConstArrayIterator< Atom > &iterator) const |
Set a const iterator to begin this Array. More... | |
Atom & | operator[] (int i) |
Get an element by non-const reference. More... | |
const Atom & | operator[] (int i) const |
Get an element by const reference. More... | |
Atom * | cArray () |
Return pointer to underlying C array. More... | |
const Atom * | cArray () const |
Return pointer to const to underlying C array. More... | |
Additional Inherited Members | |
![]() | |
Array () | |
Default constructor. More... | |
![]() | |
Atom * | data_ |
Pointer to an array of Data elements. More... | |
int | capacity_ |
Allocated size of the data_ array. More... | |
DdMd::AtomArray::AtomArray | ( | ) |
Constructor.
Definition at line 24 of file AtomArray.cpp.
|
virtual |
Destructor.
Definition at line 37 of file AtomArray.cpp.
References Util::Array< Atom >::capacity_, and Util::Array< Atom >::data_.
void DdMd::AtomArray::allocate | ( | int | capacity | ) |
Allocate memory on the heap.
Throw an Exception if this is already allocated.
capacity | number of elements to allocate. |
Definition at line 56 of file AtomArray.cpp.
References Util::Array< Atom >::capacity(), Util::Array< Atom >::capacity_, DdMd::AtomContext::clear(), Util::Array< Atom >::data_, Util::Log::file(), DdMd::Atom::hasAtomContext(), and UTIL_THROW.
Referenced by DdMd::AtomDistributor::readParameters(), DdMd::AtomStorage::save(), and DdMd::AtomCollector::setup().
void DdMd::AtomArray::zeroForces | ( | ) |
Set force vector to zero for all atoms in this array.
Definition at line 101 of file AtomArray.cpp.
References Util::Array< Atom >::capacity_, and Util::Array< Atom >::data_.
Referenced by DdMd::AtomStorage::zeroForces().
bool DdMd::AtomArray::isAllocated | ( | ) | const |
Return true if this is already allocated, false otherwise.
Definition at line 113 of file AtomArray.cpp.
References Util::Array< Atom >::data_.