ESPResSo 3.2.0-167-g2c9ead1-git
Extensible Simulation Package for Soft Matter Research
Functions | Variables
interaction_data.c File Reference

Implementation of interaction_data.h. More...

#include <string.h>
#include <stdlib.h>
#include "utils.h"
#include "rattle.h"
#include "interaction_data.h"
#include "errorhandling.h"
#include "communication.h"
#include "grid.h"
#include "pressure.h"
#include "p3m.h"
#include "debye_hueckel.h"
#include "reaction_field.h"
#include "mmm1d.h"
#include "mmm2d.h"
#include "maggs.h"
#include "elc.h"
#include "lj.h"
#include "ljgen.h"
#include "ljangle.h"
#include "steppot.h"
#include "hertzian.h"
#include "gaussian.h"
#include "buckingham.h"
#include "soft_sphere.h"
#include "hat.h"
#include "tab.h"
#include "overlap.h"
#include "ljcos.h"
#include "ljcos2.h"
#include "gb.h"
#include "cells.h"
#include "comforce.h"
#include "comfixed.h"
#include "morse.h"
#include "dpd.h"
#include "tunable_slip.h"
#include "magnetic_non_p3m_methods.h"
#include "mdlc_correction.h"
#include "initialize.h"
Include dependency graph for interaction_data.c:

Go to the source code of this file.

Functions

static void recalc_global_maximal_nonbonded_cutoff ()
 calculates and returns the maximal global nonbonded cutoff that is required.
static void recalc_maximal_cutoff_bonded ()
 calculate the maximal cutoff of bonded interactions, required to determine the cell size for communication.
void force_and_energy_tables_init ()
 Initialize force and energy tables.
void tf_tables_init ()
void initialize_ia_params (IA_parameters *params)
 Initialize interaction parameters.
void copy_ia_params (IA_parameters *dst, IA_parameters *src)
 Copy interaction parameters.
IA_parametersget_ia_param_safe (int i, int j)
 get interaction parameters between particle sorts i and j.
void initialize_tf_params (TF_parameters *params)
void copy_tf_params (TF_parameters *dst, TF_parameters *src)
int checkIfTF (TF_parameters *data)
static void recalc_maximal_cutoff_nonbonded ()
void recalc_maximal_cutoff ()
 calculates the maximal cutoff of all real space interactions.
char * get_name_of_bonded_ia (int i)
void realloc_ia_params (int nsize)
 This function increases the LOCAL ia_params field for non-bonded interactions to the given size.
void realloc_tf_params (int nsize)
void make_particle_type_exist (int type)
 Makes sure that ia_params is large enough to cover interactions for this particle type.
void make_bond_type_exist (int type)
 Makes sure that bonded_ia_params is large enough to cover the parameters for the bonded interaction type.
int check_obs_calc_initialized ()
 check whether all force calculation routines are properly initialized.
int coulomb_set_bjerrum (double bjerrum)
int dipolar_set_Dbjerrum (double bjerrum)
void recalc_coulomb_prefactor ()
 call when the temperature changes, for Bjerrum length adjusting.
int virtual_set_params (int bond_type)

Variables

int n_particle_types = 0
 Maximal particle type seen so far.
int n_interaction_types = 0
IA_parametersia_params = NULL
TF_parameterstf_params = NULL
Coulomb_parameters coulomb
 Structure containing the coulomb parameters.
Debye_hueckel_params dh_params = { 0.0, 0.0 }
 Structure containing the Debye-Hueckel parameters.
Reaction_field_params rf_params = { 0.0, 0.0 }
 Structure containing the Reaction Field parameters.
int n_bonded_ia = 0
 number of bonded interactions.
Bonded_ia_parametersbonded_ia_params = NULL
 Field containing the paramters of the bonded ia types.
double min_global_cut = 0.0
 Minimal global interaction cutoff.
double max_cut
 Maximal interaction cutoff.
double max_cut_nonbonded
 Maximal interaction cutoff (real space/short range non-bonded interactions).
double max_cut_bonded
 Maximal interaction cutoff (real space/short range bonded interactions).
