28 #ifndef MOLECULE_HEADER
29 #define MOLECULE_HEADER
53 v[0] = x; v[1] = y; v[2] = z;
60 d = v[0]-b[0]; r = d*d;
61 d = v[1]-b[1]; r += d*d;
62 d = v[2]-b[2]; r += d*d;
67 {
return std::sqrt(
dist2(b.
v)); }
69 {
return std::sqrt(
dist2(b)); }
84 Molecule() : atoms(10), netCharge(0), noOfAtoms(0) {}
87 int currListSize = atoms.size();
88 if(noOfAtoms >= currListSize)
89 atoms.resize(currListSize*2);
97 void clear() { noOfAtoms = 0; netCharge = 0; }
99 void replaceAtom(
int i,
const Atom & atom) { assert(i >= 0 && i < noOfAtoms); atoms[i] = atom; }
100 void setAtomList(
const std::vector<Atom> atomList) { atoms = atomList; noOfAtoms = atomList.size(); }
121 char **basissetFile);
const Atom & getAtom(int i) const
Definition: molecule.h:102
int getNumberOfElectrons() const
Compute total number of electrons.
Definition: molecule.cc:121
double ergo_real
Definition: realtype.h:53
ergo_real dist(const ergo_real b[]) const
Definition: molecule.h:68
ergo_real getNuclearRepulsionEnergy() const
Compute nuclear repulsion energy.
Definition: molecule.cc:77
int getNoOfAtoms() const
Definition: molecule.h:103
ergo_real dist(const Vector3D &b) const
compute distance between two points.
Definition: molecule.h:66
A representation of Vector or point in cartesian space.
Definition: molecule.h:49
ergo_real & operator[](unsigned i)
Definition: molecule.h:55
ergo_real operator[](unsigned i) const
Definition: molecule.h:56
Representation of a molecule as a set of nuclei and total charge.
Definition: molecule.h:76
void setNetCharge(ergo_real netCharge_)
Definition: molecule.h:98
ergo_real dist2(const ergo_real b[]) const
compute square of distance between two points.
Definition: molecule.h:58
ergo_real netCharge
Definition: molecule.h:79
Simple atom representation by its charge and cartesian coordinates.
Definition: molecule.h:40
void clear()
Definition: molecule.h:97
ergo_real v[3]
Definition: molecule.h:50
Vector3D()
Definition: molecule.h:51
ergo_real getNuclearElectricFieldEnergy(const Vector3D &electricField) const
Compute nuclear energy in given electric field.
Definition: molecule.cc:101
Molecule()
Definition: molecule.h:84
Vector3D(ergo_real x, ergo_real y, ergo_real z)
Definition: molecule.h:52
std::vector< Atom > atoms
Definition: molecule.h:78
void getExtremeInternuclearDistances(ergo_real &minDist, ergo_real &maxDist) const
Compute smallest and largest internuclear distances.
Definition: molecule.cc:56
ergo_real coords[3]
Definition: molecule.h:42
int noOfAtoms
Definition: molecule.h:80
const Atom * getAtomListPtr() const
Definition: molecule.h:101
void setAtomList(const std::vector< Atom > atomList)
Definition: molecule.h:100
void addAtom(ergo_real c, ergo_real x, ergo_real y, ergo_real z)
Definition: molecule.h:86
ergo_real charge
Definition: molecule.h:41
void replaceAtom(int i, const Atom &atom)
Definition: molecule.h:99
ergo_real getNetCharge() const
Definition: molecule.h:104
int setFromMoleculeFile(const char *fileName, int netCharge, char **basissetFile)
Loads molecule from a given file name, assuming given net charge.
Definition: molecule.cc:370