Skip to content

Add TsLess sources #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

## [Unreleased]

## [Version 2.0.0-alpha1] - 2019-04-XY

We have introduced a number of breaking changes, motivated by the need to
modernize the library.

- The version 1 release series is available in the archived repository [PCMSolver/pcmsolver_v1]

### Added

- A new cavity generator using C. S. Pomelli's [TsLess algorithm](http://dx.doi.org/10.1002/jcc.20076)

### Changed

- **BREAKING** We require a fully compliant C++14 compiler.
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ add_subdirectory(interface)
add_subdirectory(pedra)
add_subdirectory(solver)
add_subdirectory(utils)
add_subdirectory(tsless)

add_library(pcm $<TARGET_OBJECTS:pcm-object>)

Expand Down
2 changes: 2 additions & 0 deletions src/cavity/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ target_sources(pcm-object
${CMAKE_CURRENT_LIST_DIR}/GePolCavity.cpp
${CMAKE_CURRENT_LIST_DIR}/ICavity.cpp
${CMAKE_CURRENT_LIST_DIR}/RestartCavity.cpp
${CMAKE_CURRENT_LIST_DIR}/TsLessCavity.cpp
)

# List of headers
Expand All @@ -14,6 +15,7 @@ list(APPEND headers_list
GePolCavity.hpp
ICavity.hpp
RestartCavity.hpp
TsLessCavity.hpp
)
# Sets install directory for all the headers in the list
foreach(_header IN LISTS headers_list)
Expand Down
2 changes: 2 additions & 0 deletions src/cavity/Cavity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "GePolCavity.hpp"
#include "ICavity.hpp"
#include "RestartCavity.hpp"
#include "TsLessCavity.hpp"
#include "utils/Factory.hpp"

