28 #ifndef _chemisty_molecule_atom_h
29 #define _chemisty_molecule_atom_h
32 #include <util/state/stateio.h>
33 #ifdef MPQC_NEW_FEATURES
34 #include <util/misc/xml.h>
48 #ifdef MPQC_NEW_FEATURES
85 Atom(
int Z,
double x,
double y,
double z,
const std::string &label,
86 double mass = 0,
int have_charge = 0,
double charge = 0,
87 int have_fragment = 0,
int fragment = 0)
88 : Z_(
Z), have_charge_(have_charge), have_fragment_(have_fragment),
89 charge_(charge), fragment_(fragment), mass_(mass), label_(label)
99 Atom(
int Z,
double x,
double y,
double z,
const char *label = 0,
100 double mass = 0,
int have_charge = 0,
double charge = 0,
101 int have_fragment = 0,
int fragment = 0)
102 : Z_(
Z), have_charge_(have_charge), have_fragment_(have_fragment),
103 charge_(charge), fragment_(fragment), mass_(mass), label_(label ? label :
"")
117 Atom() : Z_(-1), have_charge_(true), have_fragment_(true),
118 charge_(-1), fragment_(-1), mass_(-1), label_()
119 { r_[0] = -1; r_[1] = -1; r_[2] = -1; }
123 have_charge_(
other.have_charge_),
124 have_fragment_(
other.have_fragment_),
125 charge_(
other.charge_),
126 fragment_(
other.fragment_),
136 double&
r(
int xyz){
return r_[xyz];}
137 const double&
r(
int xyz)
const {
return r_[xyz];}
140 double*
r(){
return r_;}
141 const double*
r()
const {
return r_;}
144 int Z()
const {
return Z_;}
145 double mass()
const {
return mass_;}
146 bool have_charge()
const {
return have_charge_;}
147 double charge()
const {
return charge_;}
148 bool have_fragment()
const {
return have_fragment_;}
149 int fragment()
const {
return fragment_;}
150 const std::string& label()
const {
return label_;}
155 #ifdef MPQC_NEW_FEATURES
156 virtual boost::property_tree::ptree& write_xml(boost::property_tree::ptree& parent,
const XMLWriter& writer);
161 void ToStateOut(
const Atom &a, StateOut &so,
int &count);
164 void FromStateIn(Atom &a, StateIn &si,
int &count);
167 bool operator==(
const Atom& a,
const Atom& b);
void ToStateOut(const Atom &a, StateOut &so, int &count)
writes Atom to sc::StateOut
double * r()
Returns a pointer to the coordinate array.
Definition: atom.h:140
Atom represents an atom in a Molecule.
Definition: atom.h:47
friend void FromStateIn(Atom &a, StateIn &so, int &count)
reads Atom from sc::StateIn
bool operator!=(const Atom &a, const Atom &b)
Definition: atom.h:170
Atom(int Z, double x, double y, double z, const std::string &label, double mass=0, int have_charge=0, double charge=0, int have_fragment=0, int fragment=0)
Creates an atom for use in the sc::Molecule class.
Definition: atom.h:85
double & r(int xyz)
Returns a reference to the x,y, or z coordinate.
Definition: atom.h:136
SpinCase1 other(SpinCase1 S)
given 1-spin return the other 1-spin
Atom()
Default constructor supplied so that Atom will work with sc::SavableState.
Definition: atom.h:117
int Z() const
Returns atomic number.
Definition: atom.h:144
Atom(int Z, double x, double y, double z, const char *label=0, double mass=0, int have_charge=0, double charge=0, int have_fragment=0, int fragment=0)
Constructs an atom object that takes a c style char * array.
Definition: atom.h:99
void FromStateIn(Atom &a, StateIn &si, int &count)
reads Atom from sc::StateIn
bool operator==(const Atom &a, const Atom &b)
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14
Generated at Sun Jan 26 2020 23:23:56 for MPQC
3.0.0-alpha using the documentation package Doxygen
1.8.16.