Molecule H2() { int nAtoms = 2; Eigen::Vector3d H1( 0.735000, 0.000000, 0.000000); Eigen::Vector3d H2(-0.735000, 0.000000, 0.000000); Eigen::MatrixXd geom(3, nAtoms); geom.col(0) = H1.transpose(); geom.col(1) = H2.transpose(); Eigen::Vector2d charges, masses; charges << 1.0, 1.0; masses << 1.0078250, 1.0078250; std::vector<Atom> atoms; double radiusH = 1.20; atoms.push_back( Atom("Hydrogen", "H", charges(0), masses(0), radiusH, H1, 1.0) ); atoms.push_back( Atom("Hydrogen", "H", charges(1), masses(1), radiusH, H2, 1.0) ); std::vector<Sphere> spheres; Sphere sph2(H1, radiusH); Sphere sph3(H2, radiusH); spheres.push_back(sph2); spheres.push_back(sph3); Symmetry pGroup = buildGroup(0, 0, 0, 0); return Molecule(nAtoms, charges, masses, geom, atoms, spheres, pGroup); };
void OneCLJGenerator::addParticle(int id, double x, double y, double z, ParticleContainer* particleContainer, Domain* domain, DomainDecompBase* domainDecomp) { vector<Component>& dcomponents = domain->getComponents(); vector<double> v_; v_.resize(3); // Velocity for (int dim = 0; dim < 3; dim++) { v_[dim] = randdouble(-0.5, 0.5); } double dotprod_v = 0; for (unsigned int i = 0; i < v_.size(); i++) { dotprod_v += v_[i] * v_[i]; } // Velocity Correction double vCorr = sqrt(3.0 * _temperature / dotprod_v); for (unsigned int i = 0; i < v_.size(); i++) { v_[i] *= vCorr; } Molecule m1 = Molecule(id, 0, x, y, z, v_[0], v_[1], v_[2], 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, &dcomponents); particleContainer->addParticle(m1); //dcomponents[0].incrnumMolecules(); //domain->setglobalRotDOF(dcomponents[0].rot_dof()+domain->getglobalRotDOF()); }
Molecule C2H4() { int nAtoms = 6; Eigen::Vector3d C1(0.0000000000, 0.0000000000, 1.2578920000); Eigen::Vector3d H1(0.0000000000, 1.7454620000, 2.3427160000); Eigen::Vector3d H2(0.0000000000, -1.7454620000, 2.3427160000); Eigen::Vector3d C2(0.0000000000, 0.0000000000, -1.2578920000); Eigen::Vector3d H3(0.0000000000, 1.7454620000, -2.3427160000); Eigen::Vector3d H4(0.0000000000, -1.7454620000, -2.3427160000); Eigen::MatrixXd geom(3, nAtoms); geom.col(0) = C1.transpose(); geom.col(1) = H1.transpose(); geom.col(2) = H2.transpose(); geom.col(3) = C2.transpose(); geom.col(4) = H3.transpose(); geom.col(5) = H4.transpose(); Eigen::VectorXd charges(6), masses(6); charges << 6.0, 1.0, 1.0, 6.0, 1.0, 1.0; masses << 12.00, 1.0078250, 1.0078250, 12.0, 1.0078250, 1.0078250; double radiusC = (1.70 * 1.20) / convertBohrToAngstrom; double radiusH = (1.20 * 1.20) / convertBohrToAngstrom; std::vector<Atom> atoms; atoms.push_back( Atom("Carbon", "C", charges(0), masses(0), radiusC, C1, 1.0) ); atoms.push_back( Atom("Hydrogen", "H", charges(1), masses(1), radiusH, H1, 1.0) ); atoms.push_back( Atom("Hydrogen", "H", charges(2), masses(2), radiusH, H2, 1.0) ); atoms.push_back( Atom("Carbon", "C", charges(3), masses(3), radiusC, C2, 1.0) ); atoms.push_back( Atom("Hydrogen", "H", charges(4), masses(4), radiusH, H3, 1.0) ); atoms.push_back( Atom("Hydrogen", "H", charges(5), masses(5), radiusH, H4, 1.0) ); std::vector<Sphere> spheres; Sphere sph1(C1, radiusC); Sphere sph2(H1, radiusH); Sphere sph3(H2, radiusH); Sphere sph4(C2, radiusC); Sphere sph5(H3, radiusH); Sphere sph6(H4, radiusH); spheres.push_back(sph1); spheres.push_back(sph2); spheres.push_back(sph3); spheres.push_back(sph4); spheres.push_back(sph5); spheres.push_back(sph6); // D2h as generated by Oxy, Oxz, Oyz Symmetry pGroup = buildGroup(3, 4, 2, 1); return Molecule(nAtoms, charges, masses, geom, atoms, spheres, pGroup); };
Box::Box() { changedMol = Molecule(); environment = NULL; atoms = NULL; molecules = NULL; bonds = NULL; angles = NULL; dihedrals = NULL; hops = NULL; atomCount = 0; moleculeCount = 0; }
Molecule H3() { int nAtoms = 3; Eigen::Vector3d H1( 0.735000, 0.000000, -1.333333); Eigen::Vector3d H2(-0.735000, 0.000000, -1.333333); Eigen::Vector3d H3( 0.000000, 0.000000, 2.666667); Eigen::MatrixXd geom(3, nAtoms); geom.col(0) = H1.transpose(); geom.col(1) = H2.transpose(); geom.col(2) = H3.transpose(); Eigen::Vector3d charges, masses; charges << 1.0, 1.0, 1.0; masses << 1.0078250, 1.0078250, 1.0078250; std::vector<Atom> atoms; double radiusH = (1.20 * 1.20) / convertBohrToAngstrom; atoms.push_back( Atom("Hydrogen", "H", charges(0), masses(0), radiusH, H1, 1.0) ); atoms.push_back( Atom("Hydrogen", "H", charges(1), masses(1), radiusH, H2, 1.0) ); atoms.push_back( Atom("Hydrogen", "H", charges(2), masses(2), radiusH, H3, 1.0) ); std::vector<Sphere> spheres; Sphere sph2(H1, radiusH); Sphere sph3(H2, radiusH); Sphere sph4(H3, radiusH); spheres.push_back(sph2); spheres.push_back(sph3); spheres.push_back(sph4); enum pointGroup { pgC1, pgC2, pgCs, pgCi, pgD2, pgC2v, pgC2h, pgD2h }; Symmetry pGroup; switch(group) { case(pgC1): pGroup = buildGroup(0, 0, 0, 0); break; case(pgC2v): // C2v as generated by Oyz and Oxz pGroup = buildGroup(2, 1, 2, 0); break; default: pGroup = buildGroup(0, 0, 0, 0); break; } return Molecule(nAtoms, charges, masses, geom, atoms, spheres, pGroup); };
Molecule NH3() { int nAtoms = 4; Eigen::Vector3d N( -0.000000000, -0.104038047, 0.000000000); Eigen::Vector3d H1(-0.901584415, 0.481847022, -1.561590016); Eigen::Vector3d H2(-0.901584415, 0.481847022, 1.561590016); Eigen::Vector3d H3( 1.803168833, 0.481847022, 0.000000000); Eigen::MatrixXd geom(3, nAtoms); geom.col(0) = N.transpose(); geom.col(1) = H1.transpose(); geom.col(2) = H2.transpose(); geom.col(3) = H3.transpose(); Eigen::Vector4d charges, masses; charges << 7.0, 1.0, 1.0, 1.0; masses << 14.0030740, 1.0078250, 1.0078250, 1.0078250; std::vector<Atom> atoms; atoms.push_back( Atom("Nitrogen", "N", charges(0), masses(0), 2.929075493, N, 1.0) ); atoms.push_back( Atom("Hydrogen", "H", charges(1), masses(1), 2.267671349, H1, 1.0) ); atoms.push_back( Atom("Hydrogen", "H", charges(2), masses(2), 2.267671349, H2, 1.0) ); atoms.push_back( Atom("Hydrogen", "H", charges(3), masses(3), 2.267671349, H3, 1.0) ); std::vector<Sphere> spheres; Sphere sph1(N, 2.929075493); Sphere sph2(H1, 2.267671349); Sphere sph3(H2, 2.267671349); Sphere sph4(H3, 2.267671349); spheres.push_back(sph1); spheres.push_back(sph2); spheres.push_back(sph3); spheres.push_back(sph4); // C1 Symmetry pGroup = buildGroup(0, 0, 0, 0); return Molecule(nAtoms, charges, masses, geom, atoms, spheres, pGroup); };
Molecule CH3() { int nAtoms = 4; Eigen::Vector3d C1( 0.0006122714, 0.0000000000, 0.0000000000); Eigen::Vector3d H1( 1.5162556382, -1.3708721537, 0.0000000000); Eigen::Vector3d H2(-0.7584339548, 0.6854360769, 1.7695110698); Eigen::Vector3d H3(-0.7584339548, 0.6854360769, -1.7695110698); Eigen::MatrixXd geom(3, nAtoms); geom.col(0) = C1.transpose(); geom.col(1) = H1.transpose(); geom.col(2) = H2.transpose(); geom.col(3) = H3.transpose(); Eigen::Vector4d charges, masses; charges << 6.0, 1.0, 1.0, 1.0; masses << 12.00, 1.0078250, 1.0078250, 1.0078250; double radiusC = (1.70 * 1.20) / convertBohrToAngstrom; double radiusH = (1.20 * 1.20) / convertBohrToAngstrom; std::vector<Atom> atoms; atoms.push_back( Atom("Carbon", "C", charges(0), masses(0), radiusC, C1, 1.0) ); atoms.push_back( Atom("Hydrogen", "H", charges(1), masses(1), radiusH, H1, 1.0) ); atoms.push_back( Atom("Hydrogen", "H", charges(2), masses(2), radiusH, H2, 1.0) ); atoms.push_back( Atom("Hydrogen", "H", charges(3), masses(3), radiusH, H3, 1.0) ); std::vector<Sphere> spheres; Sphere sph1(C1, radiusC); Sphere sph2(H1, radiusH); Sphere sph3(H2, radiusH); Sphere sph4(H3, radiusH); spheres.push_back(sph1); spheres.push_back(sph2); spheres.push_back(sph3); spheres.push_back(sph4); // Cs as generated by Oxy Symmetry pGroup = buildGroup(1, 4, 0, 0); return Molecule(nAtoms, charges, masses, geom, atoms, spheres, pGroup); };
Molecule kmeans(ABCbls const &clusterables, int64_t nclusters) { if (clusterables.size() < std::size_t(nclusters)) { nclusters = clusterables.size(); } auto objective_min = std::numeric_limits<double>::max(); int64_t init_seed = 1000; int64_t best_seed = 1000; for (auto i = 0; i < 50; ++i) { math::clustering::Kmeans kmeans(init_seed); auto clusters = kmeans.cluster<AtomBasedCluster>(clusterables, nclusters); auto value = math::clustering::kmeans_objective(clusters); if (value < objective_min) { best_seed = init_seed; objective_min = value; } init_seed += 1000; } return Molecule(convert_to_clusterable( math::clustering::Kmeans(best_seed).cluster<AtomBasedCluster>(clusterables, nclusters))); }
void Input::reader(const std::string & filename) { Getkw input_ = Getkw(filename, false, true); units_ = input_.getStr("UNITS"); CODATAyear_ = input_.getInt("CODATA"); initBohrToAngstrom(bohrToAngstrom, CODATAyear_); const Section & mol = input_.getSect("MOLECULE"); MEPfromMolecule_ = true; if (mol.isDefined()) { geometry_ = mol.getDblVec("GEOMETRY"); MEPfromMolecule_ = mol.getBool("MEP"); } const Section & cavity = input_.getSect("CAVITY"); cavityType_ = cavity.getStr("TYPE"); area_ = cavity.getDbl("AREA"); if (cavityType_ == "RESTART") { cavFilename_ = cavity.getStr("NPZFILE"); } scaling_ = cavity.getBool("SCALING"); radiiSet_ = detail::uppercase(cavity.getStr("RADIISET")); minimalRadius_ = cavity.getDbl("MINRADIUS"); mode_ = detail::uppercase(cavity.getStr("MODE")); if (mode_ == "EXPLICIT") { std::vector<double> spheresInput = cavity.getDblVec("SPHERES"); int j = 0; int nAtoms = int(spheresInput.size() / 4); for (int i = 0; i < nAtoms; ++i) { Eigen::Vector3d center; center = (Eigen::Vector3d() << spheresInput[j], spheresInput[j + 1], spheresInput[j + 2]) .finished(); Sphere sph(center, spheresInput[j + 3]); spheres_.push_back(sph); j += 4; } // Initialize molecule from spheres only when molecule section is absent if (!mol.isDefined()) molecule_ = Molecule(spheres_); } else if (mode_ == "ATOMS") { atoms_ = cavity.getIntVec("ATOMS"); radii_ = cavity.getDblVec("RADII"); } // Get the contents of the Medium section const Section & medium = input_.getSect("MEDIUM"); // Get the name of the solvent std::string name = medium.getStr("SOLVENT"); if (name == "EXPLICIT") { hasSolvent_ = false; // Get the probe radius probeRadius_ = medium.getDbl("PROBERADIUS"); // Get the contents of the Green<inside> section... const Section & inside = medium.getSect("GREEN<INSIDE>"); // ...and initialize the data members greenInsideType_ = inside.getStr("TYPE") + "_" + inside.getStr("DER"); epsilonInside_ = inside.getDbl("EPS"); // Get the contents of the Green<outside> section... const Section & outside = medium.getSect("GREEN<OUTSIDE>"); // ...and initialize the data members greenOutsideType_ = outside.getStr("TYPE") + "_" + outside.getStr("DER"); epsilonStaticOutside_ = outside.getDbl("EPS"); epsilonDynamicOutside_ = outside.getDbl("EPSDYN"); epsilonStatic1_ = outside.getDbl("EPS1"); epsilonDynamic1_ = outside.getDbl("EPSDYN1"); epsilonStatic2_ = outside.getDbl("EPS2"); epsilonDynamic2_ = outside.getDbl("EPSDYN2"); center_ = outside.getDbl("CENTER"); width_ = outside.getDbl("WIDTH"); origin_ = outside.getDblVec("INTERFACEORIGIN"); if (outside.getStr("TYPE") == "SPHERICALDIFFUSE") { greenOutsideType_ += "_" + outside.getStr("PROFILE"); } maxL_ = outside.getInt("MAXL"); } else { // This part must be reviewed!! Some data members are not initialized... // Just initialize the solvent object in this class hasSolvent_ = true; if (solvents().find(name) == solvents().end()) { PCMSOLVER_ERROR("Solvent " + name + " NOT found!"); } else { solvent_ = solvents()[name]; } probeRadius_ = solvent_.probeRadius * angstromToBohr(); // Specification of the solvent by name means isotropic PCM // We have to initialize the Green's functions data here, Solvent class // is an helper class and should not be used in the core classes. greenInsideType_ = "VACUUM_DERIVATIVE"; epsilonInside_ = 1.0; greenOutsideType_ = "UNIFORMDIELECTRIC_DERIVATIVE"; epsilonStaticOutside_ = solvent_.epsStatic; epsilonDynamicOutside_ = solvent_.epsDynamic; } integratorType_ = medium.getStr("DIAGONALINTEGRATOR"); integratorScaling_ = medium.getDbl("DIAGONALSCALING"); solverType_ = medium.getStr("SOLVERTYPE"); correction_ = medium.getDbl("CORRECTION"); hermitivitize_ = medium.getBool("MATRIXSYMM"); isDynamic_ = medium.getBool("NONEQUILIBRIUM"); const Section & chgdist = input_.getSect("CHARGEDISTRIBUTION"); if (chgdist.isDefined()) { // Set monopoles if (chgdist.getKey<std::vector<double> >("MONOPOLES").isDefined()) { std::vector<double> mono = chgdist.getDblVec("MONOPOLES"); int j = 0; int n = int(mono.size() / 4); multipoles_.monopoles = Eigen::VectorXd::Zero(n); multipoles_.monopolesSites = Eigen::Matrix3Xd::Zero(3, n); for (int i = 0; i < n; ++i) { multipoles_.monopolesSites.col(i) = (Eigen::Vector3d() << mono[j], mono[j + 1], mono[j + 2]).finished(); multipoles_.monopoles(i) = mono[j + 3]; j += 4; } } // Set dipoles if (chgdist.getKey<std::vector<double> >("DIPOLES").isDefined()) { std::vector<double> dipo = chgdist.getDblVec("DIPOLES"); int j = 0; int n = int(dipo.size() / 6); multipoles_.dipoles = Eigen::Matrix3Xd::Zero(3, n); multipoles_.dipolesSites = Eigen::Matrix3Xd::Zero(3, n); for (int i = 0; i < n; ++i) { multipoles_.dipolesSites.col(i) = (Eigen::Vector3d() << dipo[j], dipo[j + 1], dipo[j + 2]).finished(); multipoles_.dipoles.col(i) = (Eigen::Vector3d() << dipo[j + 3], dipo[j + 4], dipo[j + 5]).finished(); j += 6; } } } providedBy_ = std::string("API-side"); }
void Input::initMolecule() { // Gather information necessary to build molecule_ // 1. number of atomic centers int nuclei = int(geometry_.size() / 4); // 2. position and charges of atomic centers Eigen::Matrix3Xd centers = Eigen::Matrix3Xd::Zero(3, nuclei); Eigen::VectorXd charges = Eigen::VectorXd::Zero(nuclei); int j = 0; for (int i = 0; i < nuclei; ++i) { centers.col(i) = (Eigen::Vector3d() << geometry_[j], geometry_[j + 1], geometry_[j + 2]) .finished(); charges(i) = geometry_[j + 3]; j += 4; } // 3. list of atoms and list of spheres std::vector<Atom> radiiSet; std::vector<Atom> atoms; atoms.reserve(nuclei); // FIXME Code duplication in function initMolecule in interface/Meddle.cpp tie(radiiSetName_, radiiSet) = utils::bootstrapRadiiSet().create(radiiSet_); for (int i = 0; i < charges.size(); ++i) { int index = int(charges(i)) - 1; atoms.push_back(radiiSet[index]); if (scaling_) atoms[i].radiusScaling = 1.2; } // Based on the creation mode (Implicit or Atoms) // the spheres list might need postprocessing if (mode_ == "IMPLICIT" || mode_ == "ATOMS") { for (int i = 0; i < charges.size(); ++i) { // Convert to Bohr and multiply by scaling factor (alpha) double radius = atoms[i].radius * angstromToBohr() * atoms[i].radiusScaling; spheres_.push_back(Sphere(centers.col(i), radius)); } if (mode_ == "ATOMS") { // Loop over the atomsInput array to get which atoms will have a user-given // radius for (size_t i = 0; i < atoms_.size(); ++i) { int index = atoms_[i] - 1; // -1 to go from human readable to machine readable // Put the new Sphere in place of the implicit-generated one spheres_[index] = Sphere(centers.col(index), radii_[i]); } } } // 4. masses Eigen::VectorXd masses = Eigen::VectorXd::Zero(nuclei); for (int i = 0; i < masses.size(); ++i) { masses(i) = atoms[i].mass; } // 5. molecular point group // FIXME currently hardcoded to C1 // OK, now get molecule_ molecule_ = Molecule(nuclei, charges, masses, centers, atoms, spheres_); // Check that all atoms have a radius attached std::vector<Atom>::const_iterator res = std::find_if(atoms.begin(), atoms.end(), invalid); if (res != atoms.end()) { std::cout << molecule_ << std::endl; PCMSOLVER_ERROR("Some atoms do not have a radius attached. Please specify a " "radius for all atoms (see " "http://pcmsolver.readthedocs.org/en/latest/users/input.html)!"); } }
Molecule C6H6() { int nAtoms = 12; // These are in Angstrom Eigen::Vector3d C1(5.274, 1.999, -8.568); Eigen::Vector3d C2(6.627, 2.018, -8.209); Eigen::Vector3d C3(7.366, 0.829, -8.202); Eigen::Vector3d C4(6.752, -0.379, -8.554); Eigen::Vector3d C5(5.399, -0.398, -8.912); Eigen::Vector3d C6(4.660, 0.791, -8.919); Eigen::Vector3d H1(4.704, 2.916, -8.573); Eigen::Vector3d H2(7.101, 2.950, -7.938); Eigen::Vector3d H3(8.410, 0.844, -7.926); Eigen::Vector3d H4(7.322, -1.296, -8.548); Eigen::Vector3d H5(4.925, -1.330, -9.183); Eigen::Vector3d H6(3.616, 0.776, -9.196); // Scale C1 /= convertBohrToAngstrom; C2 /= convertBohrToAngstrom; C3 /= convertBohrToAngstrom; C4 /= convertBohrToAngstrom; C5 /= convertBohrToAngstrom; C6 /= convertBohrToAngstrom; H1 /= convertBohrToAngstrom; H2 /= convertBohrToAngstrom; H3 /= convertBohrToAngstrom; H4 /= convertBohrToAngstrom; H5 /= convertBohrToAngstrom; H6 /= convertBohrToAngstrom; Eigen::MatrixXd geom(3, nAtoms); geom.col(0) = C1.transpose(); geom.col(1) = C2.transpose(); geom.col(2) = C3.transpose(); geom.col(3) = C4.transpose(); geom.col(4) = C5.transpose(); geom.col(5) = C6.transpose(); geom.col(6) = H1.transpose(); geom.col(7) = H2.transpose(); geom.col(8) = H3.transpose(); geom.col(9) = H4.transpose(); geom.col(10) = H5.transpose(); geom.col(11) = H6.transpose(); Eigen::VectorXd charges(12), masses(12); charges << 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0; masses << 12.00, 12.0, 12.0, 12.0, 12.0, 12.0, 1.0078250, 1.0078250, 1.0078250, 1.0078250, 1.0078250, 1.0078250; double radiusC = 1.70 / convertBohrToAngstrom; double radiusH = 1.20 / convertBohrToAngstrom; std::vector<Atom> atoms; atoms.push_back( Atom("Carbon", "C", charges(0), masses(0), radiusC, C1, 1.0) ); atoms.push_back( Atom("Carbon", "C", charges(1), masses(1), radiusC, C2, 1.0) ); atoms.push_back( Atom("Carbon", "C", charges(2), masses(2), radiusC, C3, 1.0) ); atoms.push_back( Atom("Carbon", "C", charges(3), masses(3), radiusC, C4, 1.0) ); atoms.push_back( Atom("Carbon", "C", charges(4), masses(4), radiusC, C5, 1.0) ); atoms.push_back( Atom("Carbon", "C", charges(5), masses(5), radiusC, C6, 1.0) ); atoms.push_back( Atom("Hydrogen", "H", charges(6), masses(6), radiusH, H1, 1.0) ); atoms.push_back( Atom("Hydrogen", "H", charges(7), masses(7), radiusH, H2, 1.0) ); atoms.push_back( Atom("Hydrogen", "H", charges(8), masses(8), radiusH, H3, 1.0) ); atoms.push_back( Atom("Hydrogen", "H", charges(9), masses(9), radiusH, H4, 1.0) ); atoms.push_back( Atom("Hydrogen", "H", charges(10), masses(10), radiusH, H5, 1.0) ); atoms.push_back( Atom("Hydrogen", "H", charges(11), masses(11), radiusH, H6, 1.0) ); std::vector<Sphere> spheres; Sphere sph1(C1, radiusC); Sphere sph2(C2, radiusC); Sphere sph3(C3, radiusC); Sphere sph4(C4, radiusC); Sphere sph5(C5, radiusC); Sphere sph6(C6, radiusC); Sphere sph7(H1, radiusH); Sphere sph8(H2, radiusH); Sphere sph9(H3, radiusH); Sphere sph10(H4, radiusH); Sphere sph11(H5, radiusH); Sphere sph12(H6, radiusH); spheres.push_back(sph1); spheres.push_back(sph2); spheres.push_back(sph3); spheres.push_back(sph4); spheres.push_back(sph5); spheres.push_back(sph6); spheres.push_back(sph7); spheres.push_back(sph8); spheres.push_back(sph9); spheres.push_back(sph10); spheres.push_back(sph11); spheres.push_back(sph12); // D2h as generated by Oxy, Oxz, Oyz Symmetry pGroup = buildGroup(0, 0, 0, 0); return Molecule(nAtoms, charges, masses, geom, atoms, spheres, pGroup); };
Molecule CO2() { int nAtoms = 3; Eigen::Vector3d C1( 0.0000000000, 0.0000000000, 0.0000000000); Eigen::Vector3d O1( 2.1316110791, 0.0000000000, 0.0000000000); Eigen::Vector3d O2(-2.1316110791, 0.0000000000, 0.0000000000); Eigen::MatrixXd geom(3, nAtoms); geom.col(0) = C1.transpose(); geom.col(1) = O1.transpose(); geom.col(2) = O2.transpose(); Eigen::Vector3d charges, masses; charges << 6.0, 8.0, 8.0; masses << 12.00, 15.9949150, 15.9949150; std::vector<Atom> atoms; double radiusC = (1.70 * 1.20) / convertBohrToAngstrom; double radiusO = (1.52 * 1.20) / convertBohrToAngstrom; atoms.push_back( Atom("Carbon", "C", charges(0), masses(0), radiusC, C1, 1.0) ); atoms.push_back( Atom("Oxygen", "O", charges(1), masses(1), radiusO, O1, 1.0) ); atoms.push_back( Atom("Oxygen", "O", charges(2), masses(2), radiusO, O2, 1.0) ); std::vector<Sphere> spheres; Sphere sph1(C1, radiusC); Sphere sph2(O1, radiusO); Sphere sph3(O2, radiusO); spheres.push_back(sph1); spheres.push_back(sph2); spheres.push_back(sph3); enum pointGroup { pgC1, pgC2, pgCs, pgCi, pgD2, pgC2v, pgC2h, pgD2h }; Symmetry pGroup; switch(group) { case(pgC1): pGroup = buildGroup(0, 0, 0, 0); break; case(pgC2): // C2 as generated by C2z pGroup = buildGroup(1, 3, 0, 0); break; case(pgCs): // Cs as generated by Oyz pGroup = buildGroup(1, 1, 0, 0); break; case(pgCi): // Ci as generated by i pGroup = buildGroup(1, 7, 0, 0); break; case(pgD2): // D2 as generated by C2z and C2x pGroup = buildGroup(2, 3, 6, 0); break; case(pgC2v): // C2v as generated by Oyz and Oxz pGroup = buildGroup(2, 1, 2, 0); break; case(pgC2h): // C2h as generated by Oxy and i pGroup = buildGroup(2, 4, 7, 0); break; case(pgD2h): // D2h as generated by Oxy, Oxz and Oyz pGroup = buildGroup(3, 4, 2, 1); break; default: pGroup = buildGroup(0, 0, 0, 0); break; } return Molecule(nAtoms, charges, masses, geom, atoms, spheres, pGroup); };