ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
ibm_triel.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
#ifndef IBM_TRIEL_H
21
#define IBM_TRIEL_H
22
23
#include "
config/config.hpp
"
24
25
#include <
utils/Vector.hpp
>
26
27
#include <boost/optional.hpp>
28
29
#include <tuple>
30
31
enum class
tElasticLaw
{
NeoHookean
,
Skalak
};
32
33
/** Parameters for IBM elastic triangle (triel) */
34
struct
IBMTriel
{
35
// These values encode the reference state
36
double
l0
;
37
double
lp0
;
38
double
sinPhi0
;
39
double
cosPhi0
;
40
double
area0
;
41
42
// These values are cache values to speed up computation
43
double
a1
;
44
double
a2
;
45
double
b1
;
46
double
b2
;
47
48
// These are interaction parameters
49
// k1 is used for Neo-Hookean
50
// k1 and k2 are used Skalak
51
double
maxDist
;
52
tElasticLaw
elasticLaw
;
53
double
k1
;
54
double
k2
;
55
56
double
cutoff
()
const
{
return
maxDist
; }
57
58
static
constexpr
int
num
= 2;
59
60
/** Set the IBM Triel parameters.
61
* Also calculate and store the reference state.
62
*/
63
IBMTriel
(
int
ind1,
int
ind2,
int
ind3,
double
maxDist
,
tElasticLaw
elasticLaw
,
64
double
k1
,
double
k2
);
65
66
/** Calculate the forces.
67
* The equations can be found in Appendix C of @cite kruger12a.
68
* @return the forces on @p p1, @p p2, @p p3
69
*/
70
boost::optional<std::tuple<Utils::Vector3d, Utils::Vector3d, Utils::Vector3d>>
71
calc_forces
(
Utils::Vector3d
const
&vec1,
Utils::Vector3d
const
&vec2)
const
;
72
73
private
:
74
friend
boost::serialization::access;
75
template
<
typename
Archive>
76
void
serialize(Archive &ar,
long
int
/* version */
) {
77
ar &
l0
;
78
ar &
lp0
;
79
ar &
sinPhi0
;
80
ar &
cosPhi0
;
81
ar &
area0
;
82
ar &
a1
;
83
ar &
a2
;
84
ar &
b1
;
85
ar &
b2
;
86
ar &
maxDist
;
87
ar &
elasticLaw
;
88
ar &
k1
;
89
ar &
k2
;
90
}
91
};
92
93
#endif
Vector.hpp
Vector implementation and trait types for boost qvm interoperability.
Utils::Vector
Definition
Vector.hpp:47
config.hpp
This file contains the defaults for ESPResSo.
tElasticLaw
tElasticLaw
Definition
ibm_triel.hpp:31
tElasticLaw::NeoHookean
@ NeoHookean
tElasticLaw::Skalak
@ Skalak
IBMTriel
Parameters for IBM elastic triangle (triel)
Definition
ibm_triel.hpp:34
IBMTriel::cosPhi0
double cosPhi0
Definition
ibm_triel.hpp:39
IBMTriel::calc_forces
boost::optional< std::tuple< Utils::Vector3d, Utils::Vector3d, Utils::Vector3d > > calc_forces(Utils::Vector3d const &vec1, Utils::Vector3d const &vec2) const
Calculate the forces.
Definition
ibm_triel.cpp:75
IBMTriel::lp0
double lp0
Definition
ibm_triel.hpp:37
IBMTriel::num
static constexpr int num
Definition
ibm_triel.hpp:58
IBMTriel::k1
double k1
Definition
ibm_triel.hpp:53
IBMTriel::b2
double b2
Definition
ibm_triel.hpp:46
IBMTriel::l0
double l0
Definition
ibm_triel.hpp:36
IBMTriel::cutoff
double cutoff() const
Definition
ibm_triel.hpp:56
IBMTriel::elasticLaw
tElasticLaw elasticLaw
Definition
ibm_triel.hpp:52
IBMTriel::maxDist
double maxDist
Definition
ibm_triel.hpp:51
IBMTriel::b1
double b1
Definition
ibm_triel.hpp:45
IBMTriel::a1
double a1
Definition
ibm_triel.hpp:43
IBMTriel::a2
double a2
Definition
ibm_triel.hpp:44
IBMTriel::sinPhi0
double sinPhi0
Definition
ibm_triel.hpp:38
IBMTriel::area0
double area0
Definition
ibm_triel.hpp:40
IBMTriel::k2
double k2
Definition
ibm_triel.hpp:54
src
core
immersed_boundary
ibm_triel.hpp
Generated on Sat May 11 2024 01:33:52 for ESPResSo by
1.9.8