Skip to content

Commit 6b5b629

Browse files
author
Roberto Di Remigio
committed
Add an additional molecule (H2O) for testing
1 parent 35a16b5 commit 6b5b629

File tree

1 file changed

+47
-6
lines changed

1 file changed

+47
-6
lines changed

tests/TestingMolecules.hpp

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
/*
33
* PCMSolver, an API for the Polarizable Continuum Model
44
* Copyright (C) 2013-2016 Roberto Di Remigio, Luca Frediani and contributors
5-
*
5+
*
66
* This file is part of PCMSolver.
7-
*
7+
*
88
* PCMSolver is free software: you can redistribute it and/or modify
99
* it under the terms of the GNU Lesser General Public License as published by
1010
* the Free Software Foundation, either version 3 of the License, or
1111
* (at your option) any later version.
12-
*
12+
*
1313
* PCMSolver is distributed in the hope that it will be useful,
1414
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1515
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1616
* GNU Lesser General Public License for more details.
17-
*
17+
*
1818
* You should have received a copy of the GNU Lesser General Public License
1919
* along with PCMSolver. If not, see <http://www.gnu.org/licenses/>.
20-
*
20+
*
2121
* For information on the complete list of contributors to the
2222
* PCMSolver API, see: <http://pcmsolver.readthedocs.io/>
2323
*/
@@ -73,6 +73,10 @@ inline Molecule C2H4();
7373
*/
7474
inline Molecule C6H6();
7575

76+
/*! Returns the water molecule with C1 symmetry
77+
*/
78+
inline Molecule H2O();
79+
7680
template <int group>
7781
Molecule dummy(double radius, const Eigen::Vector3d & center)
7882
{
@@ -508,10 +512,47 @@ Molecule C6H6()
508512
spheres.push_back(sph11);
509513
spheres.push_back(sph12);
510514

511-
// D2h as generated by Oxy, Oxz, Oyz
512515
Symmetry pGroup = buildGroup(0, 0, 0, 0);
513516

514517
return Molecule(nAtoms, charges, masses, geom, atoms, spheres, pGroup);
515518
};
516519

520+
Molecule H2O()
521+
{
522+
int nAtoms = 3;
523+
524+
// Geometry in atomic units
525+
Eigen::Vector3d H1( 0.0000000000, 0.0000000000, -0.2249058930);
526+
Eigen::Vector3d H2(-1.4523499293, 0.0000000000, 0.8996235720);
527+
Eigen::Vector3d O( 1.4523499293, 0.0000000000, 0.8996235720);
528+
529+
Eigen::MatrixXd geom(3, nAtoms);
530+
geom.col(0) = H1.transpose();
531+
geom.col(1) = H2.transpose();
532+
geom.col(2) = O.transpose();
533+
Eigen::Vector3d charges, masses;
534+
charges << 1.0, 1.0, 8.0;
535+
masses << 1.0078250, 1.0078250, 15.9949150;
536+
537+
double radiusO = (1.52 * 1.20) / bohrToAngstrom();
538+
double radiusH = (1.20 * 1.20) / bohrToAngstrom();
539+
std::vector<Atom> atoms;
540+
atoms.push_back( Atom("Hydrogen", "H", charges(0), masses(0), radiusH, H1, 1.0) );
541+
atoms.push_back( Atom("Hydrogen", "H", charges(1), masses(1), radiusH, H2, 1.0) );
542+
atoms.push_back( Atom("Oxygen", "O", charges(2), masses(2), radiusO, O, 1.0) );
543+
544+
std::vector<Sphere> spheres;
545+
Sphere sph1(H1, radiusH);
546+
Sphere sph2(H2, radiusH);
547+
Sphere sph3(O, radiusO);
548+
spheres.push_back(sph1);
549+
spheres.push_back(sph2);
550+
spheres.push_back(sph3);
551+
552+
Symmetry pGroup = buildGroup(0, 0, 0, 0);
553+
554+
return Molecule(nAtoms, charges, masses, geom, atoms, spheres, pGroup);
555+
};
556+
557+
517558
#endif // TESTINGMOLECULES_HPP

0 commit comments

Comments
 (0)