30#include "system/System.hpp"
34#include <boost/mpi/collectives/broadcast.hpp>
51#if defined(ELECTROSTATICS) or defined(DIPOLES)
54 if (dimension < 3 and not cubic_box and system.coulomb.impl->solver) {
55 throw std::runtime_error(
"If electrostatics is being used you must "
56 "use the cubic box NpT.");
61 if (dimension < 3 and not cubic_box and system.dipoles.impl->solver) {
62 throw std::runtime_error(
"If magnetostatics is being used you must "
63 "use the cubic box NpT.");
72 : piston{piston}, p_ext{ext_pressure}, cubic_box{cubic_box} {
74 if (ext_pressure < 0.0) {
75 throw std::runtime_error(
"The external pressure must be positive");
78 throw std::runtime_error(
"The piston mass must be positive");
89 for (
auto const i : {0u, 1u, 2u}) {
98 throw std::runtime_error(
99 "You must enable at least one of the x y z components "
100 "as fluctuating dimension(s) for box length motion");
127 }
catch (std::runtime_error
const &err) {
Vector implementation and trait types for boost qvm interoperability.
boost::mpi::communicator comm_cart
The communicator.
This file contains the defaults for ESPResSo.
This file contains the errorhandling code for severe errors, like a broken bond or illegal parameter ...
#define runtimeErrorMsg()
void npt_add_virial_contribution(double energy)
static constexpr Utils::Vector3i nptgeom_dir
void npt_ensemble_init(Utils::Vector3d const &box_l, bool recalc_forces)
void integrator_npt_sanity_checks()
void npt_reset_instantaneous_virials()
reset virial part of instantaneous pressure
void synchronize_npt_state()
Synchronizes NpT state such as instantaneous and average pressure.
Exports for the NpT code.
Parameters of the isotropic NpT-integration scheme.
double inv_piston
inverse of piston
int geometry
geometry information for the NpT integrator.
Utils::Vector3d p_vir
virial (short-range) components of p_inst
int non_const_dim
An index to one of the non-constant dimensions.
double p_diff
difference between p_ext and p_inst
double p_inst
instantaneous pressure the system currently has
Utils::Vector< bool, 3 > get_direction() const
NptIsoParameters()=default
Utils::Vector3d p_vel
ideal gas components of p_inst, derived from the velocities
int dimension
The number of dimensions in which NpT boxlength motion is coupled to particles.
double piston
mass of a virtual piston representing the shaken box
void coulomb_dipole_sanity_checks() const
double volume
isotropic volume.
static constexpr Utils::Vector3i nptgeom_dir