ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
dpd.cpp File Reference

Implementation of dpd.hpp. More...

#include <config/config.hpp>
#include "dpd.hpp"
#include "BoxGeometry.hpp"
#include "cell_system/CellStructure.hpp"
#include "nonbonded_interactions/nonbonded_interaction_data.hpp"
#include "random.hpp"
#include "system/System.hpp"
#include "thermostat.hpp"
#include <utils/Vector.hpp>
#include <utils/math/tensor_product.hpp>
#include <utils/matrix.hpp>
#include <boost/mpi/collectives/reduce.hpp>
#include <cmath>
#include <functional>
#include <type_traits>
+ Include dependency graph for dpd.cpp:

Go to the source code of this file.

Functions

static Utils::Vector3d dpd_noise (DPDThermostat const &dpd, int pid1, int pid2)
 Return a random uniform 3D vector with the Philox thermostat.
 
Utils::Vector3d dpd_pair_force (Utils::Vector3d const &p1_position, Utils::Vector3d const &p1_velocity, int p1_id, Utils::Vector3d const &p2_position, Utils::Vector3d const &p2_velocity, int p2_id, DPDThermostat const &dpd, BoxGeometry const &box_geo, IA_parameters const &ia_params, Utils::Vector3d const &d, double dist, double dist2)
 
static auto dpd_viscous_stress_local (System::System &system)
 
Utils::Vector9d dpd_pressure_local (System::System &system)
 Local contribution to the pressure tensor.
 
Utils::Vector9d dpd_stress (System::System &system, boost::mpi::communicator const &comm)
 Viscous stress tensor of the DPD interaction.
 

Detailed Description

Implementation of dpd.hpp.

Definition in file dpd.cpp.

Function Documentation

◆ dpd_noise()

static Utils::Vector3d dpd_noise ( DPDThermostat const dpd,
int  pid1,
int  pid2 
)
static

Return a random uniform 3D vector with the Philox thermostat.

Random numbers depend on

  1. dpd_rng_counter (initialized by seed) which is increased on integration
  2. Salt (decorrelates different counters)
  3. Two particle IDs (order-independent, decorrelates particles, gets rid of seed-per-node)

Definition at line 54 of file dpd.cpp.

References BaseThermostat::rng_counter(), BaseThermostat::rng_seed(), and stream.

Referenced by dpd_pair_force().

◆ dpd_pair_force()

Utils::Vector3d dpd_pair_force ( Utils::Vector3d const p1_position,
Utils::Vector3d const p1_velocity,
int  p1_id,
Utils::Vector3d const p2_position,
Utils::Vector3d const p2_velocity,
int  p2_id,
DPDThermostat const dpd,
BoxGeometry const box_geo,
IA_parameters const ia_params,
Utils::Vector3d const d,
double  dist,
double  dist2 
)

◆ dpd_pressure_local()

Utils::Vector9d dpd_pressure_local ( System::System system)

Local contribution to the pressure tensor.

Needs to be rescaled by the box volume.

Definition at line 134 of file dpd.cpp.

References dpd_viscous_stress_local(), Utils::flatten(), and stream.

◆ dpd_stress()

Utils::Vector9d dpd_stress ( System::System system,
boost::mpi::communicator const comm 
)

Viscous stress tensor of the DPD interaction.

This calculates the total viscous stress contribution of the DPD interaction. It contains only the dissipative contributions of the interaction without noise. It's calculated as the sum over all pair virials as

\[ \sigma^{\nu\mu} = V^{-1}\sum_i \sum_{j < i} r_{i,j}^{\nu} (- \gamma_{i,j} v_{i,j})^{\mu} \]

where \(\gamma_{i,j}\) is the (in general tensor valued) DPD friction coefficient for particles i and j, \(v_{i,j}\), \(r_{i,j}\) are their relative velocity and distance and \(V\) is the box volume.

Returns
Stress tensor contribution.

Definition at line 154 of file dpd.cpp.

References dpd_viscous_stress_local(), Utils::flatten(), and stream.

Referenced by ScriptInterface::Analysis::Analysis::do_call_method(), and Observables::DPDStress::operator()().

◆ dpd_viscous_stress_local()

static auto dpd_viscous_stress_local ( System::System system)
static

Definition at line 103 of file dpd.cpp.

References Distance::dist2, dpd_pair_force(), P, stream, and Distance::vec21.

Referenced by dpd_pressure_local(), and dpd_stress().