23 #include "fcs_definitions.h" 39 #define FCS_P3M_USE_ERFC_APPROXIMATION 1 88 static inline fcs_float
90 const fcs_float alpha = params.
alpha;
92 fcs_float adist = alpha * dist;
94 #if FCS_P3M_USE_ERFC_APPROXIMATION 99 fcs_float t = 1.0 / (1.0 + 0.3275911 * adist);
100 fcs_float erfc_part_ri = exp(-adist*adist) *
111 fcs_float erfc_part_ri = (1.0 - erf(adist)) / dist;
115 return erfc_part_ri-potentialOffset;
132 static inline fcs_float
134 const fcs_float alpha = params.
alpha;
135 fcs_float adist = alpha * dist;
137 #if FCS_P3M_USE_ERFC_APPROXIMATION 142 fcs_float t = 1.0 / (1.0 + 0.3275911 * adist);
143 fcs_float erfc_part_ri = exp(-adist*adist) *
151 return -(erfc_part_ri + 2.0*alpha*0.56418958354775627928034964498*exp(-adist*adist))
156 fcs_float erfc_part_ri = (1.0 - erf(adist)) / dist;
158 return -(erfc_part_ri + 2.0*alpha*0.56418958354775627928034964498*exp(-adist*adist))
184 fcs_float *potential, fcs_float *field) {
185 const fcs_float alpha = params.
alpha;
187 fcs_float adist = alpha * dist;
189 #if FCS_P3M_USE_ERFC_APPROXIMATION 194 fcs_float t = 1.0 / (1.0 + 0.3275911 * adist);
195 fcs_float erfc_part_ri = exp(-adist*adist) *
203 *potential = erfc_part_ri-potentialOffset;
204 *field = -(erfc_part_ri + 2.0*alpha*0.56418958354775627928034964498*exp(-adist*adist))
209 fcs_float erfc_part_ri = (1.0 - erf(adist)) / dist;
210 *potential = erfc_part_ri-potentialOffset;
211 *field = -(erfc_part_ri + 2.0*alpha*0.56418958354775627928034964498*exp(-adist*adist))
FCSResult fcs_p3m_set_grid_tune(FCS handle)
FCSResult fcs_p3m_get_tolerance_field(FCS handle, fcs_float *tolerance_field)
FCSResult fcs_p3m_get_cao(FCS handle, fcs_int *cao)
FCSResult fcs_p3m_set_cao(FCS handle, fcs_int cao)
fcs_float potentialOffset
FCSResult fcs_p3m_get_r_cut(FCS handle, fcs_float *r_cut)
FCSResult fcs_p3m_set_alpha_tune(FCS handle)
FCSResult fcs_p3m_set_r_cut(FCS handle, fcs_float r_cut)
fcs_int fcs_p3m_get_potential_shift(FCS handle)
FCSResult fcs_p3m_distribute_parameters()
FCSResult fcs_p3m_set_tolerance_field(FCS handle, fcs_float tolerance_field)
FCSResult fcs_p3m_set_tolerance_field_tune(FCS handle)
FCSResult fcs_p3m_get_alpha(FCS handle, fcs_float *alpha)
FCSResult fcs_p3m_get_near_parameters(FCS handle, fcs_p3m_near_parameters_t *near_params)
extracts the parameters required to compute the near-field component of p3m from the method handle ...
public interface definitions for the FCSResult-object that is used for handling the return state of t...
FCSResult fcs_p3m_set_alpha(FCS handle, fcs_float alpha)
void fcs_p3m_set_tolerance_field_f(void *handle, fcs_float tolerance_field, fcs_int *return_value)
FCSResult fcs_p3m_set_r_cut_tune(FCS handle)
FCSResult fcs_p3m_set_grid(FCS handle, fcs_int grid)
struct FCSResult_t * FCSResult
FCSResult-object that is used for handling the return state of the ScaFaCoS library functions...
FCSResult fcs_p3m_get_total_energy(FCS handle, fcs_float *total_energy)
public interface definitions for the main solver-independent functionality of the ScaFaCoS library ...
FCSResult fcs_p3m_set_cao_tune(FCS handle)
The struct that keeps the parameters for the near field component of the method.
FCSResult fcs_p3m_require_total_energy(FCS handle, fcs_int total_energy)
FCSResult fcs_p3m_get_grid(FCS handle, fcs_int *grid)
struct _FCS_t * FCS
FCS-object representing an FCS solver.
FCSResult fcs_p3m_set_potential_shift(FCS handle, fcs_int flag)