ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
ibm_tribend.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010-2022 The ESPResSo project
3 *
4 * This file is part of ESPResSo.
5 *
6 * ESPResSo is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * ESPResSo is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
22#include "config/config.hpp"
23
24#include "BoxGeometry.hpp"
25#include "Particle.hpp"
27
28#include <utils/Vector.hpp>
29
30#include <tuple>
31
32/** Parameters for IBM tribend */
33struct IBMTribend {
34 /**
35 * @brief Bare bending modulus.
36 *
37 * If triangle pairs appear only once, the total bending force should get a
38 * factor 2. For the numerical model, a factor @f$ \sqrt(3) @f$ should be
39 * added, see @cite gompper96a and @cite kruger12a. This is an approximation,
40 * it holds strictly only for a sphere
41 */
42 double kb;
43
44 /** Reference angle */
45 double theta0;
46
47 /** Particle ids */
48 std::tuple<int, int, int, int> p_ids;
49
50 bool flat;
52
53 double cutoff() const { return 0.; }
54
55 static constexpr int num = 3;
56
57 /** Set the IBM Tribend parameters.
58 * Also calculate and store the reference state.
59 * See details in @cite gompper96a and @cite kruger12a.
60 */
61 void initialize(BoxGeometry const &box_geo,
62 CellStructure const &cell_structure);
63
64 IBMTribend(int ind1, int ind2, int ind3, int ind4, double kb, bool flat)
65 : kb{kb}, theta0{0.}, p_ids{ind1, ind2, ind3, ind4}, flat{flat},
66 is_initialized{false} {}
67
68 /** Calculate the forces
69 * The equations can be found in Appendix C of @cite kruger12a.
70 * @return forces on @p p1, @p p2, @p p3, @p p4
71 */
72 std::tuple<Utils::Vector3d, Utils::Vector3d, Utils::Vector3d, Utils::Vector3d>
73 calc_forces(BoxGeometry const &box_geo, Particle const &p1,
74 Particle const &p2, Particle const &p3, Particle const &p4) const;
75};
Vector implementation and trait types for boost qvm interoperability.
This file contains the defaults for ESPResSo.
Describes a cell structure / cell system.
Parameters for IBM tribend.
std::tuple< int, int, int, int > p_ids
Particle ids.
double theta0
Reference angle.
static constexpr int num
IBMTribend(int ind1, int ind2, int ind3, int ind4, double kb, bool flat)
double kb
Bare bending modulus.
std::tuple< Utils::Vector3d, Utils::Vector3d, Utils::Vector3d, Utils::Vector3d > calc_forces(BoxGeometry const &box_geo, Particle const &p1, Particle const &p2, Particle const &p3, Particle const &p4) const
Calculate the forces The equations can be found in Appendix C of .
double cutoff() const
void initialize(BoxGeometry const &box_geo, CellStructure const &cell_structure)
Set the IBM Tribend parameters.
bool is_initialized
Struct holding all information for one particle.
Definition Particle.hpp:395