Loading [MathJax]/extensions/TeX/AMSmath.js
ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages Concepts
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#include <array>
34#include <vector>
35
36namespace System {
37class System;
38} // namespace System
39
40/** Parameters of the isotropic NpT-integration scheme. */
42 NptIsoParameters() = default;
43 NptIsoParameters(double ext_pressure, double piston,
44 Utils::Vector<bool, 3> const &rescale, bool cubic_box);
45 /** mass of a virtual piston representing the shaken box */
46 double piston = 0.;
47 /** inverse of \ref piston */
48 double inv_piston = 0.;
49 /** isotropic volume. Note that we use the term volume throughout,
50 * although for a 2d or 1d system we mean Area and Length respectively
51 */
52 double volume = 0.;
53 /** list of particle mass */
54 std::vector<double> mass_list;
55 /** desired pressure to which the algorithm strives to */
56 double p_ext = 0.;
57 /** conjugate momentum of volume */
58 double p_epsilon = 0.;
59 /** geometry information for the NpT integrator. Holds the vector
60 * < dir, dir, dir > where a positive value for dir indicates that
61 * box movement is allowed in that direction. To check whether a
62 * given direction is turned on, use bitwise comparison with \ref
63 * nptgeom_dir
64 */
65 int geometry = 0;
66 /** The number of dimensions in which NpT boxlength motion is coupled to
67 * particles */
68 int dimension = 0;
69 /** Set this flag if you want all box dimensions to be identical. Needed for
70 * electrostatics and magnetostatics. If the value of \ref dimension is
71 * less than 3, then box length motion in one or more directions will
72 * be decoupled from the particle motion
73 */
74 bool cubic_box = false;
75 /** An index to one of the non-constant dimensions. Handy if you just want
76 * the variable box_l
77 */
78 int non_const_dim = -1;
79 void coulomb_dipole_sanity_checks(System::System const &system) const;
81 static constexpr std::array<int, 3> nptgeom_dir = {1, 2, 4};
82};
83
84/** Instantaneous pressure during force calculation for NPT integration*/
86 /** instantaneous pressure for p_inst[0] and virial pressure for p_inst[1]
87 * the system currently has */
89 /** virial (short-range) components of \ref p_inst */
90 Utils::Vector3d p_vir = {0., 0., 0.};
91 /** ideal gas components of \ref p_inst, derived from the velocities */
92 Utils::Vector3d p_vel = {0., 0., 0.};
93};
94
95#endif // NPT
Vector implementation and trait types for boost qvm interoperability.
Main system class.
This file contains the defaults for ESPResSo.
Instantaneous pressure during force calculation for NPT integration.
Definition npt.hpp:85
Utils::Vector3d p_vel
ideal gas components of p_inst, derived from the velocities
Definition npt.hpp:92
Utils::Vector3d p_vir
virial (short-range) components of p_inst
Definition npt.hpp:90
Utils::Vector2d p_inst
instantaneous pressure for p_inst[0] and virial pressure for p_inst[1] the system currently has
Definition npt.hpp:88
Parameters of the isotropic NpT-integration scheme.
Definition npt.hpp:41
double inv_piston
inverse of piston
Definition npt.hpp:48
std::vector< double > mass_list
list of particle mass
Definition npt.hpp:54
void coulomb_dipole_sanity_checks(System::System const &system) const
Definition npt.cpp:47
int geometry
geometry information for the NpT integrator.
Definition npt.hpp:65
static constexpr std::array< int, 3 > nptgeom_dir
Definition npt.hpp:81
double p_ext
desired pressure to which the algorithm strives to
Definition npt.hpp:56
bool cubic_box
Set this flag if you want all box dimensions to be identical.
Definition npt.hpp:74
int non_const_dim
An index to one of the non-constant dimensions.
Definition npt.hpp:78
Utils::Vector< bool, 3 > get_direction() const
Definition npt.cpp:92
NptIsoParameters()=default
int dimension
The number of dimensions in which NpT boxlength motion is coupled to particles.
Definition npt.hpp:68
double piston
mass of a virtual piston representing the shaken box
Definition npt.hpp:46
double p_epsilon
conjugate momentum of volume
Definition npt.hpp:58
double volume
isotropic volume.
Definition npt.hpp:52