ScaFaCoS  1.0.1
Scalable Fast Coulomb Solvers
fcs_fmm_p.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011-2012 Rene Halver
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_FMM_P_INCLUDED
23 #define FCS_FMM_P_INCLUDED
24 
25 #include "fcs_definitions.h"
26 #include "fcs_result_p.h"
27 #include "fcs_interface_p.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
39 typedef struct fcs_fmm_parameters_t *fcs_fmm_parameters;
40 
41 #define FCS_FMM_COULOMB 64
42 #define FCS_FMM_CUSP 65
43 #define FCS_FMM_NO_DIPOLE_CORRECTION -1
44 #define FCS_FMM_STANDARD_DIPOLE_CORRECTION 0
45 
46 
47 #define FCS_FMM_ACTIVE_DIPOLE_CORRECTION 1
48 #define FCS_FMM_STANDARD_ERROR 0
49 #define FCS_FMM_CUSTOM_ABSOLUTE 1
50 #define FCS_FMM_CUSTOM_RELATIVE 2
51 
52 #define FCS_FMM_INHOMOGENOUS_SYSTEM 1LL
53 #define FCS_FMM_HOMOGENOUS_SYSTEM 0LL
54 
64 FCSResult fcs_fmm_set_absrel(FCS handle, fcs_int choice);
65 
72 FCSResult fcs_fmm_get_absrel(FCS handle, fcs_int *absrel);
73 
81 FCSResult fcs_fmm_set_tolerance_energy(FCS handle, fcs_float tolerance_energy);
82 
89 FCSResult fcs_fmm_get_tolerance_energy(FCS handle, fcs_float *tolerance_energy);
90 
100 FCSResult fcs_fmm_set_dipole_correction(FCS handle, fcs_int dipole_correction);
101 
109 FCSResult fcs_fmm_get_dipole_correction(FCS handle, fcs_int *dipole_correction);
110 
120 FCSResult fcs_fmm_set_potential(FCS handle, fcs_int coulomb);
121 
129 FCSResult fcs_fmm_get_potential(FCS handle, fcs_int *coulomb);
130 
137 FCSResult fcs_fmm_set_internal_tuning(FCS handle, fcs_int system);
138 
146 FCSResult fcs_fmm_get_internal_tuning(FCS handle, fcs_int *system);
147 
154 FCSResult fcs_fmm_set_cusp_radius(FCS handle, fcs_float radius);
155 
163 FCSResult fcs_fmm_get_cusp_radius(FCS handle, fcs_float *cusp_radius);
164 
171 FCSResult fcs_fmm_set_maxdepth(FCS handle, fcs_int depth);
172 
179 FCSResult fcs_fmm_get_maxdepth(FCS handle, fcs_int *depth);
180 
187 FCSResult fcs_fmm_set_unroll_limit(FCS handle, fcs_int limit);
188 
195 FCSResult fcs_fmm_get_unroll_limit(FCS handle, fcs_int *limit);
196 
203 FCSResult fcs_fmm_set_balanceload(FCS handle, fcs_int load);
204 
211 FCSResult fcs_fmm_get_balanceload(FCS handle, fcs_int *load);
212 
219 FCSResult fcs_fmm_set_define_loadvector(FCS handle, fcs_int define_loadvector);
220 FCSResult fcs_fmm_get_define_loadvector(FCS handle, fcs_int *define_loadvector);
221 
222 /*
223  * @brief combined setter function for all fmm related parameters
224  * @param handle FCS-object that is modified
225  * @param choice fcs_int choice for fmm which error boundary should be used:
226  * 0 - relative error with 10^(-3)
227  * 1 - relative error with energy tolerance (deltaE)
228  * 2 - absolute error with energy tolerance (deltaE)
229  * @param tolerance_energy [deltaE] fcs_float error boundary to be used by fmm (only applicable
230  * if absrel is either 1 or 2)
231  * @param dipole_correction fcs_int chooses which form of dipole correction fmm should use:
232  * -1 = no dipole correction
233  * 0 = standard dipole correction
234  * 1 = dipole correction activated
235  * @param potential fcs_int chooses which potential to use
236  * 1 = coulomb potential (ignores radius, see below)
237  * 2 = cusp potential (requires radius)
238  * @param radius fcs_float sets the radius for the cusp potential, if chosen
239  * @return FCSResult-object containing the return state
240  */
241 FCSResult fcs_fmm_setup(FCS handle, fcs_int absrel, fcs_float tolerance_energy, fcs_int dipole_correction, fcs_int system, fcs_int maxdepth, fcs_int unroll_limit, fcs_int load/*, fcs_int potential, fcs_float radius*/);
242 
243 void fcs_fmm_setup_f(void *handle, fcs_int absrel, fcs_float tolerance_energy, fcs_int dipole_correction, fcs_int *return_value);
244 
245 #ifdef __cplusplus
246 }
247 #endif
248 
249 #endif
FCSResult fcs_fmm_set_internal_tuning(FCS handle, fcs_int system)
function to set the fmm internal tuning parameter
FCSResult fcs_fmm_get_tolerance_energy(FCS handle, fcs_float *tolerance_energy)
function to get the optional fmm energy tolerance (deltaE) parameter
FCSResult fcs_fmm_get_maxdepth(FCS handle, fcs_int *depth)
function to get the optional fmm absrel parameter
FCSResult fcs_fmm_get_define_loadvector(FCS handle, fcs_int *define_loadvector)
FCSResult fcs_fmm_set_tolerance_energy(FCS handle, fcs_float tolerance_energy)
function to set the optional fmm deltaE parameter, which gives the energy tolerance for the FMM ...
FCSResult fcs_fmm_set_absrel(FCS handle, fcs_int choice)
function to set the optional fmm absrel parameter
FCSResult fcs_fmm_get_cusp_radius(FCS handle, fcs_float *cusp_radius)
function to get the fmm cusp radius parameter
FCSResult fcs_fmm_set_maxdepth(FCS handle, fcs_int depth)
function to set the optional fmm absrel parameter
FCSResult fcs_fmm_set_balanceload(FCS handle, fcs_int load)
function to set the optional fmm absrel parameter
struct fcs_fmm_parameters_t * fcs_fmm_parameters
Definition: fcs_fmm_p.h:39
FCSResult fcs_fmm_set_potential(FCS handle, fcs_int coulomb)
function to set the fmm parameter parameter
FCSResult fcs_fmm_get_unroll_limit(FCS handle, fcs_int *limit)
function to get the optional fmm absrel parameter
void fcs_fmm_setup_f(void *handle, fcs_int absrel, fcs_float tolerance_energy, fcs_int dipole_correction, fcs_int *return_value)
public interface definitions for the FCSResult-object that is used for handling the return state of t...
FCSResult fcs_fmm_get_internal_tuning(FCS handle, fcs_int *system)
function to get the fmm internal tuning parameter
FCSResult fcs_fmm_set_dipole_correction(FCS handle, fcs_int dipole_correction)
function to set the optional fmm energy tolerance (deltaE) parameter
FCSResult fcs_fmm_get_potential(FCS handle, fcs_int *coulomb)
function to get the fmm coulomb parameter
FCSResult fcs_fmm_get_dipole_correction(FCS handle, fcs_int *dipole_correction)
function to get the optional fmm dipole correction parameter
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_fmm_get_absrel(FCS handle, fcs_int *absrel)
function to get the optional fmm absrel parameter
public interface definitions for the main solver-independent functionality of the ScaFaCoS library ...
FCSResult fcs_fmm_set_unroll_limit(FCS handle, fcs_int limit)
function to set the optional fmm absrel parameter
FCSResult fcs_fmm_set_cusp_radius(FCS handle, fcs_float radius)
function to set the fmm cusp radius parameter
FCSResult fcs_fmm_get_balanceload(FCS handle, fcs_int *load)
function to get the optional fmm absrel parameter
FCSResult fcs_fmm_set_define_loadvector(FCS handle, fcs_int define_loadvector)
function to set the optional fmm loadvector parameter
struct _FCS_t * FCS
FCS-object representing an FCS solver.
FCSResult fcs_fmm_setup(FCS handle, fcs_int absrel, fcs_float tolerance_energy, fcs_int dipole_correction, fcs_int system, fcs_int maxdepth, fcs_int unroll_limit, fcs_int load)