Skip to content

Commit 141ef30

Browse files
committed
Add TsLess sources
1 parent 8791873 commit 141ef30

33 files changed

+2945
-284
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22

33
## [Unreleased]
44

5-
## [Version 2.0.0-alpha1] - 2019-04-XY
6-
75
We have introduced a number of breaking changes, motivated by the need to
86
modernize the library.
97

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

10+
### Added
11+
12+
- A new cavity generator using C. S. Pomelli's [TsLess algorithm](http://dx.doi.org/10.1002/jcc.20076)
13+
1214
### Changed
1315

1416
- **BREAKING** We require a fully compliant C++14 compiler.

src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ add_subdirectory(interface)
6565
add_subdirectory(pedra)
6666
add_subdirectory(solver)
6767
add_subdirectory(utils)
68+
add_subdirectory(tsless)
6869

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

src/cavity/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ target_sources(pcm-object
44
${CMAKE_CURRENT_LIST_DIR}/GePolCavity.cpp
55
${CMAKE_CURRENT_LIST_DIR}/ICavity.cpp
66
${CMAKE_CURRENT_LIST_DIR}/RestartCavity.cpp
7+
${CMAKE_CURRENT_LIST_DIR}/TsLessCavity.cpp
78
)
89

910
# List of headers
@@ -14,6 +15,7 @@ list(APPEND headers_list
1415
GePolCavity.hpp
1516
ICavity.hpp
1617
RestartCavity.hpp
18+
TsLessCavity.hpp
1719
)
1820
# Sets install directory for all the headers in the list
1921
foreach(_header IN LISTS headers_list)

src/cavity/Cavity.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "GePolCavity.hpp"
2727
#include "ICavity.hpp"
2828
#include "RestartCavity.hpp"
29+
#include "TsLessCavity.hpp"
2930
#include "utils/Factory.hpp"
3031

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

5051
factory_.subscribe("GEPOL", createGePolCavity);
5152
factory_.subscribe("RESTART", createRestartCavity);
53+
factory_.subscribe("TSLESS", createTsLessCavity);
5254

5355
return factory_;
5456
}

src/cavity/CavityData.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ struct CavityData {
4040
double area;
4141
/*! The radius of the spherical probe representing the solvent */
4242
double probeRadius;
43+
/*! The minimal distance between two sampling points on different spheres. Relevant
44+
* for TsLessCavity */
45+
double minDistance;
46+
/*! The maximum derivative order to be used in the definition of the smoothing
47+
* function. Relevant for TsLessCavity */
48+
int derOrder;
4349
/*! Triggers the addition of spheres not centered on atoms, relevant for
4450
* GePolCavity */
4551
double minimalRadius;
@@ -50,12 +56,16 @@ struct CavityData {
5056
const Molecule & _molec,
5157
double _area,
5258
double _probeRadius,
59+
double _minDistance,
60+
int _derOrder,
5361
double _minRadius,
5462
const std::string & _fname)
5563
: cavityType(type),
5664
molecule(_molec),
5765
area(_area),
5866
probeRadius(_probeRadius),
67+
minDistance(_minDistance),
68+
derOrder(_derOrder),
5969
minimalRadius(_minRadius),
6070
filename(_fname) {}
6171
};

