ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
npt.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010-2022 The ESPResSo project
3 * Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
4 * Max-Planck-Institute for Polymer Research, Theory Group
5 *
6 * This file is part of ESPResSo.
7 *
8 * ESPResSo is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * ESPResSo is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21/** \file
22 * Exports for the NpT code.
23 */
24
25#pragma once
26
27#include "config/config.hpp"
28
29#ifdef NPT
30
31#include <utils/Vector.hpp>
32
33/** Parameters of the isotropic NpT-integration scheme. */
35 NptIsoParameters() = default;
36 NptIsoParameters(double ext_pressure, double piston,
37 Utils::Vector<bool, 3> const &rescale, bool cubic_box);
38 /** mass of a virtual piston representing the shaken box */
39 double piston = 0.;
40 /** inverse of \ref piston */
41 double inv_piston = 0.;
42 /** isotropic volume. Note that we use the term volume throughout,
43 * although for a 2d or 1d system we mean Area and Length respectively
44 */
45 double volume = 0.;
46 /** desired pressure to which the algorithm strives to */
47 double p_ext = 0.;
48 /** instantaneous pressure the system currently has */
49 double p_inst = 0.;
50 /** difference between \ref p_ext and \ref p_inst */
51 double p_diff = 0.;
52 /** virial (short-range) components of \ref p_inst */
53 Utils::Vector3d p_vir = {0., 0., 0.};
54 /** ideal gas components of \ref p_inst, derived from the velocities */
55 Utils::Vector3d p_vel = {0., 0., 0.};
56 /** geometry information for the NpT integrator. Holds the vector
57 * < dir, dir, dir > where a positive value for dir indicates that
58 * box movement is allowed in that direction. To check whether a
59 * given direction is turned on, use bitwise comparison with \ref
60 * nptgeom_dir
61 */
62 int geometry = 0;
63 /** The number of dimensions in which NpT boxlength motion is coupled to
64 * particles */
65 int dimension = 0;
66 /** Set this flag if you want all box dimensions to be identical. Needed for
67 * electrostatics and magnetostatics. If the value of \ref dimension is
68 * less than 3, then box length motion in one or more directions will
69 * be decoupled from the particle motion
70 */
71 bool cubic_box = false;
72 /** An index to one of the non-constant dimensions. Handy if you just want
73 * the variable box_l
74 */
75 int non_const_dim = -1;
78};
79
81
82/** @brief Synchronizes NpT state such as instantaneous and average pressure
83 */
85void npt_ensemble_init(Utils::Vector3d const &box_l, bool recalc_forces);
88void npt_add_virial_contribution(double energy);
90 const Utils::Vector3d &d);
91
92#endif // NPT
Vector implementation and trait types for boost qvm interoperability.
This file contains the defaults for ESPResSo.
void npt_add_virial_contribution(double energy)
Definition npt.cpp:141
void npt_ensemble_init(Utils::Vector3d const &box_l, bool recalc_forces)
Definition npt.cpp:112
void integrator_npt_sanity_checks()
Definition npt.cpp:122
void npt_reset_instantaneous_virials()
reset virial part of instantaneous pressure
Definition npt.cpp:134
NptIsoParameters nptiso
Definition npt.cpp:42
void synchronize_npt_state()
Synchronizes NpT state such as instantaneous and average pressure.
Definition npt.cpp:44
Parameters of the isotropic NpT-integration scheme.
Definition npt.hpp:34
double inv_piston
inverse of piston
Definition npt.hpp:41
int geometry
geometry information for the NpT integrator.
Definition npt.hpp:62
Utils::Vector3d p_vir
virial (short-range) components of p_inst
Definition npt.hpp:53
double p_ext
desired pressure to which the algorithm strives to
Definition npt.hpp:47
bool cubic_box
Set this flag if you want all box dimensions to be identical.
Definition npt.hpp:71
int non_const_dim
An index to one of the non-constant dimensions.
Definition npt.hpp:75
double p_diff
difference between p_ext and p_inst
Definition npt.hpp:51
double p_inst
instantaneous pressure the system currently has
Definition npt.hpp:49
Utils::Vector< bool, 3 > get_direction() const
Definition npt.cpp:106
NptIsoParameters()=default
Utils::Vector3d p_vel
ideal gas components of p_inst, derived from the velocities
Definition npt.hpp:55
int dimension
The number of dimensions in which NpT boxlength motion is coupled to particles.
Definition npt.hpp:65
double piston
mass of a virtual piston representing the shaken box
Definition npt.hpp:39
void coulomb_dipole_sanity_checks() const
Definition npt.cpp:50
double volume
isotropic volume.
Definition npt.hpp:45