ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
dpd.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010-2025 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
22#pragma once
23
24/** \file
25 * Routines to use DPD as thermostat or pair force @cite soddemann03a
26 *
27 * Implementation in @ref dpd.cpp.
28 */
29
30#include <config/config.hpp>
31
32#ifdef ESPRESSO_DPD
33
34#include "BoxGeometry.hpp"
35#include "Particle.hpp"
37#include "system/System.hpp"
38#include "thermostat.hpp"
39
40#include <utils/Vector.hpp>
41
42#include <cmath>
43
44// Forward declaration
45namespace boost::mpi {
46class communicator;
47}
48
50 Utils::Vector3d const &v, double dist,
51 Utils::Vector3d const &noise) {
52 if (dist < params.cutoff) {
53 auto const r_cut = params.cutoff;
54 auto const omega = params.wf ? 1. - std::pow((dist / r_cut), params.k) : 1.;
55 auto const f_d = params.gamma * (omega * omega) * v;
56 auto const f_r = params.pref * omega * noise;
57 return f_r - f_d;
58 }
59 return {};
60}
61
63dpd_pair_force(Utils::Vector3d const &p1_position,
64 Utils::Vector3d const &p1_velocity, int const &p1_id,
65 Utils::Vector3d const &p2_position,
66 Utils::Vector3d const &p2_velocity, int const &p2_id,
67 DPDThermostat const &dpd, BoxGeometry const &box_geo,
68 IA_parameters const &ia_params, Utils::Vector3d const &d,
69 double dist, double dist2);
70
72 boost::mpi::communicator const &comm);
73
74/**
75 * @brief Local contribution to the pressure tensor.
76 * Needs to be rescaled by the box volume.
77 */
79
80#endif // ESPRESSO_DPD
Vector implementation and trait types for boost qvm interoperability.
Main system class.
Communicator communicator
Utils::Vector3d dpd_pair_force(DPDParameters const &params, Utils::Vector3d const &v, double dist, Utils::Vector3d const &noise)
Definition dpd.hpp:49
Utils::Vector9d dpd_stress(System::System &system, boost::mpi::communicator const &comm)
Viscous stress tensor of the DPD interaction.
Definition dpd.cpp:159
Utils::Vector9d dpd_pressure_local(System::System &system)
Local contribution to the pressure tensor.
Definition dpd.cpp:139
Various procedures concerning interactions between particles.
Thermostat for dissipative particle dynamics.
Parameters for non-bonded interactions.