src/cavity/GePolCavity.cpp

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ void GePolCavity::build(const std::string & suffix,
8181
int maxsph,
8282
int maxvert) {
8383

84-
// This is a wrapper for the generatecavity_cpp function defined in the Fortran
84+
// This is a wrapper for the pedra_driver function defined in the Fortran
8585
// code PEDRA.
8686
// Here we allocate the necessary arrays to be passed to PEDRA, in particular we
8787
// allow
@@ -172,41 +172,41 @@ void GePolCavity::build(const std::string & suffix,
172172
pedra << "PEDRA.OUT_" << suffix << "_" << getpid();
173173
int len_f_pedra = std::strlen(pedra.str().c_str());
174174
// Go PEDRA, Go!
175-
timer::timerON("GePolCavity::generatecavity_cpp");
176-
generatecavity_cpp(&maxts,
177-
&maxsph,
178-
&maxvert,
179-
xtscor,
180-
ytscor,
181-
ztscor,
182-
ar,
183-
xsphcor,
184-
ysphcor,
185-
zsphcor,
186-
rsph,
187-
&nts,
188-
&ntsirr,
189-
&nSpheres_,
190-
&addedSpheres,
191-
xe,
192-
ye,
193-
ze,
194-
rin,
195-
mass,
196-
&averageArea,
197-
&probeRadius,
198-
&minimalRadius,
199-
&nr_gen,
200-
&gen1,
201-
&gen2,
202-
&gen3,
203-
nvert,
204-
vert,
205-
centr,
206-
isphe,
207-
pedra.str().c_str(),
208-
&len_f_pedra);
209-
timer::timerOFF("GePolCavity::generatecavity_cpp");
175+
timer::timerON("GePolCavity::pedra_driver");
176+
pedra_driver(&maxts,
177+
&maxsph,
178+
&maxvert,
179+
xtscor,
180+
ytscor,
181+
ztscor,
182+
ar,
183+
xsphcor,
184+
ysphcor,
185+
zsphcor,
186+
rsph,
187+
&nts,
188+
&ntsirr,
189+
&nSpheres_,
190+
&addedSpheres,
191+
xe,
192+
ye,
193+
ze,
194+
rin,
195+
mass,
196+
&averageArea,
197+
&probeRadius,
198+
&minimalRadius,
199+
&nr_gen,
200+
&gen1,
201+
&gen2,
202+
&gen3,
203+
nvert,
204+
vert,
205+
centr,
206+
isphe,
207+
pedra.str().c_str(),
208+
&len_f_pedra);
209+
timer::timerOFF("GePolCavity::pedra_driver");
210210

211211
// The "intensive" part of updating the spheres related class data members will be
212212
// of course

src/cavity/GePolCavity.hpp

Lines changed: 34 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -89,18 +89,7 @@ class GePolCavity final : public ICavity {
8989
void writeOFF(const std::string & suffix);
9090
};
9191

92-
/*! \fn extern "C" void generatecavity_cpp(int * maxts, int * maxsph, int * maxvert,
93-
* double * xtscor, double * ytscor, double * ztscor,
94-
* double * ar,
95-
* double * xsphcor, double * ysphcor, double *
96-
* zsphcor, double * rsph,
97-
* int * nts, int * ntsirr, int * nesfp, int *
98-
* addsph,
99-
* double * xe, double * ye, double * ze, double *
100-
* rin,
101-
* double * avgArea, double * rsolv, double * ret,
102-
* int * nr_gen, int * gen1, int * gen2, int * gen3,
103-
* int * nvert, double * vert, double * centr)
92+
/*! \brief Interface to the Fortran PEDRA code
10493
* \param[in] maxts maximum number of tesserae allowed
10594
* \param[in] maxsph maximum number of spheres allowed
10695
* \param[in] maxvert maximum number of vertices allowed
@@ -139,39 +128,39 @@ class GePolCavity final : public ICavity {
139128
* \param[out] vert coordinates of tesserae vertices
140129
* \param[out] centr centers of arcs defining the edges of the tesserae
141130
*/
142-
extern "C" void generatecavity_cpp(int * maxts,
143-
int * maxsph,
144-
int * maxvert,
145-
double * xtscor,
146-
double * ytscor,
147-
double * ztscor,
148-
double * ar,
149-
double * xsphcor,
150-
double * ysphcor,
151-
double * zsphcor,
152-
double * rsph,
153-
int * nts,
154-
int * ntsirr,
155-
int * nesfp,
156-
int * addsph,
157-
double * xe,
158-
double * ye,
159-
double * ze,
160-
double * rin,
161-
double * masses,
162-
double * avgArea,
163-
double * rsolv,
164-
double * ret,
165-
int * nr_gen,
166-
int * gen1,
167-
int * gen2,
168-
int * gen3,
169-
int * nvert,
170-
double * vert,
171-
double * centr,
172-
int * isphe,
173-
const char * pedra,
174-
int * len_f_pedra);
131+
extern "C" void pedra_driver(int * maxts,
132+
int * maxsph,
133+
int * maxvert,
134+
double * xtscor,
135+
double * ytscor,
136+
double * ztscor,
137+
double * ar,
138+
double * xsphcor,
139+
double * ysphcor,
140+
double * zsphcor,
141+
double * rsph,
142+
int * nts,
143+
int * ntsirr,
144+
int * nesfp,
145+
int * addsph,
146+
double * xe,
147+
double * ye,
148+
double * ze,
149+
double * rin,
150+
double * masses,
151+
double * avgArea,
152+
double * rsolv,
153+
double * ret,
154+
int * nr_gen,
155+
int * gen1,
156+
int * gen2,
157+
int * gen3,
158+
int * nvert,
159+
double * vert,
160+
double * centr,
161+
int * isphe,
162+
const char * pedra,
163+
int * len_f_pedra);
175164

176165
ICavity * createGePolCavity(const CavityData & data);
177166
} // namespace cavity

0 commit comments

Comments
 (0)