28#include "communication.hpp"
30#include "system/System.hpp"
35#include <boost/mpi/collectives.hpp>
53 npt_inst_pressure.
p_inst = {0., 0.};
55 for (
auto i = 0
u; i < 3u; ++i) {
57 npt_inst_pressure.
p_inst[0] +=
58 npt_inst_pressure.
p_vir[i] + npt_inst_pressure.
p_vel[i];
59 npt_inst_pressure.
p_inst[1] += npt_inst_pressure.
p_vir[i];
65 std::plus<Utils::Vector2d>(), 0);
71 (npt_inst_pressure.
p_inst[0] - nptiso.
p_ext) * 1.5 *
87 for (
auto &p : particles) {
88 for (
auto j = 0
u;
j < 3u; ++
j) {
89 if (!p.is_fixed_along(
j)) {
90 p.pos()[
j] = p.pos()[
j] + p.v()[
j] * 0.5 * time_step;
105 for (
auto &p : particles) {
106 for (
auto j = 0
u;
j < 3u; ++
j) {
107 if (!p.is_fixed_along(
j)) {
128 auto &box_geo = *
system.box_geo;
129 auto &cell_structure = *
system.cell_structure;
130 auto &nptiso = *
system.nptiso;
141 for (
auto &p : particles) {
144 for (
unsigned int j = 0;
j < 3;
j++) {
145 if (!p.is_fixed_along(
j)) {
163 std::exp(1.5 * nptiso.inv_piston * nptiso.p_epsilon * time_step);
166 std::exp(1.5 * nptiso.inv_piston * nptiso.p_epsilon * time_step);
167 L_new = std::pow(nptiso.volume, 1.0 / nptiso.dimension);
182 for (
auto i = 0
u; i < 3u; ++i) {
183 if (nptiso.cubic_box ||
194 system.on_boxl_change(
true);
205 npt_inst_pressure.
p_vel = {};
209 for (
auto &p : particles) {
210 for (
auto j = 0
u;
j < 3u; ++
j) {
211 if (!p.is_fixed_along(
j)) {
224 auto &nptiso = *
system.nptiso;
225 auto &npt_inst_pressure = *
system.npt_inst_pressure;
236 auto &nptiso = *
system.nptiso;
237 auto &npt_inst_pressure = *
system.npt_inst_pressure;
Vector implementation and trait types for boost qvm interoperability.
cudaStream_t stream[1]
CUDA streams for parallel computing on CPU and GPU.
boost::mpi::communicator comm_cart
The communicator.
int this_node
The number of this node.
This file contains the errorhandling code for severe errors, like a broken bond or illegal parameter ...
DEVICE_QUALIFIER constexpr T sqr(T x)
Calculates the SQuaRe of x.
double propagate_thermV_nptiso(IsotropicNptThermostat const &npt_iso, double p_epsilon)
Added noise and friction for NpT-sims to NptIsoParameters::p_epsilon; .
Utils::Vector3d propagate_therm0_nptiso(IsotropicNptThermostat const &npt_iso, Utils::Vector3d const &vel, double mass, int p_identity)
Add velocity-dependent noise and friction for NpT-sims to the particle's velocity; .
Instantaneous pressure during force calculation for NPT integration.
Utils::Vector3d p_vel
ideal gas components of p_inst, derived from the velocities
Utils::Vector3d p_vir
virial (short-range) components of p_inst
Utils::Vector2d p_inst
instantaneous pressure for p_inst[0] and virial pressure for p_inst[1] the system currently has
Thermostat for isotropic NPT dynamics.
Parameters of the isotropic NpT-integration scheme.
std::size_t particle_number
number of particles
int geometry
geometry information for the NpT integrator.
static constexpr std::array< int, 3 > nptgeom_dir
double half_dt_inv_piston_and_Nf
the coefficient of propagation of momentum for MTK equation
double half_dt_inv_piston
the coefficient of propagation of position for MTK equation
double p_ext
desired pressure to which the algorithm strives to
int dimension
The number of dimensions in which NpT boxlength motion is coupled to particles.
double p_epsilon
conjugate momentum of volume
double volume
isotropic volume.
void velocity_verlet_npt_propagate_vel(NptIsoParameters const &nptiso, InstantaneousPressure &npt_inst_pressure, ParticleRangeNPT const &particles, double time_step)
Propagate the particle's velocity.
void velocity_verlet_npt_MTK_step_1(ParticleRangeNPT const &particles, IsotropicNptThermostat const &npt_iso, double time_step, System::System &system)
Special propagator for velocity Verlet NpT with the Andersen method.
static void velocity_verlet_npt_propagate_vel_MTK(NptIsoParameters const &nptiso, InstantaneousPressure &npt_inst_pressure, ParticleRangeNPT const &particles)
static void velocity_verlet_npt_propagate_p_eps(NptIsoParameters &nptiso, InstantaneousPressure &npt_inst_pressure, double time_step)
Scale and communicate instantaneous NpT pressure and propagate the conjugate momentum for volume.
static void velocity_verlet_npt_propagate_AVOVA_MTK(ParticleRangeNPT const &particles, IsotropicNptThermostat const &npt_iso, double time_step, System::System &system)
propagate positions and the volume and add thermal fluctuation.
static void velocity_verlet_npt_propagate_pos_MTK(NptIsoParameters &nptiso, ParticleRangeNPT const &particles)
static constexpr Utils::Vector3i nptgeom_dir
void velocity_verlet_npt_MTK_step_2(ParticleRangeNPT const &particles, double time_step, System::System &system)
Final integration step of the velocity Verlet NpT integrator with the MTK method.
static void velocity_verlet_npt_propagate_pos(ParticleRangeNPT const &particles, double time_step)