Simpatico
v1.10
|
Generates initial configurations for molecules of one species.
Definition at line 38 of file Generator.h.
#include <Generator.h>
Public Member Functions | |
Generator (Species &species, System &system) | |
Constructor. More... | |
virtual | ~Generator () |
Destructor. More... | |
void | setBondPotential (BondPotential &bondPotential) |
Create an association with a BondPotential. More... | |
virtual bool | generate (int nMolecule, Array< double > const &diameters, CellList &cellList) |
Generate nMolecule molecules of the associated Species. More... | |
Static Public Member Functions | |
static void | setupCellList (int atomCapacity, Boundary &boundary, const Array< double > &diameters, CellList &cellList) |
Allocate any required memory for the cell list. More... | |
Protected Member Functions | |
bool | attemptPlaceAtom (Atom &atom, const Array< double > &diameters, CellList &cellList) |
Attempt to place an atom. More... | |
virtual bool | attemptPlaceMolecule (Molecule &molecule, const Array< double > &diameters, CellList &cellList)=0 |
Attempt to insert an entire molecule (pure virtual). More... | |
const Species & | species () |
Get the associated Species by reference. More... | |
Simulation & | simulation () |
Get the associated Simulation by reference. More... | |
System & | system () |
Get the associated System by reference. More... | |
const Boundary & | boundary () const |
Get the associated Boundary by reference. More... | |
const BondPotential & | bondPotential () |
Get the associated BondPotential by reference. More... | |
Constructor.
species | associated Species object |
system | parent System |
Definition at line 25 of file Generator.cpp.
|
virtual |
Destructor.
Definition at line 38 of file Generator.cpp.
void McMd::Generator::setBondPotential | ( | BondPotential & | bondPotential | ) |
Create an association with a BondPotential.
bondPotential | BondPotential |
Definition at line 45 of file Generator.cpp.
References bondPotential().
Referenced by McMd::generatorFactory().
|
virtual |
Generate nMolecule molecules of the associated Species.
nMolecule | desired number of molecules |
diameters | array of excluded volume diameters for atomTypes |
cellList | CellList object |
Definition at line 87 of file Generator.cpp.
References McMd::System::addMolecule(), McMd::CellList::atomCapacity(), McMd::Simulation::atomCapacity(), attemptPlaceMolecule(), Util::Log::file(), McMd::Simulation::getMolecule(), Simp::Species::id(), Simp::Species::isMutable(), Simp::Species::mutator(), McMd::System::removeMolecule(), McMd::SpeciesMutator::setMoleculeState(), simulation(), McMd::System::simulation(), species(), McMd::Simulation::species(), system(), and UTIL_CHECK.
Referenced by McMd::McSystem::generateMolecules(), and McMd::MdSystem::generateMolecules().
|
static |
Allocate any required memory for the cell list.
atomCapacity | maximum allowed atom id + 1 |
boundary | Boundary object, periodic unit cell |
diameters | array of excluded volume diameters |
cellList | CellList to be allocated |
Definition at line 131 of file Generator.cpp.
References Util::Array< Data >::capacity(), McMd::CellList::setAtomCapacity(), and McMd::CellList::setup().
Referenced by McMd::McSystem::generateMolecules(), and McMd::MdSystem::generateMolecules().
|
protected |
Attempt to place an atom.
The proposed position for the atom should be set upon entry. This function checks if the atom position is within the hard-core cutoff distance of any atoms that are already in the cell list. The cutoff distance for atoms of types i and j is the average of the excluded volume diameters for types i and j. If the atom position satisfies this geometrical constraint, the atom is added to the cell list and returns true. If it does not, the function returns false.
atom | new Atom, with proposed position already set |
diameters | array of excluded diameters for atom types |
cellList | CellList object containing existing atoms |
Definition at line 52 of file Generator.cpp.
References McMd::CellList::addAtom(), boundary(), Simp::OrthorhombicBoundary::distanceSq(), McMd::CellList::getNeighbors(), McMd::Atom::position(), Simp::OrthorhombicBoundary::shift(), Util::FSArray< Data, Capacity >::size(), and McMd::Atom::typeId().
Referenced by McMd::PointGenerator::attemptPlaceMolecule(), and McMd::LinearGenerator::attemptPlaceMolecule().
|
protectedpure virtual |
Attempt to insert an entire molecule (pure virtual).
molecule | new molecule, with unknown atomic positions |
diameters | array of excluded volume diameters for types |
cellList | CellList object storing existing atoms |
Referenced by generate().
|
inlineprotected |
Get the associated Species by reference.
Definition at line 184 of file Generator.h.
Referenced by McMd::LinearGenerator::attemptPlaceMolecule(), and generate().
|
inlineprotected |
Get the associated Simulation by reference.
Definition at line 190 of file Generator.h.
Referenced by McMd::PointGenerator::attemptPlaceMolecule(), McMd::LinearGenerator::attemptPlaceMolecule(), and generate().
|
inlineprotected |
Get the associated System by reference.
Definition at line 196 of file Generator.h.
Referenced by generate().
|
inlineprotected |
Get the associated Boundary by reference.
Definition at line 202 of file Generator.h.
Referenced by attemptPlaceAtom(), McMd::PointGenerator::attemptPlaceMolecule(), and McMd::LinearGenerator::attemptPlaceMolecule().
|
inlineprotected |
Get the associated BondPotential by reference.
Definition at line 209 of file Generator.h.
Referenced by McMd::LinearGenerator::attemptPlaceMolecule(), and setBondPotential().