double max_cut_global
 maximal cutoff of type-independent short range ia, mainly electrostatics and DPD
DoubleList tabulated_forces
 Array containing all tabulated forces.
DoubleList tabulated_energies
 Corresponding array containing all tabulated energies.
DoubleList thermodynamic_forces
 Array containing the thermodynamic forces.
DoubleList thermodynamic_f_energies

Detailed Description

Implementation of interaction_data.h.

Definition in file interaction_data.c.


Function Documentation

int check_obs_calc_initialized ( )
int checkIfTF ( TF_parameters data)

Definition at line 402 of file interaction_data.c.

References TF_parameters::TF_TAB_maxval.

void copy_ia_params ( IA_parameters dst,
IA_parameters src 
)

Copy interaction parameters.

copy a set of interaction parameters.

Definition at line 376 of file interaction_data.c.

Referenced by mpi_bcast_ia_params(), mpi_bcast_ia_params_slave(), and realloc_ia_params().

void copy_tf_params ( TF_parameters dst,
TF_parameters src 
)

Definition at line 398 of file interaction_data.c.

Referenced by realloc_tf_params().

int coulomb_set_bjerrum ( double  bjerrum)
int dipolar_set_Dbjerrum ( double  bjerrum)
void force_and_energy_tables_init ( )

Initialize force and energy tables.

Function for initializing force and energy tables.

Definition at line 142 of file interaction_data.c.

References init_doublelist().

Referenced by on_program_start().

IA_parameters* get_ia_param_safe ( int  i,
int  j 
)
char* get_name_of_bonded_ia ( int  i)
void initialize_ia_params ( IA_parameters params)

Initialize interaction parameters.

Definition at line 165 of file interaction_data.c.

