ESPResSo 3.2.0-167-g2c9ead1-git
Extensible Simulation Package for Soft Matter Research
pressure.h File Reference

Pressure calculation. More...

#include "utils.h"
#include "integrate.h"
#include "statistics.h"
#include "thermostat.h"
#include "adresso.h"
#include "forces.h"
#include "npt.h"
Include dependency graph for pressure.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

Exported Functions
void init_virials (Observable_stat *stat)
 Initializes a virials Observable stat.
void init_virials_non_bonded (Observable_stat_non_bonded *stat_nb)
 Initializes a virials Observable stat.
void init_p_tensor_non_bonded (Observable_stat_non_bonded *stat_nb)
 Initializes stat_nb to be used by pressure_calc.
void init_p_tensor (Observable_stat *stat)
 Initializes stat to be used by pressure_calc.
void master_pressure_calc (int v_comp)
 on the master node: calc energies only if necessary
void pressure_calc (double *result, double *result_t, double *result_nb, double *result_t_nb, int v_comp)
 Calculates the pressure in the system from a virial expansion using the terms from calculate_verlet_virials or nsq_calculate_virials dependeing on the used cell system.
MDINLINE void add_non_bonded_pair_virials (Particle *p1, Particle *p2, double d[3], double dist, double dist2)
 Calculate non bonded energies between a pair of particles.
MDINLINE void calc_bonded_force (Particle *p1, Particle *p2, Bonded_ia_parameters *iaparams, int *i, double dx[3], double force[3])
MDINLINE void calc_three_body_bonded_forces (Particle *p1, Particle *p2, Particle *p3, Bonded_ia_parameters *iaparams, double force1[3], double force2[3], double force3[3])
MDINLINE void add_bonded_virials (Particle *p1)
 Calculate bonded virials for one particle.
MDINLINE void add_three_body_bonded_stress (Particle *p1)
 Calculate the contribution to the stress tensor from angular potentials.
MDINLINE void add_kinetic_virials (Particle *p1, int v_comp)
 Calculate kinetic pressure (aka energy) for one particle.
int local_stress_tensor_calc (DoubleList *TensorInBin, int bins[3], int periodic[3], double range_start[3], double range[3])
 implementation of 'analyse local_stress_tensor
int observable_compute_stress_tensor (int v_comp, double *A, unsigned int n_A)
 function to calculate stress tensor for the observables

Variables

Exported Variables
Observable_stat virials
Observable_stat total_pressure
Observable_stat p_tensor
Observable_stat total_p_tensor
Observable_stat_non_bonded virials_non_bonded
Observable_stat_non_bonded total_pressure_non_bonded
Observable_stat_non_bonded p_tensor_non_bonded
Observable_stat_non_bonded total_p_tensor_non_bonded

Detailed Description

Pressure calculation.

Really similar to energy.h.

Definition in file pressure.h.


Function Documentation

MDINLINE void add_bonded_virials ( Particle p1)

Calculate bonded virials for one particle.

For performance reasons the force routines add their values directly to the particles. So here we do some tricks to get the value out without changing the forces.

Parameters:
p1particle for which to calculate virials

Definition at line 311 of file pressure.h.

References Particle::bl, BONDED_IA_HARMONIC, bonded_ia_params, calc_bonded_force(), IntList::e, ERROR_SPRINTF, ES_INTEGER_SPACE, get_mi_vector(), Bonded_ia_parameters::harmonic, i, ParticleProperties::identity, local_particles, obsstat_bonded(), ParticlePosition::p, Particle::p, Bonded_ia_parameters::p, Particle::r, and runtime_error().

Referenced by calculate_link_cell_virials(), calculate_verlet_virials(), layered_calculate_virials(), and nsq_calculate_virials().

MDINLINE void add_kinetic_virials ( Particle p1,
int  v_comp 
)

Calculate kinetic pressure (aka energy) for one particle.

Parameters:
p1particle for which to calculate pressure
v_compflag which enables (1) compensation of the velocities required for deriving a pressure reflecting nptiso_struct::p_inst (hence it only works with domain decomposition); naturally it therefore doesn't make sense to use it without NpT.

