9 #include <util/containers/RArray.h> 17 Atom* Atom::atoms_ = 0;
18 Mask* Atom::masks_ = 0;
19 Molecule** Atom::moleculePtrs_ = 0;
20 Vector* Atom::velocities_ = 0;
22 bool* Atom::isActives_ = 0;
26 int Atom::capacity_ = 0;
54 if (capacity == 0)
return;
58 assert(moleculePtrs_ == 0);
59 assert(velocities_ == 0);
61 assert(isActives_ == 0);
66 atoms_ =
new Atom[capacity];
67 masks_ =
new Mask[capacity];
68 moleculePtrs_ =
new Molecule*[capacity];
70 for (
int i = 0; i < capacity_; ++i) {
76 velocities_ =
new Vector[capacity_];
77 for (
int i = 0; i < capacity_; ++i) {
78 velocities_[i].
zero();
81 forces_ =
new Vector[capacity_];
82 for (
int i = 0; i < capacity_; ++i) {
86 isActives_ =
new bool[capacity_];
87 for (
int i = 0; i < capacity_; ++i) {
93 for (
int i = 0; i < capacity_; ++i) {
114 delete [] moleculePtrs_;
118 delete [] velocities_;
126 delete [] isActives_;
152 { moleculePtrs_[id_] = &molecule; }
Vector & zero()
Set all elements of a 3D vector to zero.
A Vector is a Cartesian vector.
static void deallocate()
Delete all static arrays.
IntVector & zero()
Set all elements of a 3D vector to zero.
void associate(Array< Data > &array)
Associate this RArray with an existing Array object.
Set of Atoms for which pair interactions with a target Atom are "masked".
void setMolecule(Molecule &molecule)
Set the parent molecule.
static void initStatic()
Method to guarantee initialization of static data.
static void allocate(int capacity, RArray< Atom > &atoms)
Allocate a static array of Atom objects.
A point particle within a Molecule.
Utility classes for scientific computation.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
An IntVector is an integer Cartesian vector.
An Array that acts as a reference to another Array or C array.
A physical molecule (a set of covalently bonded Atoms).