int interactions_sanity_checks() { /* set to zero if initialization was not successful. */ int state = 1; #ifdef ELECTROSTATICS switch (coulomb.method) { case COULOMB_MMM1D: if (MMM1D_sanity_checks()) state = 0; break; case COULOMB_MMM2D: if (MMM2D_sanity_checks()) state = 0; break; #ifdef P3M case COULOMB_ELC_P3M: if (ELC_sanity_checks()) state = 0; // fall through case COULOMB_P3M_GPU: case COULOMB_P3M: if (p3m_sanity_checks()) state = 0; break; #endif default: break; } #endif /* ifdef ELECTROSTATICS */ #ifdef DIPOLES switch (coulomb.Dmethod) { #ifdef DP3M case DIPOLAR_MDLC_P3M: if (mdlc_sanity_checks()) state = 0; // fall through case DIPOLAR_P3M: if (dp3m_sanity_checks()) state = 0; break; #endif case DIPOLAR_MDLC_DS: if (mdlc_sanity_checks()) state = 0; // fall through case DIPOLAR_DS: if (magnetic_dipolar_direct_sum_sanity_checks()) state = 0; break; default: break; } #endif /* ifdef DIPOLES */ return state; }
void MMM1D_init() { if (MMM1D_sanity_checks()) return; if (mmm1d_params.far_switch_radius_2 >= SQR(box_l[2])) mmm1d_params.far_switch_radius_2 = 0.8*SQR(box_l[2]); MMM1D_setup_constants(); if (mmm1d_params.bessel_calculated) { mmm1d_params.bessel_cutoff = determine_bessel_cutoff(sqrt(mmm1d_params.far_switch_radius_2), mmm1d_params.maxPWerror, MAXIMAL_B_CUT); } MMM1D_recalcTables(); }
void MMM1D_init() { if (MMM1D_sanity_checks()) return; if (mmm1d_params.far_switch_radius_2 >= SQR(box_l[2])) mmm1d_params.far_switch_radius_2 = 0.8*SQR(box_l[2]); uz = 1/box_l[2]; L2 = box_l[2]*box_l[2]; uz2 = uz*uz; prefuz2 = coulomb.prefactor*uz2; prefL3_i = prefuz2*uz; determine_bessel_radii(mmm1d_params.maxPWerror, MAXIMAL_B_CUT); prepare_polygamma_series(mmm1d_params.maxPWerror, mmm1d_params.far_switch_radius_2); }