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);
90 atoms[noOfAtoms].charge = c;
91 atoms[noOfAtoms].coords[0] = x;
92 atoms[noOfAtoms].coords[1] = y;
93 atoms[noOfAtoms].coords[2] = z;
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(); }
109 ergo_real getNuclearRepulsionEnergy()
const;
114 int getNumberOfElectrons()
const;
116 void getNuclearRepulsionEnergyGradientContrib(
ergo_real* resultGradient)
const;
121 int setFromMoleculeFile(
const char* fileName,
123 char **basissetFile);
const Atom * getAtomListPtr() const
Definition: molecule.h:101
double ergo_real
Definition: realtype.h:53
int getNoOfAtoms() const
Definition: molecule.h:103
A representation of Vector or point in cartesian space.
Definition: molecule.h:49
ergo_real & operator[](unsigned i)
Definition: molecule.h:55
ergo_real dist(const ergo_real b[]) const
Definition: molecule.h:68
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
const Atom & getAtom(int i) const
Definition: molecule.h:102
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
ergo_real coords[3]
Definition: molecule.h:42
int noOfAtoms
Definition: molecule.h:80
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 dist(const Vector3D &b) const
compute distance between two points.
Definition: molecule.h:66
ergo_real getNetCharge() const
Definition: molecule.h:104
ergo_real operator[](unsigned i) const
Definition: molecule.h:56