Definition at line 508 of file pressure.h.

References Observable_stat::data, DoubleList::e, ParticleForce::f, Particle::f, Particle::m, PMASS, SQR(), and ParticleMomentum::v.

Referenced by calculate_link_cell_virials(), calculate_verlet_virials(), layered_calculate_virials(), and nsq_calculate_virials().

MDINLINE void add_non_bonded_pair_virials ( Particle p1,
Particle p2,
double  d[3],
double  dist,
double  dist2 
)
MDINLINE void add_three_body_bonded_stress ( Particle p1)
MDINLINE void calc_bonded_force ( Particle p1,
Particle p2,
Bonded_ia_parameters iaparams,
int *  i,
double  dx[3],
double  force[3] 
)
MDINLINE void calc_three_body_bonded_forces ( Particle p1,
Particle p2,
Particle p3,
Bonded_ia_parameters iaparams,
double  force1[3],
double  force2[3],
double  force3[3] 
)
void init_p_tensor ( Observable_stat stat)
void init_p_tensor_non_bonded ( Observable_stat_non_bonded stat_nb)
void init_virials ( Observable_stat stat)
void init_virials_non_bonded ( Observable_stat_non_bonded stat_nb)
int local_stress_tensor_calc ( DoubleList TensorInBin,
int  bins[3],
int  periodic[3],
double  range_start[3],
double  range[3] 
)
void master_pressure_calc ( int  v_comp)

on the master node: calc energies only if necessary

Parameters:
v_compflag which enables (1) compensation of the velocities required for deriving a pressure reflecting nptiso_struct::p_inst (hence it only works with domain decomposition); naturally it therefore doesn't make sense to use it without NpT.

Definition at line 313 of file pressure.c.

References Observable_stat::data, Observable_stat_non_bonded::data_nb, DoubleList::e, Observable_stat::init_status, Observable_stat_non_bonded::init_status_nb, and mpi_gather_stats().

Referenced by observable_compute_stress_tensor(), tclcommand_analyze_parse_and_print_pressure(), and tclcommand_analyze_parse_and_print_stress_tensor().

int observable_compute_stress_tensor ( int  v_comp,
double *  A,
unsigned int  n_A 
)
void pressure_calc ( double *  result,
double *  result_t,
double *  result_nb,
double *  result_t_nb,
int  v_comp 
)

Calculates the pressure in the system from a virial expansion using the terms from calculate_verlet_virials or nsq_calculate_virials dependeing on the used cell system.


Parameters:
resulthere the data about the scalar pressure are stored
result_there the data about the stress tensor are stored
result_nbhere the data about the intra- and inter- molecular nonbonded contributions to scalar pressure are stored
result_t_nbhere the data about the intra- and inter- molecular nonbonded contributions to stress tensor are stored
v_compflag which enables (1) compensation of the velocities required for deriving a pressure reflecting nptiso_struct::p_inst (hence it only works with domain decomposition); naturally it therefore doesn't make sense to use it without NpT.

Definition at line 82 of file pressure.c.

References box_l, build_verlet_lists(), calc_long_range_virials(), calculate_link_cell_virials(), calculate_verlet_virials(), cell_structure, CELL_STRUCTURE_DOMDEC, CELL_STRUCTURE_LAYERED, CELL_STRUCTURE_NSQUARE, check_obs_calc_initialized(), comm_cart, Observable_stat::data, Observable_stat_non_bonded::data_nb, dd, DoubleList::e, i, init_p_tensor(), init_p_tensor_non_bonded(), init_virials(), init_virials_non_bonded(), layered_calculate_virials(), MPI_DOUBLE, MPI_Reduce(), MPI_SUM, DoubleList::n, nsq_calculate_virials(), on_observable_calc(), rebuild_verletlist, time_step, CellStructure::type, and DomainDecomposition::use_vList.

Referenced by mpi_gather_stats(), and mpi_gather_stats_slave().


Variable Documentation

Definition at line 34 of file pressure.c.

Referenced by tclcommand_analyze_parse_and_print_stress_tensor().

Definition at line 41 of file pressure.c.

Definition at line 32 of file pressure.c.

Definition at line 39 of file pressure.c.