2626#ifndef PCMINPUT_HPP
2727#define PCMINPUT_HPP
2828
29- #include < algorithm>
3029#include < iostream>
3130#include < string>
3231
3332#include " Config.hpp"
3433
35- #include < boost/algorithm/string.hpp>
36-
37- inline bool invalidChar (char c);
38-
3934struct PCMInput ;
4035inline void print (const PCMInput &);
41- inline void init (PCMInput &);
42- inline void trim (PCMInput &);
43-
44- bool invalidChar (char c)
45- {
46- return !std::isprint ( static_cast <unsigned char >( c ) );
47- }
4836
4937/* ! @struct PCMInput
5038 * @brief Data structure for host-API input communication.
@@ -59,28 +47,28 @@ struct PCMInput
5947 double coarsity;
6048 // / Average tesserae area.
6149 double area;
50+ // / The built-in radii set to be used.
51+ char radii_set[8 ];
6252 // / Minimal distance between sampling points.
6353 double min_distance;
6454 // / Derivative order for the switching function.
6555 int der_order;
6656 // / Whether to scale or not the atomic radii.
6757 bool scaling;
68- // / The built-in radii set to be used.
69- char radii_set[8 ];
7058 // / Name of the .npz file for GePol cavity restart.
7159 char restart_name[20 ];
7260 // / Minimal radius for the added spheres.
7361 double min_radius;
7462 // / Type of solver requested.
7563 char solver_type[7 ];
76- // / Name of the solvent.
77- char solvent[16 ];
78- // / Type of the integral equation to be used.
79- char equation_type[11 ];
8064 // / Correction in the CPCM apparent surface charge scaling factor.
8165 double correction;
66+ // / Name of the solvent.
67+ char solvent[16 ];
8268 // / Radius of the spherical probe mimicking the solvent.
8369 double probe_radius;
70+ // / Type of the integral equation to be used.
71+ char equation_type[11 ];
8472 // / Type of Green's function requested inside the cavity.
8573 char inside_type[7 ];
8674 // / Value of the static permittivity outside the cavity.
@@ -110,78 +98,5 @@ void print(const PCMInput & inp)
11098 std::cout << " outside type " << std::string (inp.outside_type ) << std::endl;
11199 std::cout << " epsilon outside " << inp.outside_epsilon << std::endl;
112100}
113- void init (PCMInput & inp)
114- {
115- inp.patch_level = 0 ;
116- std::fill ((inp.cavity_type ), (inp.cavity_type ) + 8 , 0 );
117- inp.coarsity = 0.0 ;
118- inp.area = 0.0 ;
119- inp.min_distance = 0.0 ;
120- inp.der_order = 0 ;
121- inp.scaling = false ;
122- std::fill ((inp.radii_set ), (inp.radii_set ) + 8 , 0 );
123- std::fill ((inp.restart_name ), (inp.restart_name ) + 20 , 0 );
124- inp.min_radius = 0.0 ;
125- std::fill ((inp.solver_type ), (inp.solver_type ) + 7 , 0 );
126- inp.correction = 0.0 ;
127- std::fill ((inp.solvent ), (inp.solvent ) + 16 , 0 );
128- inp.probe_radius = 0.0 ;
129- std::fill ((inp.equation_type ), (inp.equation_type ) + 11 , 0 );
130- std::fill ((inp.inside_type ), (inp.inside_type ) + 7 , 0 );
131- inp.outside_epsilon = 0.0 ;
132- std::fill ((inp.outside_type ), (inp.outside_type ) + 22 , 0 );
133- }
134- void trim (PCMInput & inp)
135- {
136- std::string s1 (inp.cavity_type );
137- s1.erase (std::remove_if (s1.begin (), s1.end (), invalidChar), s1.end ());
138- boost::algorithm::trim (s1);
139- std::fill ((inp.cavity_type ), (inp.cavity_type ) + 8 , 0 );
140- strncpy (inp.cavity_type , s1.c_str (), s1.length ());
141-
142- /*
143- std::string s2(inp.restart_name);
144- s2.erase(std::remove_if(s2.begin(), s2.end(), invalidChar), s2.end());
145- boost::algorithm::trim(s2);
146- std::fill((inp.restart_name), (inp.restart_name) + 20, 0);
147- strncpy(inp.cavity_type, s2.c_str(), s2.length());
148-
149- std::string s3(inp.radii_set);
150- s3.erase(std::remove_if(s3.begin(), s3.end(), invalidChar), s3.end());
151- boost::algorithm::trim(s3);
152- std::fill((inp.radii_set), (inp.radii_set) + 8, 0);
153- strncpy(inp.cavity_type, s3.c_str(), s3.length());
154-
155- std::string s4(inp.solver_type);
156- s4.erase(std::remove_if(s4.begin(), s4.end(), invalidChar), s4.end());
157- boost::algorithm::trim(s4);
158- std::fill((inp.solver_type), (inp.solver_type) + 7, 0);
159- strncpy(inp.solver_type, s4.c_str(), s4.length());
160-
161- std::string s5(inp.solvent);
162- s5.erase(std::remove_if(s5.begin(), s5.end(), invalidChar), s5.end());
163- boost::algorithm::trim(s5);
164- std::fill((inp.solvent), (inp.solvent) + 16, 0);
165- strncpy(inp.solvent, s5.c_str(), s5.length());
166-
167- std::string s6(inp.equation_type);
168- s6.erase(std::remove_if(s6.begin(), s6.end(), invalidChar), s6.end());
169- boost::algorithm::trim(s6);
170- std::fill((inp.equation_type), (inp.equation_type) + 11, 0);
171- strncpy(inp.equation_type, s6.c_str(), s6.length());
172-
173- std::string s7(inp.inside_type);
174- s7.erase(std::remove_if(s7.begin(), s7.end(), invalidChar), s7.end());
175- boost::algorithm::trim(s7);
176- std::fill((inp.inside_type), (inp.inside_type) + 7, 0);
177- strncpy(inp.inside_type, s7.c_str(), s7.length());
178-
179- std::string s8(inp.outside_type);
180- s8.erase(std::remove_if(s8.begin(), s8.end(), invalidChar), s8.end());
181- boost::algorithm::trim(s8);
182- std::fill((inp.outside_type), (inp.outside_type) + 22, 0);
183- strncpy(inp.outside_type, s8.c_str(), s8.length());
184- */
185- }
186101
187102#endif // PCMINPUT_HPP
0 commit comments