ESPResSo 3.2.0-159-gf5c8922-git
Extensible Simulation Package for Soft Matter Research
initialize.h File Reference

This file contains the hook procedures. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

Hook procedures

These procedures are called if several significant changes to the system happen which may make a reinitialization of subsystems necessary.

Note that all these functions are called on ALL nodes. if you need to do something only on the master node, check this_node == 0. The use of the asynchronous mpi_* functions (e. g. mpi_bcast_parameter) on the master node is possible.

void on_program_start ()
 called once at the very beginning of the program start.
void on_integration_start ()
 called every time the simulation is continued/started, i.
void on_observable_calc ()
 called before calculating observables, i.e.
void on_particle_change ()
 called every time a particle property is changed via Tcl.
void on_resort_particles ()
 called every time the particles are resorted from node to node.
void on_coulomb_change ()
 called every time the coulomb parameters are changed.
void on_short_range_ia_change ()
 called every time short ranged interaction parameters are changed.
void on_constraint_change ()
 called every time a constraint is changed.
void on_max_cut_change ()
 called whenever the cutoff has potentially changed.
void on_boxl_change ()
 called every time the box length has changed.
void on_cell_structure_change ()
 called every time a major change to the cell structure has happened, like the skin or grid have changed.
void on_temperature_change ()
 called every time the temperature changes.
void on_parameter_change (int parameter)
 called every time other parameters (timestep,...) are changed.
void on_n_particle_types_change ()
 called every time the number of particle types has changed (increased)
void on_ghost_flags_change ()
 call this if you want to change ghost flags, e.g.
void on_lb_params_change (int field)
void on_lbboundary_change ()
 called every time the walls for the lb fluid are changed

Detailed Description

This file contains the hook procedures.

These are the ones with names on_* and are called whenever something is changed in Espresso which might influence other parts. For example, the P3M code has to be reinitialized whenever the box size changes. The hooking mechanism allows to keep track of such changes.

For this mechanism to work, two things have to be fulfilled. If some part of the code changes some property, it has to call the corresponding hook, i. e. on_particle_change if a particle property has been changed or on_short_range_ia_change, if a short ranged interaction has been changed. In turn procedures that depend on particle properties or the box size, should react to such changes in the corresponding hook procedure.

Definition in file initialize.h.


Function Documentation

void on_boxl_change ( )

called every time the box length has changed.

This routine is relatively fast, and changing the box length every time step as for example necessary for NpT is more or less ok.

Definition at line 518 of file initialize.c.

References coulomb, COULOMB_ELC_P3M, COULOMB_MAGGS, COULOMB_MMM1D, COULOMB_MMM2D, COULOMB_P3M, COULOMB_P3M_GPU, DIPOLAR_MDLC_P3M, DIPOLAR_P3M, Coulomb_parameters::Dmethod, dp3m_scaleby_box_l(), ELC_init(), EVENT_TRACE, LATTICE_LB, lattice_switch, lb_init(), lb_init_boundaries(), maggs_init(), Coulomb_parameters::method, MMM1D_init(), MMM2D_init(), p3m_scaleby_box_l(), and this_node.

Referenced by cells_on_geometry_change(), and dd_on_geometry_change().

void on_cell_structure_change ( )

called every time a major change to the cell structure has happened, like the skin or grid have changed.

This one is potentially slow.

Definition at line 567 of file initialize.c.

References coulomb, COULOMB_DH, COULOMB_ELC_P3M, COULOMB_MAGGS, COULOMB_MMM1D, COULOMB_MMM2D, COULOMB_P3M, COULOMB_P3M_GPU, DIPOLAR_MDLC_P3M, DIPOLAR_P3M, Coulomb_parameters::Dmethod, dp3m_init(), ELC_init(), EVENT_TRACE, LATTICE_LB, lattice_switch, lb_init(), maggs_init(), Coulomb_parameters::method, MMM1D_init(), MMM2D_init(), on_ghost_flags_change(), p3m_init(), and this_node.

Referenced by cells_re_init().

void on_constraint_change ( )

called every time a constraint is changed.

Definition at line 467 of file initialize.c.

References EVENT_TRACE, invalidate_obs(), recalc_forces, and this_node.

Referenced by mpi_bcast_constraint(), and mpi_bcast_constraint_slave().

void on_coulomb_change ( )
void on_ghost_flags_change ( )

call this if you want to change ghost flags, e.g.

wether ghosts have velocities or not. This is a opt-in process, i. e. all features are turned off and have to be reactivated if necessary inside this procedure.

Definition at line 760 of file initialize.c.

References CELL_STRUCTURE_CURRENT, cells_re_init(), coulomb, COULOMB_MAGGS, EVENT_TRACE, ghosts_have_v, LATTICE_LB, lattice_switch, Coulomb_parameters::method, n_rigidbonds, THERMO_DPD, thermo_switch, and this_node.

Referenced by on_cell_structure_change(), on_coulomb_change(), and on_parameter_change().

void on_integration_start ( )
void on_lb_params_change ( int  field)
void on_lbboundary_change ( )

called every time the walls for the lb fluid are changed

Definition at line 474 of file initialize.c.

References EVENT_TRACE, invalidate_obs(), LATTICE_LB, LATTICE_LB_GPU, lattice_switch, lb_init_boundaries(), recalc_forces, and this_node.

Referenced by mpi_bcast_lbboundary(), and mpi_bcast_lbboundary_slave().

void on_max_cut_change ( )

called whenever the cutoff has potentially changed.

void on_n_particle_types_change ( )

called every time the number of particle types has changed (increased)

void on_observable_calc ( )
void on_parameter_change ( int  parameter)
void on_particle_change ( )

called every time a particle property is changed via Tcl.

Definition at line 371 of file initialize.c.

References EVENT_TRACE, freePartCfg(), invalidate_obs(), lb_reinit_particles_gpu, reinit_electrostatics, reinit_magnetostatics, reinit_particle_comm_gpu, resort_particles, and this_node.

void on_program_start ( )
void on_resort_particles ( )

called every time the particles are resorted from node to node.

Definition at line 496 of file initialize.c.

References coulomb, COULOMB_ELC_P3M, COULOMB_MMM2D, ELC_on_resort_particles(), EVENT_TRACE, Coulomb_parameters::method, MMM2D_on_resort_particles(), recalc_forces, and this_node.

Referenced by cells_resort_particles().

void on_short_range_ia_change ( )

called every time short ranged interaction parameters are changed.

Definition at line 456 of file initialize.c.

References cells_on_geometry_change(), EVENT_TRACE, invalidate_obs(), recalc_forces, recalc_maximal_cutoff(), and this_node.

Referenced by mpi_bcast_ia_params(), mpi_bcast_ia_params_slave(), mpi_cap_forces_slave(), and on_coulomb_change().

void on_temperature_change ( )

called every time the temperature changes.

This one is potentially slow.

Definition at line 624 of file initialize.c.

References EVENT_TRACE, LATTICE_LB, LATTICE_LB_GPU, lattice_switch, lb_reinit_parameters(), lb_reinit_parameters_gpu(), and this_node.

Referenced by on_parameter_change().