References IA_parameters::BMHTF_A, IA_parameters::BMHTF_B, IA_parameters::BMHTF_C, IA_parameters::BMHTF_computed_shift, IA_parameters::BMHTF_cut, IA_parameters::BMHTF_D, IA_parameters::BMHTF_sig, IA_parameters::BUCK_A, IA_parameters::BUCK_B, IA_parameters::BUCK_C, IA_parameters::BUCK_capradius, IA_parameters::BUCK_cut, IA_parameters::BUCK_D, IA_parameters::BUCK_discont, IA_parameters::BUCK_F1, IA_parameters::BUCK_F2, IA_parameters::BUCK_shift, IA_parameters::COMFIXED_flag, IA_parameters::COMFORCE_dir, IA_parameters::COMFORCE_flag, IA_parameters::COMFORCE_force, IA_parameters::COMFORCE_fratio, IA_parameters::dpd_gamma, IA_parameters::dpd_pref1, IA_parameters::dpd_pref2, IA_parameters::dpd_pref3, IA_parameters::dpd_pref4, IA_parameters::dpd_r_cut, IA_parameters::dpd_tgamma, IA_parameters::dpd_tr_cut, IA_parameters::dpd_wf, IA_parameters::Gaussian_cut, IA_parameters::Gaussian_eps, IA_parameters::Gaussian_sig, IA_parameters::GB_chi1, IA_parameters::GB_chi2, IA_parameters::GB_cut, IA_parameters::GB_eps, IA_parameters::GB_k1, IA_parameters::GB_k2, IA_parameters::GB_mu, IA_parameters::GB_nu, IA_parameters::GB_sig, IA_parameters::HAT_Fmax, IA_parameters::HAT_r, IA_parameters::Hertzian_eps, IA_parameters::Hertzian_sig, INACTIVE_CUTOFF, IA_parameters::LJ_capradius, IA_parameters::LJ_cut, IA_parameters::LJ_eps, IA_parameters::LJ_min, IA_parameters::LJ_offset, IA_parameters::LJ_shift, IA_parameters::LJ_sig, IA_parameters::LJANGLE_bonded1neg, IA_parameters::LJANGLE_bonded1pos, IA_parameters::LJANGLE_bonded1type, IA_parameters::LJANGLE_bonded2neg, IA_parameters::LJANGLE_bonded2pos, IA_parameters::LJANGLE_capradius, IA_parameters::LJANGLE_cut, IA_parameters::LJANGLE_dz, IA_parameters::LJANGLE_eps, IA_parameters::LJANGLE_epsprime, IA_parameters::LJANGLE_kappa, IA_parameters::LJANGLE_sig, IA_parameters::LJANGLE_z0, IA_parameters::LJCOS2_capradius, IA_parameters::LJCOS2_cut, IA_parameters::LJCOS2_eps, IA_parameters::LJCOS2_offset, IA_parameters::LJCOS2_rchange, IA_parameters::LJCOS2_sig, IA_parameters::LJCOS2_w, IA_parameters::LJCOS_alfa, IA_parameters::LJCOS_beta, IA_parameters::LJCOS_cut, IA_parameters::LJCOS_eps, IA_parameters::LJCOS_offset, IA_parameters::LJCOS_rmin, IA_parameters::LJCOS_sig, IA_parameters::LJGEN_a1, IA_parameters::LJGEN_a2, IA_parameters::LJGEN_b1, IA_parameters::LJGEN_b2, IA_parameters::LJGEN_capradius, IA_parameters::LJGEN_cut, IA_parameters::LJGEN_eps, IA_parameters::LJGEN_offset, IA_parameters::LJGEN_shift, IA_parameters::LJGEN_sig, IA_parameters::max_cut, max_cut_global, IA_parameters::mol_cut_cutoff, IA_parameters::mol_cut_type, IA_parameters::MORSE_alpha, IA_parameters::MORSE_capradius, IA_parameters::MORSE_cut, IA_parameters::MORSE_eps, IA_parameters::MORSE_rest, IA_parameters::MORSE_rmin, IA_parameters::particlesInteract, IA_parameters::REACTION_range, IA_parameters::rf_on, IA_parameters::SmSt_cut, IA_parameters::SmSt_d, IA_parameters::SmSt_eps, IA_parameters::SmSt_k0, IA_parameters::SmSt_n, IA_parameters::SmSt_sig, IA_parameters::soft_a, IA_parameters::soft_cut, IA_parameters::soft_n, IA_parameters::soft_offset, IA_parameters::TAB_filename, IA_parameters::TAB_maxval, IA_parameters::TAB_minval, IA_parameters::TAB_npoints, IA_parameters::TAB_startindex, IA_parameters::TAB_stepsize, IA_parameters::TUNABLE_SLIP_gamma, IA_parameters::TUNABLE_SLIP_r_cut, IA_parameters::TUNABLE_SLIP_temp, IA_parameters::TUNABLE_SLIP_time, IA_parameters::TUNABLE_SLIP_vx, IA_parameters::TUNABLE_SLIP_vy, and IA_parameters::TUNABLE_SLIP_vz.

Referenced by realloc_ia_params().

void initialize_tf_params ( TF_parameters params)
void make_bond_type_exist ( int  type)
void make_particle_type_exist ( int  type)
void realloc_ia_params ( int  nsize)

This function increases the LOCAL ia_params field for non-bonded interactions to the given size.

This function increases the LOCAL ia_params field to the given size.

This function is not exported since it does not do this on all nodes. Use make_particle_type_exist for that.

Definition at line 781 of file interaction_data.c.

References copy_ia_params(), free, i, initialize_ia_params(), malloc, and n_particle_types.

Referenced by mpi_bcast_n_particle_types_slave().

void realloc_tf_params ( int  nsize)
void recalc_coulomb_prefactor ( )

call when the temperature changes, for Bjerrum length adjusting.

Definition at line 1002 of file interaction_data.c.

References Coulomb_parameters::bjerrum, Coulomb_parameters::Dbjerrum, Coulomb_parameters::Dprefactor, Coulomb_parameters::prefactor, and temperature.

Referenced by on_coulomb_change().

static void recalc_global_maximal_nonbonded_cutoff ( ) [static]
void recalc_maximal_cutoff ( )

calculates the maximal cutoff of all real space interactions.

these are: bonded, non bonded + real space electrostatics. The result is stored in the global variable max_cut. The maximal cutoff of the non-bonded + real space electrostatic interactions is stored in max_cut_non_bonded. This value is used in the verlet pair list algorithm (see verlet.h).

