Cavities

We will here describe the inheritance hierarchy for generating cavities, in order to use and extend it properly. The runtime creation of cavity objects relies on the Factory Method pattern [GHJV94][Ale01], implemented through the generic Factory class.

../_images/cavity.svg

ICavity

class pcmICavity

Abstract Base Class for cavities.

This class represents a cavity made of spheres, its surface being discretized in terms of finite elements.

Author
Krzysztof Mozgawa
Date
2011

Subclassed by pcm::cavity::GePolCavity, pcm::cavity::RestartCavity

Public Functions

pcm::ICavityICavity()

Default constructor.

pcm::ICavityICavity(const Sphere &sph)

Constructor from a single sphere.

Only used when we have to deal with a single sphere, i.e. in the unit tests

Parameters
  • sph: the sphere

pcm::ICavityICavity(const std::vector<Sphere> &sph)

Constructor from list of spheres.

Only used when we have to deal with a single sphere, i.e. in the unit tests

Parameters
  • sph: the list of spheres

pcm::ICavityICavity(const Molecule &molec)

Constructor from Molecule.

Parameters
  • molec: the molecular aggregate

void pcm::ICavitysaveCavity(const std::string &fname = "cavity.npz")

Save cavity specification to file.

The cavity specification contains: 0. the number of finite elements, nElements;

  1. the weight of the finite elements, elementArea;
  2. the radius of the finite elements, elementRadius;
  3. the centers of the finite elements, elementCenter;
  4. the normal vectors relative to the centers, elementNormal. Each of these objects is saved in a separate .npy binary file and compressed into one .npz file. Notice that this is just the minimal set of data needed to restart an energy calculation.

void pcm::ICavityloadCavity(const std::string &fname = "cavity.npz")

Load cavity specification from file.

Protected Attributes

std::vector<Sphere> pcm::ICavityspheres_

List of spheres.

Molecule pcm::ICavitymolecule_

The molecule to be wrapped by the cavity.

PCMSolverIndex pcm::ICavitynElements_

Number of finite elements generated.

PCMSolverIndex pcm::ICavitynIrrElements_

Number of irreducible finite elements.

bool pcm::ICavitybuilt

Whether the cavity has been built.

Eigen::Matrix3Xd pcm::ICavityelementCenter_

Coordinates of elements centers.

Eigen::Matrix3Xd pcm::ICavityelementNormal_

Outward-pointing normal vectors to the elements centers.

Eigen::VectorXd pcm::ICavityelementArea_

Elements areas.

int pcm::ICavitynSpheres_

Number of spheres.

Eigen::Matrix3Xd pcm::ICavityelementSphereCenter_

Centers of the sphere the elements belong to.

Eigen::VectorXd pcm::ICavityelementRadius_

Radii of the sphere the elements belong to.

Eigen::Matrix3Xd pcm::ICavitysphereCenter_

Spheres centers.

Eigen::VectorXd pcm::ICavitysphereRadius_

Spheres radii.

std::vector<Element> pcm::ICavityelements_

List of finite elements.

Symmetry pcm::ICavitypointGroup_

Molecular point group.

Private Functions

virtual void pcm::ICavitymakeCavity() = 0

Creates the cavity and discretizes its surface.

Has to be implemented by classes lower down in the inheritance hierarchy

GePolCavity

class pcm::cavityGePolCavity : public pcm::ICavity

A class for GePol cavity.

This class is an interface to the Fortran code PEDRA for the generation of cavities according to the GePol algorithm.

Author
Krzysztof Mozgawa, Roberto Di Remigio
Date
2011, 2016

Private Functions

virtual void pcm::cavity::GePolCavitymakeCavity()

Creates the cavity and discretizes its surface.

Has to be implemented by classes lower down in the inheritance hierarchy

void GePolCavitybuild(const std::string &suffix, int maxts, int maxsp, int maxvert)

Driver for PEDRA Fortran module.

Parameters
  • suffix: for the cavity.off and PEDRA.OUT files, the PID will also be added
  • maxts: maximum number of tesserae
  • maxsp: maximum number of spheres (original + added)
  • maxvert: maximum number of vertices

void GePolCavitywriteOFF(const std::string &suffix)

Writes the cavity.off file for visualizing the cavity.

Parameters
  • suffix: for the cavity.off The full name of the visualization file will be cavity.off_suffix_PID

RestartCavity

class pcm::cavityRestartCavity : public pcm::ICavity

A class for Restart cavity.

Author
Roberto Di Remigio
Date
2014

Public Functions

virtual void pcm::cavity::RestartCavitymakeCavity()

Creates the cavity and discretizes its surface.

Has to be implemented by classes lower down in the inheritance hierarchy