ScaFaCoS
1.0.1
Scalable Fast Coulomb Solvers
|
public interface definitions for the main solver-independent functionality of the ScaFaCoS library More...
Go to the source code of this file.
Macros | |
#define | FCS_NULL NULL |
#define | fcs_set_dimension fcs_set_dimensions |
#define | fcs_get_dimension fcs_get_dimensions |
#define | fcs_set_offset fcs_set_box_origin |
#define | fcs_get_offset fcs_get_box_origin |
#define | fcs_printHandle fcs_print_parameters |
#define | fcs_method_has_near fcs_delegate_near_field |
#define | fcs_parser fcs_set_parameters |
#define | fcs_require_virial fcs_set_compute_virial |
Typedefs | |
typedef struct _FCS_t * | FCS |
FCS-object representing an FCS solver. More... | |
Functions | |
FCSResult | fcs_init (FCS *new_handle, const char *method_name, MPI_Comm communicator) |
function to initialize an FCS solver More... | |
FCSResult | fcs_destroy (FCS handle) |
function to destroy an FCS solver More... | |
fcs_int | fcs_get_method (FCS handle) |
function to return the numerical identifier of the solver method More... | |
const char * | fcs_get_method_name (FCS handle) |
function to return the name of the solver method More... | |
MPI_Comm | fcs_get_communicator (FCS handle) |
function to return the MPI communicator used for the parallel execution More... | |
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 More... | |
FCSResult | fcs_set_dimensions (FCS handle, fcs_int dim) |
function to set the dimensions of the system More... | |
fcs_int | fcs_get_dimensions (FCS handle) |
function to return the dimensions of the system More... | |
FCSResult | fcs_set_near_field_flag (FCS handle, fcs_int near_field_flag) |
function to set the near-field flag More... | |
fcs_int | fcs_get_near_field_flag (FCS handle) |
function to return the near-field flag More... | |
FCSResult | fcs_set_redistribute (FCS handle, fcs_int redistribute) |
function to set the redistribution of particles before the computations (and back after the computations) More... | |
fcs_int | fcs_get_redistribute (FCS handle) |
function to return the particle redistribution setting More... | |
FCSResult | fcs_set_box_a (FCS handle, const fcs_float *box_a) |
function to set the first base vector of the system box More... | |
const fcs_float * | fcs_get_box_a (FCS handle) |
function to return the first base vector of the system box More... | |
FCSResult | fcs_set_box_b (FCS handle, const fcs_float *box_b) |
function to set the second base vector of the system box More... | |
const fcs_float * | fcs_get_box_b (FCS handle) |
function to return the second base vector of the system box More... | |
FCSResult | fcs_set_box_c (FCS handle, const fcs_float *box_c) |
function to set the third base vector of the system box More... | |
const fcs_float * | fcs_get_box_c (FCS handle) |
function to return the third base vector of the system box More... | |
FCSResult | fcs_set_box_origin (FCS handle, const fcs_float *box_origin) |
function to set the origin vector of the system box More... | |
const fcs_float * | fcs_get_box_origin (FCS handle) |
function function to return the origin vector of the system box More... | |
FCSResult | fcs_set_periodicity (FCS handle, const fcs_int *periodicity) |
function to set the periodicity of the system More... | |
const fcs_int * | fcs_get_periodicity (FCS handle) |
function to return the periodicity of the system More... | |
FCSResult | fcs_set_total_particles (FCS handle, fcs_int total_particles) |
function to set the total number of particles in the system More... | |
fcs_int | fcs_get_total_particles (FCS handle) |
function to return the total number of particles in the system More... | |
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 data arrays More... | |
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 data arrays More... | |
FCSResult | fcs_set_tolerance (FCS handle, fcs_int tolerance_type, fcs_float tolerance) |
function to set the error tolerance of the FCS solver More... | |
FCSResult | fcs_get_tolerance (FCS handle, fcs_int *tolerance_type, fcs_float *tolerance) |
function to return the error tolerance of the FCS solver More... | |
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 supported) More... | |
FCSResult | fcs_unset_r_cut (FCS handle) |
function to disable a user-defined cutoff radius for the near-field computations of the FCS solver (if supported) More... | |
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 (if supported) More... | |
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 More... | |
FCSResult | fcs_print_parameters (FCS handle) |
function to print the parameters of an FCS solver to stdout More... | |
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 More... | |
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 More... | |
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 with a finite dielectric constant of the surrounding medium epsilon are used More... | |
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 external application More... | |
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 More... | |
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 More... | |
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 More... | |
FCSResult | fcs_set_compute_virial (FCS handle, fcs_int compute_virial) |
function to set whether the virial should be computed More... | |
FCSResult | fcs_get_compute_virial (FCS handle, fcs_int *compute_virial) |
function to return whether the virial should be computed More... | |
FCSResult | fcs_get_virial (FCS handle, fcs_float *virial) |
function to return the comuputed virial More... | |
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 More... | |
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 is requested (and supported by the solver) then the solver tries to retain its sorted particle data order, i.e., the distribution and order of the given particles is changed by fcs_run such that the position, charge, field, and potential values correspond to the sorted particle order of the solver, this can only be performed successfully if the local sizes of the particle arrays (specified by the local_max_particles of fcs_run) on all processes are large enough to store the sorted particle order, after performing fcs_run, function fcs_get_resort_availability can be used to determine whether resort support is available or not, if resort support is available then fcs_get_resort_particles returns the new local number of particles and fcs_resort_[ints,floats,bytes] can be used to bring additional particle data into the new sorted order More... | |
FCSResult | fcs_get_resort (FCS handle, fcs_int *resort) |
function to return whether resort support is requested More... | |
FCSResult | fcs_get_resort_availability (FCS handle, fcs_int *availability) |
function to return whether resort support is available after executing fcs_run More... | |
FCSResult | fcs_get_resort_particles (FCS handle, fcs_int *resort_particles) |
function to return the new local number of particles More... | |
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 More... | |
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 More... | |
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 More... | |
public interface definitions for the main solver-independent functionality of the ScaFaCoS library
Definition in file fcs_interface_p.h.
#define fcs_get_dimension fcs_get_dimensions |
Definition at line 521 of file fcs_interface_p.h.
#define fcs_get_offset fcs_get_box_origin |
Definition at line 523 of file fcs_interface_p.h.
#define fcs_method_has_near fcs_delegate_near_field |
Definition at line 525 of file fcs_interface_p.h.
#define FCS_NULL NULL |
Definition at line 49 of file fcs_interface_p.h.
#define fcs_parser fcs_set_parameters |
Definition at line 526 of file fcs_interface_p.h.
#define fcs_printHandle fcs_print_parameters |
Definition at line 524 of file fcs_interface_p.h.
#define fcs_require_virial fcs_set_compute_virial |
Definition at line 527 of file fcs_interface_p.h.
#define fcs_set_dimension fcs_set_dimensions |
Definition at line 520 of file fcs_interface_p.h.
#define fcs_set_offset fcs_set_box_origin |
Definition at line 522 of file fcs_interface_p.h.
typedef struct _FCS_t* FCS |
FCS-object representing an FCS solver.
Definition at line 47 of file fcs_interface_p.h.
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 with a finite dielectric constant of the surrounding medium epsilon are used
handle | FCS-object representing an FCS solver | |
local_particles | local number of particles | |
positions | positions of the local particles. These positions should NOT be folded into the system box. | |
charges | charges of the local particles | |
epsilon | value of the dielectric constant of the surrounding medium. For metallic boundary conditions, use -1.0 (or simply do not use this function!). | |
[out] | field_correction | required correction to the field values caused by the dipole term. |
[out] | energy_correction | required correction to the total energy caused by the dipole term. |
function to compute the near-field components of the potential and the field for the solver method
handle | FCS-object representing an FCS solver |
dist | distance between interacting particles |
potential | near-field component of the potential |
field | near-field component of the field |
Note: The computed near-field components of the potential and the field do NOT include the charge values of the charges of the interacting particles.
Note: For performance reasons, this function does not perform any error checking. It is the responsibility of the user of this function to use it only (1) with a valid FCS-object, (2) when the FCS solver supports the delegation of near-field computations, and (3) all necessary parameters of the FCS solver are set (e.g., with fcs_set_common, fcs_set_... setters, or after fcs_run). Furthermore, it is the responsibility of the user of this function to use only dist values between 0.0 and the user-defined cutoff radius of the near-field computations (see fcs_set_r_cut).
function to compute the near-field component of the field for the solver method
handle | FCS-object representing an FCS solver |
dist | distance between interacting particles |
field | near-field component of the field |
Note: See fcs_compute_near for details.
function to compute the near-field component of the potential for the solver method
handle | FCS-object representing an FCS solver |
dist | distance between interacting particles |
potential | near-field component of the potential |
Note: See fcs_compute_near for details.
function to destroy an FCS solver
handle | FCS-object representing an FCS solver |
const fcs_float* fcs_get_box_a | ( | FCS | handle | ) |
function to return the first base vector of the system box
handle | FCS-object representing an FCS solver |
const fcs_float* fcs_get_box_b | ( | FCS | handle | ) |
function to return the second base vector of the system box
handle | FCS-object representing an FCS solver |
const fcs_float* fcs_get_box_c | ( | FCS | handle | ) |
function to return the third base vector of the system box
handle | FCS-object representing an FCS solver |
const fcs_float* fcs_get_box_origin | ( | FCS | handle | ) |
function function to return the origin vector of the system box
handle | FCS-object representing an FCS solver |
MPI_Comm fcs_get_communicator | ( | FCS | handle | ) |
function to return the MPI communicator used for the parallel execution
handle | FCS-object representing an FCS solver |
function to return whether the virial should be computed
handle | FCS-object representing an FCS solver |
compute_virial | whether the virial should be computed |
fcs_int fcs_get_dimensions | ( | FCS | handle | ) |
function to return the dimensions of the system
handle | FCS handle representing an FCS solver object |
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 data arrays
handle | FCS-object representing an FCS solver |
fcs_int fcs_get_method | ( | FCS | handle | ) |
function to return the numerical identifier of the solver method
handle | FCS-object representing an FCS solver |
const char* fcs_get_method_name | ( | FCS | handle | ) |
function to return the name of the solver method
handle | FCS-object representing an FCS solver |
function to return whether the solver method supports the delegation of near-field computations to an external application
handle | FCS-object representing an FCS solver |
near_field_delegation | whether the delegation of near field computation is supported |
fcs_int fcs_get_near_field_flag | ( | FCS | handle | ) |
function to return the near-field flag
handle | FCS-object representing an FCS solver |
const fcs_int* fcs_get_periodicity | ( | FCS | handle | ) |
function to return the periodicity of the system
handle | FCS-object representing an FCS solver |
function to return the user-defined cutoff radius for the near-field computations of the FCS solver (if supported)
handle | FCS handle representing an FCS solver object |
r_cut | cutoff radius for the near-field computations |
fcs_int fcs_get_redistribute | ( | FCS | handle | ) |
function to return the particle redistribution setting
handle | FCS-object representing an FCS solver |
function to return whether resort support is requested
handle | FCS-object representing an FCS solver |
resort | whether resort support is requested |
function to return whether resort support is available after executing fcs_run
handle | FCS-object representing an FCS solver |
availability | whether resort support is available |
function to return the new local number of particles
handle | FCS-object representing an FCS solver |
resort_particles | new local number of particles |
function to return the error tolerance of the FCS solver
handle | FCS-object representing an FCS solver |
tolerance_type | constant to select the type of the error tolerance value (see fcs_definitions.h) |
tolerance | error tolerance value |
fcs_int fcs_get_total_particles | ( | FCS | handle | ) |
function to return the total number of particles in the system
handle | FCS-object representing an FCS solver |
function to return the comuputed virial
handle | FCS-object representing an FCS solver |
virial | computed virial |
function to initialize an FCS solver
new_handle | pointer to an FCS-object that will represent the FCS solver |
method_name | string for selecting the solver method |
communicator | MPI communicator to be used for the parallel execution |
function to print the parameters of an FCS solver to stdout
handle | FCS-object representing an FCS solver |
function to sort additional byte particle data into the new sorted particle order
handle | FCS-object representing an FCS solver |
src | array of byte values in unsorted (original) order |
dst | array to store the sorted byte values |
n | fcs_int number of byte values for each particle |
function to sort additional float particle data into the new sorted particle order
handle | FCS-object representing an FCS solver |
src | array of float values in unsorted (original) order |
dst | array to store the sorted float values |
n | fcs_int number of float values for each particle |
function to sort additional integer particle data into the new sorted particle order
handle | FCS-object representing an FCS solver |
src | array of integer values in unsorted (original) order |
dst | array to store the sorted integer values |
n | number of integer values for each 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
handle | FCS-object representing an FCS solver |
local_particles | local number of particles |
positions | positions of the local particles |
charges | charges of the local particles |
field | calculated field values of the local particles |
potentials | calculated potential values of the local particles |
function to set the first base vector of the system box
handle | FCS-object representing an FCS solver |
box_a | first base vector of the system box |
function to set the second base vector of the system box
handle | FCS-object representing an FCS solver |
box_b | second base vector of the system box |
function to set the third base vector of the system box
handle | FCS-object representing an FCS solver |
box_c | third base vector of the system box |
function to set the origin vector of the system box
handle | FCS-object representing an FCS solver |
box_origin | origin vector of the system box |
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
handle | FCS-object representing an FCS solver |
near_field_flag | whether near-field computations should be performed by the solver method (value 1) or not (value 0) |
box_a | first base vector of the system box |
box_b | second base vector of the system box |
box_c | third base vector of the system box |
box_origin | origin vector of the system box |
periodicity | periodicity of the system in each dimension (value 0: open, value 1: periodic) |
total_particles | total number of particles in the system |
function to set whether the virial should be computed
handle | FCS-object representing an FCS solver |
compute_virial | whether the virial should be computed |
function to set the dimensions of the system
handle | FCS-object representing an FCS solver |
dim | dimensions of the system (values 1-3, default: 3) |
function to set the maximum number of particles that can be stored in the specified local particle data arrays
handle | FCS-object representing an FCS solver |
max_local_particles | maximum number of particles that can be stored locally |
function to set the maximum distance the particles have moved since the call of fcs_run
handle | FCS-object representing an FCS solver |
max_particle_move | maximum distance the particles have moved |
function to set the near-field flag
handle | FCS-object representing an FCS solver |
near_field_flag | whether near-field computations should be performed by the solver method (value 1) or not (value 0) |
function to set the parameters of the FCS solver based on a parameter string
handle | FCS-object representing an FCS solver |
parameters | char* parameter string (format: "<1st parameter name>,<1st comma-separated value(s)>,<2nd parameter name>,<2nd comma-separated value(s)>,...") |
continue_on_errors | whether to continue if setting a parameter fails |
function to set the periodicity of the system
handle | FCS-object representing an FCS solver |
periodicity | periodicity of the system in each dimension (value 0: open, value 1: periodic) |
function to set a user-defined cutoff radius for the near-field computations of the FCS solver (if supported)
handle | FCS handle representing an FCS solver object |
r_cut | cutoff radius for the near-field computations |
function to set the redistribution of particles before the computations (and back after the computations)
handle | FCS-object representing an FCS solver |
redistribute | whether the particles should remain where they are (value 0) or be equally distributed among all processes (value 1) |
function to set whether resort support is requested (default is no resort support) if resort support is requested (and supported by the solver) then the solver tries to retain its sorted particle data order, i.e., the distribution and order of the given particles is changed by fcs_run such that the position, charge, field, and potential values correspond to the sorted particle order of the solver, this can only be performed successfully if the local sizes of the particle arrays (specified by the local_max_particles of fcs_run) on all processes are large enough to store the sorted particle order, after performing fcs_run, function fcs_get_resort_availability can be used to determine whether resort support is available or not, if resort support is available then fcs_get_resort_particles returns the new local number of particles and fcs_resort_[ints,floats,bytes] can be used to bring additional particle data into the new sorted order
handle | FCS-object representing an FCS solver |
resort | whether resort support is requested |
function to set the error tolerance of the FCS solver
handle | FCS-object representing an FCS solver |
tolerance_type | constant to select the type of the error tolerance value (see fcs_definitions.h) |
tolerance | error tolerance value |
function to set the total number of particles in the system
handle | FCS-object representing an FCS solver |
total_particles | total number of particles in the system |
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
handle | FCS-object representing an FCS solver |
local_particles | local number of particles |
positions | positions of the local particles used for the tuning |
charges | charges of the local particles used for the tuning |