Definition at line 714 of file interaction_data.c.

References max_cut, max_cut_bonded, max_cut_nonbonded, recalc_maximal_cutoff_bonded(), and recalc_maximal_cutoff_nonbonded().

Referenced by on_parameter_change(), on_short_range_ia_change(), and propagate_press_box_pos_and_rescale_npt().

static void recalc_maximal_cutoff_bonded ( ) [static]
static void recalc_maximal_cutoff_nonbonded ( ) [static]
void tf_tables_init ( )

Definition at line 157 of file interaction_data.c.

References init_doublelist().

Referenced by on_program_start().

int virtual_set_params ( int  bond_type)

Variable Documentation

Field containing the paramters of the bonded ia types.

Definition at line 94 of file interaction_data.c.

Referenced by add_area_global_force(), add_bonded_energy(), add_bonded_force(), add_bonded_virials(), add_three_body_bonded_stress(), add_volume_force(), angle_cosine_set_params(), angle_cossquare_set_params(), angle_harmonic_set_params(), angle_set_params(), angledist_set_params(), area_force_global_set_params(), area_force_local_set_params(), auto_exclusion(), bending_force_set_params(), calc_area_global(), calc_volume(), collectBonds(), collision_detection_set_params(), compute_pos_corr_vec(), compute_vel_corr_vec(), detect_collision(), dihedral_set_params(), endangledist_set_params(), fene_set_params(), handle_collisions(), harmonic_set_params(), local_change_bond(), local_stress_tensor_calc(), mpi_bcast_ia_params(), mpi_bcast_ia_params_slave(), mpi_send_bond(), overlapped_bonded_set_params(), polymerC(), print_bond_len(), remove_all_bonds_to(), rigid_bond_set_params(), stretching_force_set_params(), subt_lj_set_params(), tabulated_bonded_set_params(), tclcommand_analyze_print_all(), tclcommand_analyze_print_pressure_all(), tclcommand_analyze_print_stress_tensor_all(), tclcommand_diamond(), tclcommand_icosaeder(), tclcommand_inter_print_all(), tclcommand_inter_print_partner_num(), tclcommand_part_parse_bond(), tclcommand_part_print_bond_partners(), tclcommand_part_print_bonding_structure(), tclprint_to_result_BondedIA(), try_delete_bond(), and volume_force_set_params().

Initial value:
 { 

  0.0, 0.0, COULOMB_NONE,


  0.0, 0.0, DIPOLAR_NONE,

}

Structure containing the coulomb parameters.

Definition at line 78 of file interaction_data.c.