/*!
Expand All @@ -49,6 +50,7 @@ inline Factory<detail::CreateCavity> bootstrapFactory() {

factory_.subscribe("GEPOL", createGePolCavity);
factory_.subscribe("RESTART", createRestartCavity);
factory_.subscribe("TSLESS", createTsLessCavity);

return factory_;
}
Expand Down
10 changes: 10 additions & 0 deletions src/cavity/CavityData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ struct CavityData {
double area;
/*! The radius of the spherical probe representing the solvent */
double probeRadius;
/*! The minimal distance between two sampling points on different spheres. Relevant
* for TsLessCavity */
double minDistance;
/*! The maximum derivative order to be used in the definition of the smoothing
* function. Relevant for TsLessCavity */
int derOrder;
/*! Triggers the addition of spheres not centered on atoms, relevant for
* GePolCavity */
double minimalRadius;
Expand All @@ -50,12 +56,16 @@ struct CavityData {
const Molecule & _molec,
double _area,
double _probeRadius,
double _minDistance,
int _derOrder,
double _minRadius,
const std::string & _fname)
: cavityType(type),
molecule(_molec),
area(_area),
probeRadius(_probeRadius),
minDistance(_minDistance),
derOrder(_derOrder),
minimalRadius(_minRadius),
filename(_fname) {}
};
Expand Down
72 changes: 36 additions & 36 deletions src/cavity/GePolCavity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void GePolCavity::build(const std::string & suffix,
int maxsph,
int maxvert) {

// This is a wrapper for the generatecavity_cpp function defined in the Fortran
// This is a wrapper for the pedra_driver function defined in the Fortran
// code PEDRA.
// Here we allocate the necessary arrays to be passed to PEDRA, in particular we
// allow
Expand Down Expand Up @@ -172,41 +172,41 @@ void GePolCavity::build(const std::string & suffix,
pedra << "PEDRA.OUT_" << suffix << "_" << getpid();
int len_f_pedra = std::strlen(pedra.str().c_str());
// Go PEDRA, Go!
timer::timerON("GePolCavity::generatecavity_cpp");
generatecavity_cpp(&maxts,
&maxsph,
&maxvert,
xtscor,
ytscor,
ztscor,
ar,
xsphcor,
ysphcor,
zsphcor,
rsph,
&nts,
&ntsirr,
&nSpheres_,
&addedSpheres,
xe,
ye,
ze,
rin,
mass,
&averageArea,
&probeRadius,
&minimalRadius,
&nr_gen,
&gen1,
&gen2,
&gen3,
nvert,
vert,
centr,
isphe,
pedra.str().c_str(),
&len_f_pedra);
timer::timerOFF("GePolCavity::generatecavity_cpp");
timer::timerON("GePolCavity::pedra_driver");
pedra_driver(&maxts,
&maxsph,
&maxvert,
xtscor,
ytscor,
ztscor,
ar,
xsphcor,
ysphcor,
zsphcor,
rsph,
&nts,
&ntsirr,
&nSpheres_,
&addedSpheres,
xe,
ye,
ze,
rin,
mass,
&averageArea,
&probeRadius,
&minimalRadius,
&nr_gen,
&gen1,
&gen2,
&gen3,
nvert,
vert,
centr,
isphe,
pedra.str().c_str(),
&len_f_pedra);
timer::timerOFF("GePolCavity::pedra_driver");

// The "intensive" part of updating the spheres related class data members will be
// of course
Expand Down
79 changes: 34 additions & 45 deletions src/cavity/GePolCavity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,7 @@ class GePolCavity final : public ICavity {
void writeOFF(const std::string & suffix);
};

/*! \fn extern "C" void generatecavity_cpp(int * maxts, int * maxsph, int * maxvert,
* double * xtscor, double * ytscor, double * ztscor,
* double * ar,
* double * xsphcor, double * ysphcor, double *
* zsphcor, double * rsph,
* int * nts, int * ntsirr, int * nesfp, int *
* addsph,
* double * xe, double * ye, double * ze, double *
* rin,
* double * avgArea, double * rsolv, double * ret,
* int * nr_gen, int * gen1, int * gen2, int * gen3,
* int * nvert, double * vert, double * centr)
/*! \brief Interface to the Fortran PEDRA code
* \param[in] maxts maximum number of tesserae allowed
* \param[in] maxsph maximum number of spheres allowed
* \param[in] maxvert maximum number of vertices allowed
Expand Down Expand Up @@ -139,39 +128,39 @@ class GePolCavity final : public ICavity {
* \param[out] vert coordinates of tesserae vertices
* \param[out] centr centers of arcs defining the edges of the tesserae
*/
extern "C" void generatecavity_cpp(int * maxts,
int * maxsph,
int * maxvert,
double * xtscor,
double * ytscor,
double * ztscor,
double * ar,
double * xsphcor,
double * ysphcor,
double * zsphcor,
double * rsph,
int * nts,
int * ntsirr,
int * nesfp,
int * addsph,
double * xe,
double * ye,
double * ze,
double * rin,
double * masses,
double * avgArea,
double * rsolv,
double * ret,
int * nr_gen,
int * gen1,
int * gen2,
int * gen3,
int * nvert,
double * vert,
double * centr,
int * isphe,
const char * pedra,
int * len_f_pedra);
extern "C" void pedra_driver(int * maxts,
int * maxsph,
int * maxvert,
double * xtscor,
double * ytscor,
double * ztscor,
double * ar,
double * xsphcor,
double * ysphcor,
double * zsphcor,
double * rsph,
int * nts,
int * ntsirr,
int * nesfp,
int * addsph,
double * xe,
double * ye,
double * ze,
double * rin,
double * masses,
double * avgArea,
double * rsolv,
double * ret,
int * nr_gen,
int * gen1,
int * gen2,
int * gen3,
int * nvert,
double * vert,
double * centr,
int * isphe,
const char * pedra,
int * len_f_pedra);

ICavity * createGePolCavity(const CavityData & data);
} // namespace cavity
Expand Down
Loading