Simpatico
v1.10
|
Descriptor for a type of Atom.
An AtomTypeType has a mass, a name string, and an integer id. If coulomb interactions are enabled (ifdef SIMP_COULOMB), it also has a electrical charge.
Definition at line 30 of file mcMd/chemistry/AtomType.h.
#include <AtomType.h>
Public Member Functions | |
AtomType () | |
Constructor. More... | |
virtual | ~AtomType () |
Destructor. More... | |
Mutators | |
void | setId (int Id) |
Set the type index. More... | |
void | setName (std::string name) |
Set the name string. More... | |
void | setMass (double mass) |
Set the mass. More... | |
void | setHasCharge (bool hasCharge) |
Set the boolean "hasCharge" property. More... | |
void | setCharge (double charge) |
Set the charge value. More... | |
Accessors | |
double | mass () const |
Get the mass. More... | |
bool | hasCharge () const |
Does this type have a charge value? More... | |
double | charge () const |
Get the electrical charge value. More... | |
const std::string & | name () const |
Get the name string. More... | |
int | id () const |
Get the index. More... | |
Friends | |
std::istream & | operator>> (std::istream &in, AtomType &atomType) |
istream extractor (>>) for an AtomType. More... | |
std::ostream & | operator<< (std::ostream &out, const AtomType &atomType) |
ostream inserter (<<) for an AtomType. More... | |
template<class Archive > | |
void | serialize (Archive &ar, AtomType &atomType, const unsigned int version) |
Serialize an AtomType. More... | |
McMd::AtomType::AtomType | ( | ) |
Constructor.
Definition at line 17 of file mcMd/chemistry/AtomType.cpp.
|
virtual |
Destructor.
Definition at line 30 of file mcMd/chemistry/AtomType.cpp.
void McMd::AtomType::setId | ( | int | Id | ) |
Set the type index.
Id | integer index. |
Definition at line 34 of file mcMd/chemistry/AtomType.cpp.
References id().
void McMd::AtomType::setName | ( | std::string | name | ) |
Set the name string.
name | name string |
Definition at line 40 of file mcMd/chemistry/AtomType.cpp.
References name().
void McMd::AtomType::setMass | ( | double | mass | ) |
Set the mass.
mass | atom mass |
Definition at line 46 of file mcMd/chemistry/AtomType.cpp.
References mass().
void McMd::AtomType::setHasCharge | ( | bool | hasCharge | ) |
Set the boolean "hasCharge" property.
An AtomType has an associated electrical charge value if and only if hasCharge is true. A charge value appears in the text file format used by the inserter and extractor iostream operators if and only if the hasCharge property is set true.
The hasCharge property should be set true for all atom types (even those with no charge) if the system has any charged atom types, and thus has Coulomb interactions, and should be set false for all atom types for a neutral system with no Coulomb interactions.
hasCharge | true if this system has Coulomb interactions. |
Definition at line 53 of file mcMd/chemistry/AtomType.cpp.
References hasCharge().
void McMd::AtomType::setCharge | ( | double | charge | ) |
Set the charge value.
Precondition: The hasCharge property must have been set true.
charge | atom electrical charge |
Definition at line 59 of file mcMd/chemistry/AtomType.cpp.
References charge(), and UTIL_CHECK.
|
inline |
Get the mass.
Definition at line 179 of file mcMd/chemistry/AtomType.h.
Referenced by Util::bcast< McMd::AtomType >(), McMd::MdSystem::kineticEnergy(), Util::recv< McMd::AtomType >(), Util::send< McMd::AtomType >(), setMass(), McMd::NveVvIntegrator::setup(), McMd::NvtLangevinIntegrator::setup(), McMd::NvtDpdVvIntegrator::setup(), McMd::NvtNhIntegrator::setup(), and McMd::NphIntegrator::setup().
|
inline |
Does this type have a charge value?
Definition at line 186 of file mcMd/chemistry/AtomType.h.
Referenced by Util::bcast< McMd::AtomType >(), Util::recv< McMd::AtomType >(), Util::send< McMd::AtomType >(), and setHasCharge().
|
inline |
Get the electrical charge value.
Definition at line 192 of file mcMd/chemistry/AtomType.h.
References McMd::operator<<(), McMd::operator>>(), and UTIL_ASSERT.
Referenced by Util::bcast< McMd::AtomType >(), Util::recv< McMd::AtomType >(), Util::send< McMd::AtomType >(), and setCharge().
|
inline |
Get the name string.
Definition at line 173 of file mcMd/chemistry/AtomType.h.
Referenced by Util::bcast< McMd::AtomType >(), Util::recv< McMd::AtomType >(), Util::send< McMd::AtomType >(), and setName().
|
inline |
|
friend |
istream extractor (>>) for an AtomType.
Format:
name [string] mass [double] charge [double]
in | input stream |
atomType | AtomType to be read from stream |
Definition at line 69 of file mcMd/chemistry/AtomType.cpp.
|
friend |
ostream inserter (<<) for an AtomType.
Format, one one line with no line break:
name mass [charge]
out | output stream |
atomType | AtomType to be written to stream |
Definition at line 84 of file mcMd/chemistry/AtomType.cpp.
|
friend |
Serialize an AtomType.
ar | archive object |
atomType | object to be serialized |
version | archive version id |
Definition at line 235 of file mcMd/chemistry/AtomType.h.