Referenced by add_dh_coulomb_pair_force(), add_dipole_force(), add_mdlc_energy_corrections(), add_mdlc_force_corrections(), add_mmm1d_coulomb_pair_force(), add_mmm2d_coulomb_pair_force(), add_non_bonded_pair_energy(), add_non_bonded_pair_force(), add_non_bonded_pair_force_iccp3m(), add_non_bonded_pair_virials(), add_plate_force(), add_rf_coulomb_pair_force_no_cutoff(), add_rod_force(), add_z_force(), calc_dipole_dipole_ia(), calc_long_range_energies(), calc_long_range_forces(), calc_long_range_forces_iccp3m(), calc_long_range_virials(), calc_surface_term(), cuda_mpi_get_particles(), cuda_mpi_get_particles_slave(), dawaanr_set_params(), dh_coulomb_pair_energy(), dipole_energy(), dp3m_add_pair_force(), dp3m_calc_kspace_forces(), dp3m_get_accuracy(), dp3m_init(), dp3m_mc_time(), dp3m_mcr_time(), dp3m_pair_energy(), dp3m_scaleby_box_l(), dp3m_set_params(), dp3m_set_tune_params(), ELC_init(), ELC_set_params(), get_nonbonded_interaction(), iccp3m_iteration(), iccp3m_sanity_check(), init_energies(), init_p_tensor(), init_virials(), integrate_vv(), maggs_init(), magnetic_dipolar_direct_sum_calculations(), mdds_set_params(), mdlc_set_params(), mmm1d_coulomb_pair_energy(), MMM1D_set_params(), MMM1D_setup_constants(), mmm1d_tune(), mmm2d_coulomb_pair_energy(), MMM2D_dielectric_layers_energy_contribution(), MMM2D_init(), MMM2D_self_energy(), MMM2D_set_params(), mpi_bcast_coulomb_params_slave(), on_boxl_change(), on_cell_structure_change(), on_coulomb_change(), on_ghost_flags_change(), on_integration_start(), on_observable_calc(), on_resort_particles(), p3m_add_pair_force(), p3m_calc_dipole_term(), p3m_calc_kspace_forces(), p3m_calc_kspace_stress(), p3m_get_accuracy(), p3m_init(), p3m_mc_time(), p3m_mcr_time(), p3m_pair_energy(), p3m_scaleby_box_l(), p3m_set_params(), p3m_set_tune_params(), plate_energy(), rf_coulomb_pair_energy_no_cutoff(), rod_energy(), setup_P(), setup_PQ(), setup_Q(), setup_z_energy(), setup_z_force(), tclcommand_analyze_print_all(), tclcommand_analyze_print_pressure_all(), tclcommand_analyze_print_stress_tensor_all(), tclcommand_integrate_set_npt_isotropic(), tclcommand_inter_coulomb_parse_dh(), tclcommand_inter_coulomb_parse_maggs(), tclcommand_inter_coulomb_parse_p3m(), tclcommand_inter_coulomb_parse_rf(), tclcommand_inter_parse_coulomb(), tclcommand_inter_parse_magnetic(), tclcommand_inter_print_all(), tclprint_to_result_CoulombIA(), tclprint_to_result_DipolarIA(), tclprint_to_result_p3m(), and z_energy().

Structure containing the Debye-Hueckel parameters.

Definition at line 89 of file interaction_data.c.

Referenced by dh_set_params(), mpi_bcast_coulomb_params_slave(), and tclprint_to_result_dh().

double max_cut

Maximal interaction cutoff.

Maximal interaction cutoff (real space/short range interactions).

Definition at line 98 of file interaction_data.c.

Referenced by cells_on_geometry_change(), dd_create_cell_grid(), dd_on_geometry_change(), incubewithskin(), local_stress_tensor_calc(), on_integration_start(), and recalc_maximal_cutoff().

Maximal interaction cutoff (real space/short range bonded interactions).

Definition at line 100 of file interaction_data.c.

Referenced by recalc_maximal_cutoff(), recalc_maximal_cutoff_bonded(), and recalc_maximal_cutoff_nonbonded().

maximal cutoff of type-independent short range ia, mainly electrostatics and DPD

Definition at line 103 of file interaction_data.c.

Referenced by initialize_ia_params(), recalc_global_maximal_nonbonded_cutoff(), and recalc_maximal_cutoff_nonbonded().

double min_global_cut = 0.0

Minimal global interaction cutoff.

Particles with a distance smaller than this are guaranteed to be available on the same node (through ghosts).

Definition at line 96 of file interaction_data.c.

Referenced by recalc_global_maximal_nonbonded_cutoff(), tclcallback_min_global_cut(), and vs_relate_to().

int n_bonded_ia = 0

Definition at line 68 of file interaction_data.c.

Structure containing the Reaction Field parameters.

Definition at line 90 of file interaction_data.c.

Referenced by mpi_bcast_coulomb_params_slave(), rf_set_params(), and tclprint_to_result_rf().

Corresponding array containing all tabulated energies.

Array containing all tabulated energies.

Definition at line 108 of file interaction_data.c.

Referenced by mpi_bcast_ia_params(), mpi_bcast_ia_params_slave(), tabulated_pair_energy(), and tabulated_set_params().

Definition at line 73 of file interaction_data.c.

Referenced by add_thermodynamic_force(), and get_tf_param().

Array containing the thermodynamic forces.

Definition at line 120 of file interaction_data.c.

Referenced by mpi_bcast_tf_params(), mpi_bcast_tf_params_slave(), tf_profile(), and tf_set_params().