diff --git a/Mine/wikistart/wikistart2/V2/v1/molecule.cc b/Mine/wikistart/wikistart2/V2/v1/molecule.cc new file mode 100644 index 0000000..bd69fe3 --- /dev/null +++ b/Mine/wikistart/wikistart2/V2/v1/molecule.cc @@ -0,0 +1,35 @@ +#include "molecule.h" +#include + +void Molecule::print_geom() +{ + for(int i=0; i < natom; i++) + printf("%d %8.5f %8.5f %8.5f\n", zvals[i], geom[i][0], geom[i][1], geom[i][2]); +} + +void Molecule::translate(double x, double y, double z) +{ + for(int i=0; i < natom; i++) { + geom[i][0] += x; + geom[i][1] += y; + geom[i][2] += z; + } +} + +Molecule::Molecule(int n, int q) +{ + natom = n; + charge = q; + zvals = new int[natom]; + geom = new double* [natom]; + for(int i=0; i < natom; i++) + geom[i] = new double[3]; +} + +Molecule::~Molecule() +{ + delete[] zvals; + for(int i=0; i < natom; i++) + delete[] geom[i]; + delete[] geom; +} \ No newline at end of file diff --git a/Mine/wikistart/wikistart2/V2/v1/molecule.h b/Mine/wikistart/wikistart2/V2/v1/molecule.h new file mode 100644 index 0000000..59085b9 --- /dev/null +++ b/Mine/wikistart/wikistart2/V2/v1/molecule.h @@ -0,0 +1,23 @@ +#include + +using namespace std; + +class Molecule +{ + public: + int natom; + int charge; + int *zvals; + double **geom; + string point_group; + + void print_geom(); + void rotate(double phi); + void translate(double x, double y, double z); + double bond(int atom1, int atom2); + double angle(int atom1, int atom2, int atom3); + double torsion(int atom1, int atom2, int atom3, int atom4); + + Molecule(int n,int q); + ~Molecule(); +}; diff --git a/Mine/wikistart/wikistart2/V2/v1/molecule.o b/Mine/wikistart/wikistart2/V2/v1/molecule.o new file mode 100644 index 0000000..46da638 Binary files /dev/null and b/Mine/wikistart/wikistart2/V2/v1/molecule.o differ diff --git a/Mine/wikistart/wikistart2/V2/v1/water b/Mine/wikistart/wikistart2/V2/v1/water new file mode 100644 index 0000000..5b5dc29 Binary files /dev/null and b/Mine/wikistart/wikistart2/V2/v1/water differ diff --git a/Mine/wikistart/wikistart2/V2/v1/water.cc b/Mine/wikistart/wikistart2/V2/v1/water.cc new file mode 100644 index 0000000..a3ebce7 --- /dev/null +++ b/Mine/wikistart/wikistart2/V2/v1/water.cc @@ -0,0 +1,25 @@ +#include "molecule.h" + +using namespace std; + +int main(int argc, char *argv[]) +{ + Molecule h2o(3,0); + h2o.zvals[0] = 8; + h2o.geom[0][0] = 0.000000000000; + h2o.geom[0][1] = 0.000000000000; + h2o.geom[0][2] = -0.122368916506; + h2o.zvals[1] = 1; + h2o.geom[1][0] = 0.000000000000; + h2o.geom[1][1] = 1.414995841403; + h2o.geom[1][2] = 0.971041753535; + h2o.zvals[2] = 1; + h2o.geom[2][0] = 0.000000000000; + h2o.geom[2][1] = -1.414995841403; + h2o.geom[2][2] = 0.971041753535; + + h2o.print_geom(); + h2o.translate(5, 0, 0); + h2o.print_geom(); + return 0; +} diff --git a/Mine/wikistart/wikistart2/V2/v1/water.o b/Mine/wikistart/wikistart2/V2/v1/water.o new file mode 100644 index 0000000..6580458 Binary files /dev/null and b/Mine/wikistart/wikistart2/V2/v1/water.o differ diff --git a/Mine/wikistart/wikistart2/V2/v1/water1.cc b/Mine/wikistart/wikistart2/V2/v1/water1.cc new file mode 100644 index 0000000..e9c75c6 --- /dev/null +++ b/Mine/wikistart/wikistart2/V2/v1/water1.cc @@ -0,0 +1,12 @@ +#include "molecule.h" + +using namespace std; + +int main(int argc, char *argv[]) +{ + Molecule h2o("geom.dat",0); + h2o.print_geom(); + h2o.translate(5, 0, 0); + h2o.print_geom(); + return 0; +} diff --git a/Mine/wikistart/wikistart2/V3/geom.dat b/Mine/wikistart/wikistart2/V3/geom.dat new file mode 100644 index 0000000..51c7b98 --- /dev/null +++ b/Mine/wikistart/wikistart2/V3/geom.dat @@ -0,0 +1,4 @@ +3 +8 0.000000000000 0.000000000000 -0.122368916506 +1 0.000000000000 1.414995841403 0.971041753535 +1 0.000000000000 -1.414995841403 0.971041753535 \ No newline at end of file diff --git a/Mine/wikistart/wikistart2/V3/molecule.cc b/Mine/wikistart/wikistart2/V3/molecule.cc new file mode 100644 index 0000000..3f2b177 --- /dev/null +++ b/Mine/wikistart/wikistart2/V3/molecule.cc @@ -0,0 +1,54 @@ +#include "molecule.h" +#include + +void Molecule::print_geom() +{ + for(int i=0; i < natom; i++) + printf("%d %8.5f %8.5f %8.5f\n", zvals[i], geom[i][0], geom[i][1], geom[i][2]); +} + +void Molecule::translate(double x, double y, double z) +{ + for(int i=0; i < natom; i++) { + geom[i][0] += x; + geom[i][1] += y; + geom[i][2] += z; + } +} + +#include +#include +#include +#include +#include + +Molecule::Molecule(const char *filename, int q) +{ + charge = q; + + // open filename + std::ifstream is(filename); + assert(is.good()); + + // read the number of atoms from filename + is >> natom; + + // allocate space + zvals = new int[natom]; + geom = new double* [natom]; + for(int i=0; i < natom; i++) + geom[i] = new double[3]; + + for(unsigned int i=0; i < natom; i++) + is >> zvals[i] >> geom[i][0] >> geom[i][1] >> geom[i][2]; + + is.close(); +} + +Molecule::~Molecule() +{ + delete[] zvals; + for(int i=0; i < natom; i++) + delete[] geom[i]; + delete[] geom; +} \ No newline at end of file diff --git a/Mine/wikistart/wikistart2/V3/molecule.h b/Mine/wikistart/wikistart2/V3/molecule.h new file mode 100644 index 0000000..f8e911a --- /dev/null +++ b/Mine/wikistart/wikistart2/V3/molecule.h @@ -0,0 +1,23 @@ +#include + +using namespace std; + +class Molecule +{ + public: + int natom; + int charge; + int *zvals; + double **geom; + string point_group; + + void print_geom(); + void rotate(double phi); + void translate(double x, double y, double z); + double bond(int atom1, int atom2); + double angle(int atom1, int atom2, int atom3); + double torsion(int atom1, int atom2, int atom3, int atom4); + + Molecule(const char *filename, int q); + ~Molecule(); +}; diff --git a/Mine/wikistart/wikistart2/V3/molecule.o b/Mine/wikistart/wikistart2/V3/molecule.o new file mode 100644 index 0000000..a47c86f Binary files /dev/null and b/Mine/wikistart/wikistart2/V3/molecule.o differ diff --git a/Mine/wikistart/wikistart2/V3/water b/Mine/wikistart/wikistart2/V3/water new file mode 100644 index 0000000..64c5bf5 Binary files /dev/null and b/Mine/wikistart/wikistart2/V3/water differ diff --git a/Mine/wikistart/wikistart2/V3/water.cc b/Mine/wikistart/wikistart2/V3/water.cc new file mode 100644 index 0000000..5319310 --- /dev/null +++ b/Mine/wikistart/wikistart2/V3/water.cc @@ -0,0 +1,14 @@ +#include "molecule.h" + +using namespace std; + +int main(int argc, char *argv[]) +{ + Molecule h2o("geom.dat", 0); + + h2o.print_geom(); + h2o.translate(5, 0, 0); + h2o.print_geom(); + + return 0; +} diff --git a/Mine/wikistart/wikistart2/V3/water.o b/Mine/wikistart/wikistart2/V3/water.o new file mode 100644 index 0000000..3bdf323 Binary files /dev/null and b/Mine/wikistart/wikistart2/V3/water.o differ diff --git a/Mine/wikistart/wikistart2/V3/water1.cc b/Mine/wikistart/wikistart2/V3/water1.cc new file mode 100644 index 0000000..e9c75c6 --- /dev/null +++ b/Mine/wikistart/wikistart2/V3/water1.cc @@ -0,0 +1,12 @@ +#include "molecule.h" + +using namespace std; + +int main(int argc, char *argv[]) +{ + Molecule h2o("geom.dat",0); + h2o.print_geom(); + h2o.translate(5, 0, 0); + h2o.print_geom(); + return 0; +} diff --git a/Mine/wikistart/wikistart2/v1/molecule.cc b/Mine/wikistart/wikistart2/v1/molecule.cc new file mode 100644 index 0000000..06fa86e --- /dev/null +++ b/Mine/wikistart/wikistart2/v1/molecule.cc @@ -0,0 +1,20 @@ +#include "molecule.h" +#include + +void Molecule::print_geom() +{ + for(int i=0; i < natom; i++) + printf("%d %8.5f %8.5f %8.5f\n", zvals[i], geom[i][0], geom[i][1], geom[i][2]); +} + +void Molecule::translate(double x, double y, double z) +{ + for(int i=0; i < natom; i++) { + geom[i][0] += x; + geom[i][1] += y; + geom[i][2] += z; + } +} + +Molecule::Molecule(){ } +Molecule::~Molecule(){ } diff --git a/Mine/wikistart/wikistart2/v1/molecule.h b/Mine/wikistart/wikistart2/v1/molecule.h new file mode 100644 index 0000000..8498464 --- /dev/null +++ b/Mine/wikistart/wikistart2/v1/molecule.h @@ -0,0 +1,23 @@ +#include + +using namespace std; + +class Molecule +{ + public: + int natom; + int charge; + int *zvals; + double **geom; + string point_group; + + void print_geom(); + void rotate(double phi); + void translate(double x, double y, double z); + double bond(int atom1, int atom2); + double angle(int atom1, int atom2, int atom3); + double torsion(int atom1, int atom2, int atom3, int atom4); + + Molecule(); + ~Molecule(); +}; diff --git a/Mine/wikistart/wikistart2/v1/molecule.o b/Mine/wikistart/wikistart2/v1/molecule.o new file mode 100644 index 0000000..b55d0d5 Binary files /dev/null and b/Mine/wikistart/wikistart2/v1/molecule.o differ diff --git a/Mine/wikistart/wikistart2/v1/water b/Mine/wikistart/wikistart2/v1/water new file mode 100644 index 0000000..512af31 Binary files /dev/null and b/Mine/wikistart/wikistart2/v1/water differ diff --git a/Mine/wikistart/wikistart2/v1/water.cc b/Mine/wikistart/wikistart2/v1/water.cc new file mode 100644 index 0000000..4796d5b --- /dev/null +++ b/Mine/wikistart/wikistart2/v1/water.cc @@ -0,0 +1,39 @@ +#include "molecule.h" + +using namespace std; + +int main(int argc, char *argv[]) +{ + Molecule h2o; + + h2o.natom = 3; + h2o.charge = 0; + h2o.zvals = new int[h2o.natom]; + h2o.geom = new double* [h2o.natom]; + for(int i=0; i < h2o.natom; i++) + h2o.geom[i] = new double[3]; + + h2o.zvals[0] = 8; + h2o.geom[0][0] = 0.000000000000; + h2o.geom[0][1] = 0.000000000000; + h2o.geom[0][2] = -0.122368916506; + h2o.zvals[1] = 1; + h2o.geom[1][0] = 0.000000000000; + h2o.geom[1][1] = 1.414995841403; + h2o.geom[1][2] = 0.971041753535; + h2o.zvals[2] = 1; + h2o.geom[2][0] = 0.000000000000; + h2o.geom[2][1] = -1.414995841403; + h2o.geom[2][2] = 0.971041753535; + + h2o.print_geom(); + h2o.translate(5, 0, 0); + h2o.print_geom(); + + delete[] h2o.zvals; + for(int i=0; i < h2o.natom; i++) + delete[] h2o.geom[i]; + delete[] h2o.geom; + + return 0; +} diff --git a/Mine/wikistart/wikistart2/v1/water.o b/Mine/wikistart/wikistart2/v1/water.o new file mode 100644 index 0000000..158f213 Binary files /dev/null and b/Mine/wikistart/wikistart2/v1/water.o differ diff --git a/Mine/wikistart/wikistart2/v1/water1.cc b/Mine/wikistart/wikistart2/v1/water1.cc new file mode 100644 index 0000000..e9c75c6 --- /dev/null +++ b/Mine/wikistart/wikistart2/v1/water1.cc @@ -0,0 +1,12 @@ +#include "molecule.h" + +using namespace std; + +int main(int argc, char *argv[]) +{ + Molecule h2o("geom.dat",0); + h2o.print_geom(); + h2o.translate(5, 0, 0); + h2o.print_geom(); + return 0; +} diff --git a/Mine/wikistart/wikistart4/con_stat.cc b/Mine/wikistart/wikistart4/con_stat.cc new file mode 100644 index 0000000..e69de29