![]() |
ESPResSo 3.2.0-167-g2c9ead1-git
Extensible Simulation Package for Soft Matter Research
|
#include <mpi.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <math.h>#include "domain_decomposition.h"#include "rattle.h"
Go to the source code of this file.
Functions | |
| void | save_old_pos () |
| Transfers the current particle positions from r.p[3] to r.p_pold[3] of the Particle structure. | |
| void | init_correction_vector () |
| Initialize the correction vector. | |
| void | correct_pos_shake () |
| Propagate velocity and position while using SHAKE algorithm for bond constraint. | |
| void | correct_vel_shake () |
| Correction of current velocities using RATTLE algorithm. | |
| int | rigid_bond_set_params (int bond_type, double d, double p_tol, double v_tol) |
| set the parameter for a rigid, aka RATTLE bond | |
Private functions | |
| void | compute_pos_corr_vec (int *repeat_) |
| Calculates the corrections required for each of the particle coordinates according to the RATTLE algorithm. | |
| void | app_pos_correction () |
| Positional Corrections are added to the current particle positions. | |
| void | transfer_force_init_vel () |
| Transfers temporarily the current forces from f.f[3] of the Particle structure to r.p_old[3] location and also intializes velocity correction vector. | |
| void | compute_vel_corr_vec (int *repeat_) |
| Calculates corrections of the current particle velocities according to RATTLE algorithm. | |
| void | apply_vel_corr () |
| Velocity corrections are added to the current particle velocities. | |
| void | revert_force () |
| Invoked from correct_vel_shake(). | |
| void | print_bond_len () |
| For debugging purpose--prints the bond lengths between particles that have rigid_bonds. | |
Variables | |
| int | n_rigidbonds = 0 |
| number of rigid bonds | |
| void app_pos_correction | ( | ) |
Positional Corrections are added to the current particle positions.
Apply corrections to each particle.
Invoked from correct_pos_shake()
Completed for one particle
Definition at line 185 of file rattle.c.
References CellPList::cell, ParticleForce::f, Particle::f, i, local_cells, Particle::m, CellPList::n, ParticleList::n, ParticlePosition::p, ParticleList::part, Particle::r, and ParticleMomentum::v.
Referenced by correct_pos_shake().
| void apply_vel_corr | ( | ) |
Velocity corrections are added to the current particle velocities.
Apply velocity corrections.
Invoked from correct_vel_shake()
Completed for one particle
Definition at line 336 of file rattle.c.
References CellPList::cell, ParticleForce::f, Particle::f, i, local_cells, Particle::m, CellPList::n, ParticleList::n, ParticleList::part, and ParticleMomentum::v.
Referenced by correct_vel_shake().
| void compute_pos_corr_vec | ( | int * | repeat_ | ) |
Calculates the corrections required for each of the particle coordinates according to the RATTLE algorithm.
Compute positional corrections.
Invoked from correct_pos_shake()
Definition at line 129 of file rattle.c.
References Particle::bl, bonded_ia_params, BONDED_IA_RIGID_BOND, CellPList::cell, IntList::e, ERROR_SPRINTF, ES_INTEGER_SPACE, ParticleForce::f, Particle::f, get_mi_vector(), i, ia_params, ParticleProperties::identity, local_cells, local_particles, CellPList::n, ParticleList::n, Bonded_ia_parameters::num, ParticlePosition::p, Particle::p, Bonded_ia_parameters::p, ParticlePosition::p_old, ParticleList::part, PMASS, Particle::r, Bonded_ia_parameters::rigid_bond, runtime_error(), scalar(), sqrlen(), and Bonded_ia_parameters::type.
Referenced by correct_pos_shake().
| void compute_vel_corr_vec | ( | int * | repeat_ | ) |
Calculates corrections of the current particle velocities according to RATTLE algorithm.
Velocity correction vectors are computed.
Invoked from correct_vel_shake()
Definition at line 280 of file rattle.c.
References Particle::bl, bonded_ia_params, BONDED_IA_RIGID_BOND, CellPList::cell, IntList::e, ERROR_SPRINTF, ES_INTEGER_SPACE, ParticleForce::f, Particle::f, get_mi_vector(), i, ia_params, ParticleProperties::identity, local_cells, local_particles, Particle::m, CellPList::n, ParticleList::n, Bonded_ia_parameters::num, ParticlePosition::p, Particle::p, Bonded_ia_parameters::p, ParticleList::part, PMASS, Particle::r, Bonded_ia_parameters::rigid_bond, runtime_error(), scalar(), Bonded_ia_parameters::type, ParticleMomentum::v, and vecsub().
Referenced by correct_vel_shake().
| void correct_pos_shake | ( | ) |
Propagate velocity and position while using SHAKE algorithm for bond constraint.
Ghost Positions Update
Definition at line 210 of file rattle.c.
References app_pos_correction(), cell_structure, check_resort_particles(), CellStructure::collect_ghost_force_comm, comm_cart, compute_pos_corr_vec(), ERROR_SPRINTF, ES_INTEGER_SPACE, ghost_communicator(), init_correction_vector(), MPI_Bcast(), MPI_INT, MPI_Reduce(), MPI_SUM, runtime_error(), SHAKE_MAX_ITERATIONS, this_node, and CellStructure::update_ghost_pos_comm.
Referenced by integrate_vv().
| void correct_vel_shake | ( | ) |
Correction of current velocities using RATTLE algorithm.
transfer the current forces to r.p_old of the particle structure so that velocity corrections can be stored temporarily at the f.f[3] of the particle structure
Puts back the forces from r.p_old to f.f[3]
Definition at line 393 of file rattle.c.
References apply_vel_corr(), cell_structure, CellStructure::collect_ghost_force_comm, comm_cart, compute_vel_corr_vec(), errexit(), ghost_communicator(), init_correction_vector(), MPI_Bcast(), MPI_INT, MPI_Reduce(), MPI_SUM, revert_force(), SHAKE_MAX_ITERATIONS, this_node, transfer_force_init_vel(), and CellStructure::update_ghost_pos_comm.
Referenced by integrate_vv().
| void init_correction_vector | ( | ) |
Initialize the correction vector.
The correction vector is stored in f.f of particle strcuture.
Definition at line 98 of file rattle.c.
References CellPList::cell, Particle::f, ghost_cells, i, local_cells, CellPList::n, ParticleList::n, and ParticleList::part.
Referenced by correct_pos_shake(), and correct_vel_shake().
| void print_bond_len | ( | ) |
For debugging purpose--prints the bond lengths between particles that have rigid_bonds.
Definition at line 426 of file rattle.c.
References Particle::bl, bonded_ia_params, BONDED_IA_RIGID_BOND, CellPList::cell, IntList::e, ERROR_SPRINTF, ES_INTEGER_SPACE, get_mi_vector(), i, ParticleProperties::identity, local_cells, local_particles, CellPList::n, ParticleList::n, Bonded_ia_parameters::num, ParticlePosition::p, Particle::p, ParticleList::part, Particle::r, runtime_error(), sqrlen(), this_node, and Bonded_ia_parameters::type.
| void revert_force | ( | ) |
Invoked from correct_vel_shake().
Put back the forces from r.p_old to f.f.
Put back the forces from r.p_old to f.f
Definition at line 362 of file rattle.c.
References CellPList::cell, Particle::f, ghost_cells, i, local_cells, CellPList::n, ParticleList::n, ParticlePosition::p_old, ParticleList::part, and Particle::r.
Referenced by correct_vel_shake().
| int rigid_bond_set_params | ( | int | bond_type, |
| double | d, | ||
| double | p_tol, | ||
| double | v_tol | ||
| ) |
set the parameter for a rigid, aka RATTLE bond
Definition at line 466 of file rattle.c.
References bonded_ia_params, BONDED_IA_RIGID_BOND, ES_ERROR, ES_OK, FIELD_RIGIDBONDS, make_bond_type_exist(), mpi_bcast_ia_params(), mpi_bcast_parameter(), n_rigidbonds, Bonded_ia_parameters::num, Bonded_ia_parameters::p, Bonded_ia_parameters::rigid_bond, time_step, and Bonded_ia_parameters::type.
Referenced by tclcommand_inter_parse_rigid_bond().
| void save_old_pos | ( | ) |
Transfers the current particle positions from r.p[3] to r.p_pold[3] of the Particle structure.
Invoked from correct_pos_shake()
Definition at line 69 of file rattle.c.
References CellPList::cell, ghost_cells, i, local_cells, CellPList::n, ParticleList::n, ParticlePosition::p, ParticleList::part, and Particle::r.
Referenced by integrate_vv().
| void transfer_force_init_vel | ( | ) |
Transfers temporarily the current forces from f.f[3] of the Particle structure to r.p_old[3] location and also intializes velocity correction vector.
The forces are transfered temporarily from f.f member of particle structure to r.p_old, which is idle now and initialize the velocity correction vector to zero at f.f[3] of Particle structure.
Invoked from correct_vel_shake()
Definition at line 243 of file rattle.c.
References CellPList::cell, ParticleForce::f, Particle::f, ghost_cells, i, local_cells, CellPList::n, ParticleList::n, ParticlePosition::p_old, ParticleList::part, and Particle::r.
Referenced by correct_vel_shake().
| int n_rigidbonds = 0 |
number of rigid bonds
Definition at line 30 of file rattle.c.
Referenced by on_ghost_flags_change(), and rigid_bond_set_params().
1.7.5.1