Simpatico  v1.10
List of all members | Public Member Functions | Friends
McMd::AtomType Class Reference

Detailed Description

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...
 

Constructor & Destructor Documentation

McMd::AtomType::AtomType ( )

Constructor.

Definition at line 17 of file mcMd/chemistry/AtomType.cpp.

McMd::AtomType::~AtomType ( )
virtual

Destructor.

Definition at line 30 of file mcMd/chemistry/AtomType.cpp.

Member Function Documentation

void McMd::AtomType::setId ( int  Id)

Set the type index.

Parameters
Idinteger index.

Definition at line 34 of file mcMd/chemistry/AtomType.cpp.

References id().

void McMd::AtomType::setName ( std::string  name)

Set the name string.

Parameters
namename string

Definition at line 40 of file mcMd/chemistry/AtomType.cpp.

References name().

void McMd::AtomType::setMass ( double  mass)

Set the mass.

Parameters
massatom 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.

Parameters
hasChargetrue 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.

Parameters
chargeatom electrical charge

Definition at line 59 of file mcMd/chemistry/AtomType.cpp.

References charge(), and UTIL_CHECK.

double McMd::AtomType::mass ( ) const
inline
bool McMd::AtomType::hasCharge ( ) const
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().

double McMd::AtomType::charge ( ) const
inline
const std::string & McMd::AtomType::name ( ) const
inline
int McMd::AtomType::id ( ) const
inline

Get the index.

Definition at line 167 of file mcMd/chemistry/AtomType.h.

Referenced by setId().

Friends And Related Function Documentation

std::istream& operator>> ( std::istream &  in,
AtomType atomType 
)
friend

istream extractor (>>) for an AtomType.

Format:

name [string] mass [double] charge [double]

Parameters
ininput stream
atomTypeAtomType to be read from stream
Returns
modified input stream

Definition at line 69 of file mcMd/chemistry/AtomType.cpp.

std::ostream& operator<< ( std::ostream &  out,
const AtomType atomType 
)
friend

ostream inserter (<<) for an AtomType.

Format, one one line with no line break:

name mass [charge]

Parameters
outoutput stream
atomTypeAtomType to be written to stream
Returns
modified output stream

Definition at line 84 of file mcMd/chemistry/AtomType.cpp.

template<class Archive >
void serialize ( Archive &  ar,
AtomType atomType,
const unsigned int  version 
)
friend

Serialize an AtomType.

Parameters
ararchive object
atomTypeobject to be serialized
versionarchive version id

Definition at line 235 of file mcMd/chemistry/AtomType.h.


The documentation for this class was generated from the following files: