Beispiel #1
0
#include "TestingMolecules.hpp"
#include "UniformDielectric.hpp"
#include "IEFSolver.hpp"
#include "Symmetry.hpp"

/*! \class IEFSolver
 *  \test \b NH3GePol tests IEFSolver using ammonia and a GePol cavity
 */
TEST_CASE("Test solver for the IEFPCM with NH3 molecule and a GePol cavity", "[solver][iefpcm][iefpcm_gepol-NH3]")
{
    Molecule molec = NH3();

    double area = 0.4;
    double probeRadius = 0.0;
    double minRadius = 100.0;
    GePolCavity cavity = GePolCavity(molec, area, probeRadius, minRadius);
    cavity.saveCavity("nh3.npz");

    double permittivity = 78.39;
    Vacuum<AD_directional, CollocationIntegrator> gfInside = Vacuum<AD_directional, CollocationIntegrator>();
    UniformDielectric<AD_directional, CollocationIntegrator> gfOutside =
    UniformDielectric<AD_directional, CollocationIntegrator>(permittivity);
    bool symm = true;
    IEFSolver solver(symm);
    solver.buildSystemMatrix(cavity, gfInside, gfOutside);

    double Ncharge = 7.0;
    double Hcharge = 1.0;
    size_t size = cavity.size();
    Eigen::VectorXd fake_mep = computeMEP(molec, cavity.elements());
    // The total ASC for a dielectric is -Q*(epsilon-1)/epsilon
#include "Molecule.hpp"
#include "Vacuum.hpp"
#include "UniformDielectric.hpp"
#include "CPCMSolver.hpp"
#include "TestingMolecules.hpp"

/*! \class CPCMSolver
 *  \test \b C2H4GePolD2h tests CPCMSolver using C2H4 with a GePol cavity in D2h symmetry
 */
TEST_CASE("Test solver for the CPCM and the C2H4 molecule in D2h symmetry", "[cpcm][cpcm_symmetry][cpcm_gepol-C2H4_D2h]")
{
  Molecule molec = C2H4();
  double area = 0.2 / convertBohr2ToAngstrom2;
  double probeRadius = 1.385 / convertBohrToAngstrom;
  double minRadius = 100.0 / convertBohrToAngstrom;
  GePolCavity cavity = GePolCavity(molec, area, probeRadius, minRadius, "cpcm_d2h_noadd");

  double permittivity = 78.39;
  Vacuum<AD_directional, CollocationIntegrator> gfInside = Vacuum<AD_directional, CollocationIntegrator>();
  UniformDielectric<AD_directional, CollocationIntegrator> gfOutside =
    UniformDielectric<AD_directional, CollocationIntegrator>(permittivity);
  bool symm = true;
  double correction = 0.0;

  CPCMSolver solver(symm, correction);
  solver.buildSystemMatrix(cavity, gfInside, gfOutside);

  double Ccharge = 6.0;
  double Hcharge = 1.0;
  size_t size = cavity.size();
  Eigen::VectorXd fake_mep = computeMEP(molec, cavity.elements());
#include "GePolCavity.hpp"
#include "PhysicalConstants.hpp"
#include "TestingMolecules.hpp"

SCENARIO("GePol cavity for a single sphere in different Abelian point groups", "[gepol][gepol_point_symmetry]")
{
    GIVEN("A single sphere")
    {
        double area = 0.4;
        double probeRadius = 0.0;
        double minRadius = 100.0;
        WHEN("the point group is C1")
        {
            Molecule point = dummy<0>();
            GePolCavity cavity = GePolCavity(point, area, probeRadius, minRadius, "c1");

            /*! \class GePolCavity
             *  \test \b GePolCavityC1Test_size tests GePol cavity size for a point charge in C1 symmetry with added spheres
             */
            THEN("the size of the cavity is")
            {
                int size = 32;
                size_t actualSize = cavity.size();
                REQUIRE(size == actualSize);
            }
            /*! \class GePolCavity
             *  \test \b GePolCavityC1Test_irreducible_size tests GePol cavity irreducible size for a point charge in C1 symmetry with added spheres
             */
            AND_THEN("the irreducible size of the cavity is")
            {
Beispiel #4
0
#include <vector>
#include <cmath>

#include "Config.hpp"

#include <Eigen/Core>

#include "GePolCavity.hpp"
#include "TestingMolecules.hpp"

TEST_CASE("GePol cavity for a single sphere", "[gepol][gepol_point]")
{
    double area = 0.4;
    Molecule point = dummy<0>();
    GePolCavity cavity = GePolCavity(point, area, 0.0, 100.0, "point");
    cavity.saveCavity("point.npz");

    /*! \class GePolCavity
     *  \test \b GePolCavityTest_size tests GePol cavity size for a point charge
     */
    SECTION("Test size")
    {
        int size = 32;
        size_t actualSize = cavity.size();
        REQUIRE(size == actualSize);
    }

    /*! \class GePolCavity
     *  \test \b GePolCavityTest_area tests GePol cavity surface area for a point charge
     */