ScaFaCoS  1.0.1
Scalable Fast Coulomb Solvers
fcs_interface_p.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011, 2012, 2013 Rene Halver, Olaf Lenz, Michael Hofmann
3 
4  This file is part of ScaFaCoS.
5 
6  ScaFaCoS is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  ScaFaCoS is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser Public License for more details.
15 
16  You should have received a copy of the GNU Lesser Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 
21 
22 #ifndef FCS_INTERFACE_P_INCLUDED
23 #define FCS_INTERFACE_P_INCLUDED
24 
25 #include <mpi.h>
26 
27 #include "fcs_definitions.h"
28 #include "fcs_result_p.h"
29 
30 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 
47 typedef struct _FCS_t *FCS;
48 
49 #define FCS_NULL NULL
50 
58 FCSResult fcs_init(FCS *new_handle, const char* method_name, MPI_Comm communicator);
59 
65 FCSResult fcs_destroy(FCS handle);
66 
72 fcs_int fcs_get_method(FCS handle);
73 
79 const char *fcs_get_method_name(FCS handle);
80 
86 MPI_Comm fcs_get_communicator(FCS handle);
87 
101 FCSResult
102 fcs_set_common(FCS handle, fcs_int near_field_flag,
103  const fcs_float *box_a, const fcs_float *box_b, const fcs_float *box_c,
104  const fcs_float *box_origin,
105  const fcs_int *periodicity, fcs_int total_particles);
106 
113 FCSResult fcs_set_dimensions(FCS handle, fcs_int dim);
114 
120 fcs_int fcs_get_dimensions(FCS handle);
121 
129 FCSResult fcs_set_near_field_flag(FCS handle, fcs_int near_field_flag);
130 
136 fcs_int fcs_get_near_field_flag(FCS handle);
143 FCSResult fcs_set_redistribute(FCS handle, fcs_int redistribute);
144 
150 fcs_int fcs_get_redistribute(FCS handle);
151 
158 FCSResult fcs_set_box_a(FCS handle, const fcs_float *box_a);
159 
165 const fcs_float *fcs_get_box_a(FCS handle);
166 
173 FCSResult fcs_set_box_b(FCS handle, const fcs_float *box_b);
174 
180 const fcs_float *fcs_get_box_b(FCS handle);
181 
188 FCSResult fcs_set_box_c(FCS handle, const fcs_float *box_c);
189 
195 const fcs_float *fcs_get_box_c(FCS handle);
196 
203 FCSResult fcs_set_box_origin(FCS handle, const fcs_float *box_origin);
204 
210 const fcs_float *fcs_get_box_origin(FCS handle);
211 
218 FCSResult fcs_set_periodicity(FCS handle, const fcs_int *periodicity);
219 
225 const fcs_int *fcs_get_periodicity(FCS handle);
226 
233 FCSResult fcs_set_total_particles(FCS handle, fcs_int total_particles);
234 
240 fcs_int fcs_get_total_particles(FCS handle);
241 
248 FCSResult fcs_set_max_local_particles(FCS handle, fcs_int max_local_particles);
249 
255 fcs_int fcs_get_max_local_particles(FCS handle);
256 
265 FCSResult fcs_set_tolerance(FCS handle, fcs_int tolerance_type, fcs_float tolerance);
266 
275 FCSResult fcs_get_tolerance(FCS handle, fcs_int *tolerance_type, fcs_float *tolerance);
276 
284 FCSResult fcs_set_r_cut(FCS handle, fcs_float r_cut);
285 
292 FCSResult fcs_unset_r_cut(FCS handle);
293 
301 FCSResult fcs_get_r_cut(FCS handle, fcs_float *r_cut);
302 
311 FCSResult fcs_set_parameters(FCS handle, const char *parameters, fcs_int continue_on_errors);
312 
318 FCSResult fcs_print_parameters(FCS handle);
319 
328 FCSResult fcs_tune(FCS handle, fcs_int local_particles,
329  fcs_float *positions, fcs_float *charges);
330 
341 FCSResult fcs_run(FCS handle, fcs_int local_particles,
342  fcs_float *positions, fcs_float *charges, fcs_float *field, fcs_float *potentials);
343 
362 FCSResult fcs_compute_dipole_correction(FCS handle, fcs_int local_particles,
363  fcs_float* positions, fcs_float *charges, fcs_float epsilon,
364  fcs_float *field_correction, fcs_float *energy_correction);
365 
373 FCSResult fcs_get_near_field_delegation(FCS handle, fcs_int *near_field_delegation);
374 
395 FCSResult fcs_compute_near(FCS handle, fcs_float dist, fcs_float *potential, fcs_float *field);
396 
406 FCSResult fcs_compute_near_potential(FCS handle, fcs_float dist, fcs_float *potential);
407 
417 FCSResult fcs_compute_near_field(FCS handle, fcs_float dist, fcs_float *field);
418 
425 FCSResult fcs_set_compute_virial(FCS handle, fcs_int compute_virial);
426 
433 FCSResult fcs_get_compute_virial(FCS handle, fcs_int *compute_virial);
434 
441 FCSResult fcs_get_virial(FCS handle, fcs_float *virial);
442 
449 FCSResult fcs_set_max_particle_move(FCS handle, fcs_float max_particle_move);
450 
462 FCSResult fcs_set_resort(FCS handle, fcs_int resort);
463 
470 FCSResult fcs_get_resort(FCS handle, fcs_int *resort);
471 
478 FCSResult fcs_get_resort_availability(FCS handle, fcs_int *availability);
479 
486 FCSResult fcs_get_resort_particles(FCS handle, fcs_int *resort_particles);
487 
496 FCSResult fcs_resort_ints(FCS handle, fcs_int *src, fcs_int *dst, fcs_int n);
497 
506 FCSResult fcs_resort_floats(FCS handle, fcs_float *src, fcs_float *dst, fcs_int n);
507 
516 FCSResult fcs_resort_bytes(FCS handle, void *src, void *dst, fcs_int n);
517 
518 
519 #ifdef FCS_ENABLE_DEPRECATED
520 #define fcs_set_dimension fcs_set_dimensions
521 #define fcs_get_dimension fcs_get_dimensions
522 #define fcs_set_offset fcs_set_box_origin
523 #define fcs_get_offset fcs_get_box_origin
524 #define fcs_printHandle fcs_print_parameters
525 #define fcs_method_has_near fcs_delegate_near_field
526 #define fcs_parser fcs_set_parameters
527 #define fcs_require_virial fcs_set_compute_virial
528 #endif
529 
530 
531 #ifdef __cplusplus
532 }
533 #endif
534 
535 
536 #endif
fcs_int fcs_get_method(FCS handle)
function to return the numerical identifier of the solver method
FCSResult fcs_set_max_local_particles(FCS handle, fcs_int max_local_particles)
function to set the maximum number of particles that can be stored in the specified local particle da...
FCSResult fcs_set_parameters(FCS handle, const char *parameters, fcs_int continue_on_errors)
function to set the parameters of the FCS solver based on a parameter string
fcs_int fcs_get_dimensions(FCS handle)
function to return the dimensions of the system
FCSResult fcs_set_box_c(FCS handle, const fcs_float *box_c)
function to set the third base vector of the system box
const fcs_float * fcs_get_box_b(FCS handle)
function to return the second base vector of the system box
FCSResult fcs_set_box_origin(FCS handle, const fcs_float *box_origin)
function to set the origin vector of the system box
const fcs_float * fcs_get_box_origin(FCS handle)
function function to return the origin vector of the system box
FCSResult fcs_destroy(FCS handle)
function to destroy an FCS solver
FCSResult fcs_get_near_field_delegation(FCS handle, fcs_int *near_field_delegation)
function to return whether the solver method supports the delegation of near-field computations to an...
FCSResult fcs_get_tolerance(FCS handle, fcs_int *tolerance_type, fcs_float *tolerance)
function to return the error tolerance of the FCS solver
FCSResult fcs_unset_r_cut(FCS handle)
function to disable a user-defined cutoff radius for the near-field computations of the FCS solver (i...
FCSResult fcs_compute_near_potential(FCS handle, fcs_float dist, fcs_float *potential)
function to compute the near-field component of the potential for the solver method ...
FCSResult fcs_tune(FCS handle, fcs_int local_particles, fcs_float *positions, fcs_float *charges)
function to tune method specific parameters depending on the particles
FCSResult fcs_get_resort_particles(FCS handle, fcs_int *resort_particles)
function to return the new local number of particles
FCSResult fcs_set_common(FCS handle, fcs_int near_field_flag, const fcs_float *box_a, const fcs_float *box_b, const fcs_float *box_c, const fcs_float *box_origin, const fcs_int *periodicity, fcs_int total_particles)
function to set all obligatory parameters for an FCS solver
const fcs_float * fcs_get_box_a(FCS handle)
function to return the first base vector of the system box
fcs_int fcs_get_max_local_particles(FCS handle)
function to return the maximum number of particles that can be stored in the specified local particle...
FCSResult fcs_run(FCS handle, fcs_int local_particles, fcs_float *positions, fcs_float *charges, fcs_float *field, fcs_float *potentials)
function to run the solver method
FCSResult fcs_set_tolerance(FCS handle, fcs_int tolerance_type, fcs_float tolerance)
function to set the error tolerance of the FCS solver
FCSResult fcs_set_redistribute(FCS handle, fcs_int redistribute)
function to set the redistribution of particles before the computations (and back after the computati...
FCSResult fcs_get_resort_availability(FCS handle, fcs_int *availability)
function to return whether resort support is available after executing fcs_run
FCSResult fcs_set_total_particles(FCS handle, fcs_int total_particles)
function to set the total number of particles in the system
FCSResult fcs_get_resort(FCS handle, fcs_int *resort)
function to return whether resort support is requested
FCSResult fcs_set_box_b(FCS handle, const fcs_float *box_b)
function to set the second base vector of the system box
fcs_int fcs_get_total_particles(FCS handle)
function to return the total number of particles in the system
FCSResult fcs_set_resort(FCS handle, fcs_int resort)
function to set whether resort support is requested (default is no resort support) if resort support ...
FCSResult fcs_print_parameters(FCS handle)
function to print the parameters of an FCS solver to stdout
FCSResult fcs_set_near_field_flag(FCS handle, fcs_int near_field_flag)
function to set the near-field flag
FCSResult fcs_set_box_a(FCS handle, const fcs_float *box_a)
function to set the first base vector of the system box
FCSResult fcs_compute_near(FCS handle, fcs_float dist, fcs_float *potential, fcs_float *field)
function to compute the near-field components of the potential and the field for the solver method ...
public interface definitions for the FCSResult-object that is used for handling the return state of t...
FCSResult fcs_get_virial(FCS handle, fcs_float *virial)
function to return the comuputed virial
FCSResult fcs_get_compute_virial(FCS handle, fcs_int *compute_virial)
function to return whether the virial should be computed
FCSResult fcs_init(FCS *new_handle, const char *method_name, MPI_Comm communicator)
function to initialize an FCS solver
struct FCSResult_t * FCSResult
FCSResult-object that is used for handling the return state of the ScaFaCoS library functions...
Definition: fcs_result_p.h:42
FCSResult fcs_set_r_cut(FCS handle, fcs_float r_cut)
function to set a user-defined cutoff radius for the near-field computations of the FCS solver (if su...
FCSResult fcs_resort_bytes(FCS handle, void *src, void *dst, fcs_int n)
function to sort additional byte particle data into the new sorted particle order ...
FCSResult fcs_compute_near_field(FCS handle, fcs_float dist, fcs_float *field)
function to compute the near-field component of the field for the solver method
FCSResult fcs_compute_dipole_correction(FCS handle, fcs_int local_particles, fcs_float *positions, fcs_float *charges, fcs_float epsilon, fcs_float *field_correction, fcs_float *energy_correction)
function to compute the correction to the field and total energy when periodic boundary conditions wi...
FCSResult fcs_set_periodicity(FCS handle, const fcs_int *periodicity)
function to set the periodicity of the system
FCSResult fcs_resort_ints(FCS handle, fcs_int *src, fcs_int *dst, fcs_int n)
function to sort additional integer particle data into the new sorted particle order ...
FCSResult fcs_set_compute_virial(FCS handle, fcs_int compute_virial)
function to set whether the virial should be computed
const char * fcs_get_method_name(FCS handle)
function to return the name of the solver method
FCSResult fcs_set_dimensions(FCS handle, fcs_int dim)
function to set the dimensions of the system
const fcs_float * fcs_get_box_c(FCS handle)
function to return the third base vector of the system box
MPI_Comm fcs_get_communicator(FCS handle)
function to return the MPI communicator used for the parallel execution
fcs_int fcs_get_near_field_flag(FCS handle)
function to return the near-field flag
FCSResult fcs_set_max_particle_move(FCS handle, fcs_float max_particle_move)
function to set the maximum distance the particles have moved since the call of fcs_run ...
FCSResult fcs_get_r_cut(FCS handle, fcs_float *r_cut)
function to return the user-defined cutoff radius for the near-field computations of the FCS solver (...
fcs_int fcs_get_redistribute(FCS handle)
function to return the particle redistribution setting
const fcs_int * fcs_get_periodicity(FCS handle)
function to return the periodicity of the system
struct _FCS_t * FCS
FCS-object representing an FCS solver.
FCSResult fcs_resort_floats(FCS handle, fcs_float *src, fcs_float *dst, fcs_int n)
function to sort additional float particle data into the new sorted particle order ...