Simpatico
v1.10
|
A point particle within a Molecule.
Each Atom has a position Vector, an integer atom type Id, and a global integer id that is unique in the Simulation. Each Atom has a force and velocity, for use in Md simulations. Each atom has a pointer to its parent Molecule, and has an associated Mask object. A Mask contains a list of other atoms for which pair interactions with this Atom are suppressed.
Each atom also has an isActive() flag that can be used by Monte Carlo moves to mark an atom as temporarily "inactive" during a deletion or regrowth of part of a molecule. The isActive flag is initialized to true by the Atom::allocate function.
Atom objects can only be created by the static Atom::allocate() function. This function allocates a static member array containing all of the Atom objects available in a program. The global index that is returned by the id() function is the index of an Atom within this array. This array of all Atoms must be allocated and deallocated using the following pattern:
Access to the array of Atom objects is provided by an RArray<Atom> array container (called "atoms" in the above example) that is passed to Atom::allocate by reference as its second parameter. After Atom::allocate() returns, this container holds the address and capacity of the underlying C array, and may thereafter be used to access individual atoms.
This interface is designed to allow an implementation of the Atom class in which some logical attributes of an Atom are not actually C++ member variables, but are instead stored in separate private arrays. These additional arrays are private static members of the Atom class that can be directly accessed by the accessor and setter functions for the associated attributes, as if they were normal non-static class members.
Definition at line 79 of file mcMd/chemistry/Atom.h.
#include <Atom.h>
Public Member Functions | |
Mutators | |
void | setMolecule (Molecule &molecule) |
Set the parent molecule. More... | |
void | setTypeId (int typeId) |
Set the atomic type index. More... | |
Accessors | |
int | id () const |
Get global index for this Atom within the Simulation. More... | |
int | indexInMolecule () const |
Get local index for this Atom within the parent molecule;. More... | |
int | typeId () const |
Get type index for this Atom. More... | |
Molecule & | molecule () const |
Get the parent Molecule by reference. More... | |
const Vector & | position () const |
Get the position Vector by const reference. More... | |
Vector & | position () |
Get position Vector by reference. More... | |
Mask & | mask () |
Get the associated Mask by reference. More... | |
const Mask & | mask () const |
Get the associated Mask by const reference. More... | |
Vector & | velocity () |
Get atomic velocity Vector by reference. More... | |
const Vector & | velocity () const |
Get the atomic velocity Vector by const reference. More... | |
Vector & | force () |
Get atomic force Vector by reference. More... | |
const Vector & | force () const |
Get atomic force Vector by const reference. More... | |
bool | isActive () const |
Get the isActive flag. More... | |
Static Public Member Functions | |
Allocation and de-allocation (static members) | |
static void | initStatic () |
Method to guarantee initialization of static data. More... | |
static void | allocate (int capacity, RArray< Atom > &atoms) |
Allocate a static array of Atom objects. More... | |
static void | deallocate () |
Delete all static arrays. More... | |
static int | capacity () |
Get total number of atoms (capacity of the static atom array.) More... | |
void McMd::Atom::setMolecule | ( | Molecule & | molecule | ) |
Set the parent molecule.
Definition at line 151 of file mcMd/chemistry/Atom.cpp.
Referenced by McMd::Simulation::save().
|
inline |
Set the atomic type index.
typeId | integer index that identifies atom type |
Definition at line 266 of file mcMd/chemistry/Atom.h.
Referenced by McMd::CfbReptationMove::move(), McMd::EndSwapMove::move(), McMd::CfbReptateMove::move(), McMd::Simulation::save(), McMd::HomopolymerSG::setMoleculeState(), and McMd::LinearSG::setMoleculeState().
|
inline |
Get global index for this Atom within the Simulation.
Definition at line 270 of file mcMd/chemistry/Atom.h.
Referenced by McMd::CellList::addAtom(), McMd::LinkMaster::addLink(), McMd::McPairPotentialImpl< Interaction >::atomEnergy(), McMd::LinkMaster::atomLinkSet(), McMd::PairList::build(), McMd::McPairPotentialImpl< Interaction >::computeEnergy(), McMd::CellList::deleteAtom(), McMd::McPairPerturbation< Interaction >::derivative(), McMd::McPairExternalPerturbation< PairInteraction, ExternalInteraction >::derivative(), McMd::LinkMaster::isValid(), McMd::PairSelector::match(), McMd::McPairPotentialImpl< Interaction >::moleculeEnergy(), McMd::Sliplinker::move(), McMd::SliplinkerEnd::move(), McMd::SliplinkerAll::move(), McMd::SliplinkMove::move(), McMd::LinkMaster::removeLink(), McMd::LinkMaster::reSetAtom(), McMd::LinkMaster::reSetAtoms(), McMd::Crosslinker::sample(), McMd::McMuExchange::sample(), McMd::NvtDpdVvIntegrator::setup(), and McMd::CellList::updateAtomCell().
|
inline |
Get local index for this Atom within the parent molecule;.
Definition at line 743 of file mcMd/chemistry/Molecule.h.
Referenced by McMd::GcSliplinkMove::move(), McMd::SliplinkMove::move(), McMd::Sliplinker::move(), McMd::SliplinkerEnd::move(), McMd::SSChainDist::sample(), McMd::LinkLTPos::sample(), McMd::LinkMSD::sample(), McMd::RingOctaRebridgeMove::scanBridge(), and McMd::McMdConfigIo::write().
|
inline |
Get type index for this Atom.
Definition at line 274 of file mcMd/chemistry/Atom.h.
Referenced by McMd::CfbLinear::addAtom(), McMd::MdEwaldPairPotentialImpl< Interaction >::addForces(), McMd::MdPairPotentialImpl< Interaction >::addForces(), McMd::ExternalPotentialImpl< Interaction >::atomEnergy(), McMd::McPairPotentialImpl< Interaction >::atomEnergy(), McMd::Generator::attemptPlaceAtom(), McMd::McPairPotentialImpl< Interaction >::computeEnergy(), McMd::MdEwaldPairPotentialImpl< Interaction >::computeEnergy(), McMd::MdPairPotentialImpl< Interaction >::computeEnergy(), McMd::MdEwaldPairPotentialImpl< Interaction >::computeStress(), McMd::McPairExternalPerturbation< PairInteraction, ExternalInteraction >::derivative(), McMd::McPairPerturbation< Interaction >::derivative(), McMd::Simulation::isValid(), McMd::PairSelector::match(), McMd::McPairPotentialImpl< Interaction >::moleculeEnergy(), McMd::CfbReptationMove::move(), McMd::EndSwapMove::move(), McMd::CfbReptateMove::move(), McMd::GroupRebridgeBase::octaEnergy(), McMd::McMuExchange::sample(), McMd::MdPairEnergyCoefficients::sample(), McMd::McPairEnergyAverage::sample(), McMd::BlockRadiusGyration::sample(), McMd::NveVvIntegrator::step(), McMd::NvtLangevinIntegrator::step(), McMd::NphIntegrator::step(), and McMd::GroupRebridgeBase::tetraEnergy().
|
inline |
Get the parent Molecule by reference.
Definition at line 310 of file mcMd/chemistry/Atom.h.
Referenced by McMd::Activate::deactivate(), McMd::getAtomAngles(), McMd::getAtomBonds(), McMd::getAtomDihedrals(), McMd::ClusterIdentifier::initialize(), McMd::Simulation::isValid(), McMd::PairSelector::match(), McMd::McPairPotentialImpl< Interaction >::moleculeEnergy(), McMd::Sliplinker::move(), McMd::SliplinkerEnd::move(), McMd::SliplinkMove::move(), McMd::GcSliplinkMove::move(), McMd::Activate::reactivate(), McMd::McMuExchange::sample(), McMd::InterIntraLink::sample(), McMd::MdPairEnergyCoefficients::sample(), McMd::RingOctaRebridgeMove::scanBridge(), and McMd::McMdConfigIo::write().
|
inline |
Get the position Vector by const reference.
Definition at line 278 of file mcMd/chemistry/Atom.h.
Referenced by McMd::CfbLinear::addAtom(), McMd::CellList::addAtom(), McMd::CfbEndBase::addEndAtom(), McMd::LinkPotentialImpl< Interaction >::addForces(), McMd::BondPotentialImpl< Interaction >::addForces(), McMd::MdEwaldPairPotentialImpl< Interaction >::addForces(), McMd::MdPairPotentialImpl< Interaction >::addForces(), McMd::DihedralPotentialImpl< Interaction >::addForces(), McMd::AnglePotentialImpl< Interaction >::addForces(), McMd::CfbRebridgeBase::addMiddleAtom(), McMd::GroupRebridgeBase::angleEnergy(), McMd::LinkPotentialImpl< Interaction >::atomEnergy(), McMd::ExternalPotentialImpl< Interaction >::atomEnergy(), McMd::BondPotentialImpl< Interaction >::atomEnergy(), McMd::McPairPotentialImpl< Interaction >::atomEnergy(), McMd::DihedralPotentialImpl< Interaction >::atomEnergy(), McMd::AnglePotentialImpl< Interaction >::atomEnergy(), McMd::Generator::attemptPlaceAtom(), McMd::PointGenerator::attemptPlaceMolecule(), McMd::LinearGenerator::attemptPlaceMolecule(), McMd::PairList::build(), McMd::LinkPotentialImpl< Interaction >::computeEnergy(), McMd::McPairPotentialImpl< Interaction >::computeEnergy(), McMd::MdEwaldPairPotentialImpl< Interaction >::computeEnergy(), McMd::MdPairPotentialImpl< Interaction >::computeEnergy(), McMd::MdEwaldPairPotentialImpl< Interaction >::computeStress(), McMd::CfbLinear::deleteAtom(), McMd::CfbEndBase::deleteEndAtom(), McMd::CfbRebridgeBase::deleteMiddleAtom(), McMd::McPairExternalPerturbation< PairInteraction, ExternalInteraction >::derivative(), McMd::McPairPerturbation< Interaction >::derivative(), McMd::ClusterIdentifier::initialize(), McMd::McNVTChemicalPotential::load(), McMd::McPairPotentialImpl< Interaction >::moleculeEnergy(), McMd::GcSliplinkMove::move(), McMd::Sliplinker::move(), McMd::SliplinkerAll::move(), McMd::SliplinkMove::move(), McMd::SliplinkerEnd::move(), McMd::RingTetraRebridgeMove::move(), McMd::AtomDisplaceMove::move(), McMd::CfbDoubleRebridgeMove::move(), McMd::RingOctaRebridgeMove::move(), McMd::CfbEndMove::move(), McMd::CfbLinearEndMove::move(), McMd::CfbReptationMove::move(), McMd::CfbRingRebridgeMove::move(), McMd::EndSwapMove::move(), McMd::CfbReptateMove::move(), McMd::RigidDisplaceMove::move(), McMd::McPairPotential::moveAtom(), McMd::GroupRebridgeBase::octaEnergy(), McMd::ComMSD::output(), McMd::McConfigIo::readAtom(), McMd::MdConfigIo::readAtom(), McMd::Crosslinker::sample(), McMd::LinkLengthDist::sample(), McMd::G1MSD::sample(), McMd::McNVTChemicalPotential::sample(), McMd::McMuExchange::sample(), McMd::AtomMSD::sample(), McMd::MdPairEnergyCoefficients::sample(), McMd::McPairEnergyAverage::sample(), McMd::ComMSD::sample(), McMd::RingRouseAutoCorr::sample(), McMd::EndtoEndXYZ::sample(), McMd::LinearRouseAutoCorr::sample(), McMd::EndtoEnd::sample(), McMd::BlockRadiusGyration::sample(), McMd::IntraPairAutoCorr::sample(), McMd::RadiusGyration::sample(), McMd::RingOctaRebridgeMove::scanBridge(), McMd::RingTetraRebridgeMove::scanBridge(), McMd::G1MSD::setup(), McMd::AtomMSD::setup(), McMd::ComMSD::setup(), McMd::NvtDpdVvIntegrator::setup(), McMd::NveVvIntegrator::step(), McMd::NvtLangevinIntegrator::step(), McMd::NphIntegrator::step(), McMd::GroupRebridgeBase::tetraEnergy(), McMd::McPairPotential::updateAtomCell(), McMd::McConfigIo::writeAtom(), and McMd::MdConfigIo::writeAtom().
|
inline |
Get position Vector by reference.
Definition at line 282 of file mcMd/chemistry/Atom.h.
|
inline |
Get the associated Mask by reference.
Definition at line 302 of file mcMd/chemistry/Atom.h.
Referenced by McMd::McPairPotentialImpl< Interaction >::atomEnergy(), McMd::PairList::build(), McMd::McPairPotentialImpl< Interaction >::computeEnergy(), McMd::McPairPerturbation< Interaction >::derivative(), McMd::McPairExternalPerturbation< PairInteraction, ExternalInteraction >::derivative(), McMd::Simulation::isValid(), McMd::McPairPotentialImpl< Interaction >::moleculeEnergy(), McMd::SliplinkerEnd::move(), McMd::SliplinkerAll::move(), McMd::SliplinkMove::move(), McMd::GcSliplinkMove::move(), McMd::Sliplinker::move(), McMd::CfbReptationMove::move(), McMd::CfbReptateMove::move(), McMd::Crosslinker::sample(), McMd::McMuExchange::sample(), McMd::McPairEnergyAverage::sample(), and McMd::Simulation::save().
|
inline |
Get the associated Mask by const reference.
Definition at line 306 of file mcMd/chemistry/Atom.h.
|
inline |
Get atomic velocity Vector by reference.
Definition at line 290 of file mcMd/chemistry/Atom.h.
Referenced by McMd::MdConfigIo::readAtom(), McMd::VelProf::sample(), McMd::NvtDpdVvIntegrator::setup(), McMd::NveVvIntegrator::step(), McMd::NvtLangevinIntegrator::step(), McMd::NphIntegrator::step(), and McMd::MdConfigIo::writeAtom().
|
inline |
Get the atomic velocity Vector by const reference.
Definition at line 286 of file mcMd/chemistry/Atom.h.
|
inline |
Get atomic force Vector by reference.
Definition at line 298 of file mcMd/chemistry/Atom.h.
Referenced by McMd::LinkPotentialImpl< Interaction >::addForces(), McMd::BondPotentialImpl< Interaction >::addForces(), McMd::MdEwaldPairPotentialImpl< Interaction >::addForces(), McMd::MdPairPotentialImpl< Interaction >::addForces(), McMd::DihedralPotentialImpl< Interaction >::addForces(), McMd::AnglePotentialImpl< Interaction >::addForces(), McMd::NveVvIntegrator::step(), McMd::NvtLangevinIntegrator::step(), and McMd::NphIntegrator::step().
|
inline |
Get atomic force Vector by const reference.
Definition at line 294 of file mcMd/chemistry/Atom.h.
|
inline |
Get the isActive flag.
Definition at line 314 of file mcMd/chemistry/Atom.h.
Referenced by McMd::Activate::deactivate(), McMd::Simulation::isValid(), and McMd::Activate::reactivate().
|
static |
Method to guarantee initialization of static data.
Definition at line 35 of file mcMd/chemistry/Atom.cpp.
Referenced by McMd::Simulation::Simulation().
Allocate a static array of Atom objects.
Upon return, the parameter atoms is associated with a new private static array of Atom objects, and every Atom has an id set equal to its index within this array.
Atom::allocate creates a static array that contains all of the Atom objects available for use in a program. Atom::deallocate() releases the memory allocated by Atom::allocate. Atom::allocate() cannot be called more than once without first calling Atom::deallocate().
capacity | total number of Atoms to be allocated in the array. |
atoms | on return, atoms is associated with the new array. |
Definition at line 52 of file mcMd/chemistry/Atom.cpp.
References Util::RArray< Data >::associate(), Util::Vector::zero(), and Util::IntVector::zero().
Referenced by McMd::Simulation::save().
|
static |
Delete all static arrays.
Deletes all memory allocated previously by allocate.
Definition at line 103 of file mcMd/chemistry/Atom.cpp.
Referenced by McMd::Simulation::~Simulation().
|
static |
Get total number of atoms (capacity of the static atom array.)