26
26
27
27
#include <stddef.h>
28
28
#include "PCMInput.h"
29
+ #include "PCMSolverExport.h"
29
30
30
- #ifndef PCMSOLVER_API
31
- #ifdef _WIN32
32
- #if defined(PCMSOLVER_BUILD_SHARED ) /* build dll */
33
- #define PCMSOLVER_API __declspec(dllexport)
34
- #elif !defined(PCMSOLVER_BUILD_STATIC ) /* use dll */
35
- #define PCMSOLVER_API __declspec(dllimport)
36
- #else /* static library */
37
- #define PCMSOLVER_API
38
- #endif
39
- #else
40
- #if __GNUC__ >= 4
41
- #define PCMSOLVER_API __attribute__((visibility("default")))
42
- #else
43
- #define PCMSOLVER_API
44
- #endif
45
- #endif
46
- #endif
31
+ #define PCMSolver_API PCMSolver_EXPORT
47
32
48
33
// To cope with the fact that C doesn't have bool as primitive type
49
34
#ifndef pcmsolver_bool_t_DEFINED
@@ -108,7 +93,7 @@ typedef void (*HostWriter)(const char * message);
108
93
* of 4 integers: number of generators, first, second and third generator
109
94
* respectively. Generators map to integers as in table :ref:`symmetry-ops`
110
95
*/
111
- PCMSOLVER_API pcmsolver_context_t * pcmsolver_new (pcmsolver_reader_t input_reading ,
96
+ PCMSolver_API pcmsolver_context_t * pcmsolver_new (pcmsolver_reader_t input_reading ,
112
97
int nr_nuclei , double charges [],
113
98
double coordinates [],
114
99
int symmetry_info [],
@@ -118,56 +103,56 @@ PCMSOLVER_API pcmsolver_context_t * pcmsolver_new(pcmsolver_reader_t input_readi
118
103
/*! \brief Deletes a PCM context object
119
104
* \param[in, out] context the PCM context object to be deleted
120
105
*/
121
- PCMSOLVER_API void pcmsolver_delete (pcmsolver_context_t * context );
106
+ PCMSolver_API void pcmsolver_delete (pcmsolver_context_t * context );
122
107
123
108
/*! \brief Whether the library is compatible with the header file
124
109
* Checks that the compiled library and header file version match.
125
110
* Host should abort when that is not the case.
126
111
* \warning This function should be called **before** instantiating
127
112
* any PCM context objects.
128
113
*/
129
- PCMSOLVER_API pcmsolver_bool_t pcmsolver_is_compatible_library (void );
114
+ PCMSolver_API pcmsolver_bool_t pcmsolver_is_compatible_library (void );
130
115
131
116
/*! \brief Prints citation and set up information
132
117
* \param[in, out] context the PCM context object
133
118
*/
134
- PCMSOLVER_API void pcmsolver_print (pcmsolver_context_t * context );
119
+ PCMSolver_API void pcmsolver_print (pcmsolver_context_t * context );
135
120
136
121
/*! \brief Getter for the number of finite elements composing the molecular cavity
137
122
* \param[in, out] context the PCM context object
138
123
* \return the size of the cavity
139
124
*/
140
- PCMSOLVER_API int pcmsolver_get_cavity_size (pcmsolver_context_t * context );
125
+ PCMSolver_API int pcmsolver_get_cavity_size (pcmsolver_context_t * context );
141
126
142
127
/*! \brief Getter for the number of irreducible finite elements composing the
143
128
* molecular cavity
144
129
* \param[in, out] context the PCM context object
145
130
* \return the number of irreducible finite elements
146
131
*/
147
- PCMSOLVER_API int pcmsolver_get_irreducible_cavity_size (
132
+ PCMSolver_API int pcmsolver_get_irreducible_cavity_size (
148
133
pcmsolver_context_t * context );
149
134
150
135
/*! \brief Getter for the centers of the finite elements composing the molecular
151
136
* cavity
152
137
* \param[in, out] context the PCM context object
153
138
* \param[out] centers array holding the coordinates of the finite elements centers
154
139
*/
155
- PCMSOLVER_API void pcmsolver_get_centers (pcmsolver_context_t * context ,
140
+ PCMSolver_API void pcmsolver_get_centers (pcmsolver_context_t * context ,
156
141
double centers []);
157
142
158
143
/*! \brief Getter for the center of the i-th finite element
159
144
* \param[in, out] context the PCM context object
160
145
* \param[in] its index of the finite element
161
146
* \param[out] center array holding the coordinates of the finite element center
162
147
*/
163
- PCMSOLVER_API void pcmsolver_get_center (pcmsolver_context_t * context , int its ,
148
+ PCMSolver_API void pcmsolver_get_center (pcmsolver_context_t * context , int its ,
164
149
double center []);
165
150
166
151
/*! \brief Getter for the areas/weights of the finite elements
167
152
* \param[in, out] context the PCM context object
168
153
* \param[out] areas array holding the weights/areas of the finite elements
169
154
*/
170
- PCMSOLVER_API void pcmsolver_get_areas (pcmsolver_context_t * context ,
155
+ PCMSolver_API void pcmsolver_get_areas (pcmsolver_context_t * context ,
171
156
double areas []);
172
157
173
158
/*! \brief Computes ASC given a MEP and the desired irreducible representation
@@ -179,7 +164,7 @@ PCMSOLVER_API void pcmsolver_get_areas(pcmsolver_context_t * context,
179
164
* and charges. Given labels for each, this function retrieves the MEP
180
165
* and computes the corresponding ASC.
181
166
*/
182
- PCMSOLVER_API void pcmsolver_compute_asc (pcmsolver_context_t * context ,
167
+ PCMSolver_API void pcmsolver_compute_asc (pcmsolver_context_t * context ,
183
168
const char * mep_name ,
184
169
const char * asc_name , int irrep );
185
170
@@ -194,7 +179,7 @@ PCMSOLVER_API void pcmsolver_compute_asc(pcmsolver_context_t * context,
194
179
* permittivity
195
180
* otherwise.
196
181
*/
197
- PCMSOLVER_API void pcmsolver_compute_response_asc (pcmsolver_context_t * context ,
182
+ PCMSolver_API void pcmsolver_compute_response_asc (pcmsolver_context_t * context ,
198
183
const char * mep_name ,
199
184
const char * asc_name , int irrep );
200
185
@@ -205,7 +190,7 @@ PCMSOLVER_API void pcmsolver_compute_response_asc(pcmsolver_context_t * context,
205
190
* \return the polarization energy
206
191
* This function calculates the dot product of the given MEP and ASC vectors.
207
192
*/
208
- PCMSOLVER_API double pcmsolver_compute_polarization_energy (
193
+ PCMSolver_API double pcmsolver_compute_polarization_energy (
209
194
pcmsolver_context_t * context , const char * mep_name , const char * asc_name );
210
195
211
196
/*! \brief Getter for the ASC dipole
@@ -214,7 +199,7 @@ PCMSOLVER_API double pcmsolver_compute_polarization_energy(
214
199
* \param[out] dipole the Cartesian components of the ASC dipole moment
215
200
* \return the ASC dipole, i.e. \sqrt{\sum_i \mu_i^2}
216
201
*/
217
- PCMSOLVER_API double pcmsolver_get_asc_dipole (pcmsolver_context_t * context ,
202
+ PCMSolver_API double pcmsolver_get_asc_dipole (pcmsolver_context_t * context ,
218
203
const char * asc_name ,
219
204
double dipole []);
220
205
@@ -224,7 +209,7 @@ PCMSOLVER_API double pcmsolver_get_asc_dipole(pcmsolver_context_t * context,
224
209
* \param[in] values the values wrapped in the surface function
225
210
* \param[in] name label of the surface function
226
211
*/
227
- PCMSOLVER_API void pcmsolver_get_surface_function (pcmsolver_context_t * context ,
212
+ PCMSolver_API void pcmsolver_get_surface_function (pcmsolver_context_t * context ,
228
213
int size , double values [],
229
214
const char * name );
230
215
@@ -234,40 +219,40 @@ PCMSOLVER_API void pcmsolver_get_surface_function(pcmsolver_context_t * context,
234
219
* \param[in] values the values to be wrapped in the surface function
235
220
* \param[in] name label of the surface function
236
221
*/
237
- PCMSOLVER_API void pcmsolver_set_surface_function (pcmsolver_context_t * context ,
222
+ PCMSolver_API void pcmsolver_set_surface_function (pcmsolver_context_t * context ,
238
223
int size , double values [],
239
224
const char * name );
240
225
241
226
/*! \brief Prints surface function contents to host output
242
227
* \param[in, out] context the PCM context object
243
228
* \param[in] name label of the surface function
244
229
*/
245
- PCMSOLVER_API void pcmsolver_print_surface_function (pcmsolver_context_t * context ,
230
+ PCMSolver_API void pcmsolver_print_surface_function (pcmsolver_context_t * context ,
246
231
const char * name );
247
232
248
233
/*! \brief Dumps all currently saved surface functions to NumPy arrays in .npy files
249
234
* \param[in, out] context the PCM context object
250
235
*/
251
- PCMSOLVER_API void pcmsolver_save_surface_functions (pcmsolver_context_t * context );
236
+ PCMSolver_API void pcmsolver_save_surface_functions (pcmsolver_context_t * context );
252
237
253
238
/*! \brief Dumps a surface function to NumPy array in .npy file
254
239
* \param[in, out] context the PCM context object
255
240
* \param[in] name label of the surface function
256
241
*/
257
- PCMSOLVER_API void pcmsolver_save_surface_function (pcmsolver_context_t * context ,
242
+ PCMSolver_API void pcmsolver_save_surface_function (pcmsolver_context_t * context ,
258
243
const char * name );
259
244
260
245
/*! \brief Loads a surface function from a .npy file
261
246
* \param[in, out] context the PCM context object
262
247
* \param[in] name label of the surface function
263
248
*/
264
- PCMSOLVER_API void pcmsolver_load_surface_function (pcmsolver_context_t * context ,
249
+ PCMSolver_API void pcmsolver_load_surface_function (pcmsolver_context_t * context ,
265
250
const char * name );
266
251
267
252
/*! \brief Writes timing results for the API
268
253
* \param[in, out] context the PCM context object
269
254
*/
270
- PCMSOLVER_API void pcmsolver_write_timings (pcmsolver_context_t * context );
255
+ PCMSolver_API void pcmsolver_write_timings (pcmsolver_context_t * context );
271
256
272
257
#ifdef __cplusplus
273
258
}
0 commit comments