Loading [MathJax]/extensions/tex2jax.js
ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Variables
_
a
b
c
f
g
i
k
m
n
o
p
r
s
w
Typedefs
a
b
c
d
e
f
g
h
i
l
m
o
p
q
t
v
Enumerations
Enumerator
d
h
m
n
r
s
t
Concepts
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
i
j
k
l
m
o
p
q
r
s
t
u
v
Enumerations
Enumerator
a
i
l
n
o
p
s
u
v
Related Symbols
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
v
w
Variables
a
b
c
g
h
i
m
p
s
t
u
v
w
Typedefs
Enumerations
Enumerator
Macros
c
d
f
g
h
i
k
m
n
o
p
q
r
s
t
u
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Concepts
Loading...
Searching...
No Matches
electrostatics/scafacos_impl.hpp
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2010-2022 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
#include "
config/config.hpp
"
25
26
#ifdef SCAFACOS
27
28
#include "
electrostatics/scafacos.hpp
"
29
30
#include "
scafacos/ScafacosContext.hpp
"
31
32
#include <
scafacos/Coulomb.hpp
>
33
34
#include <boost/range/numeric.hpp>
35
36
#include <vector>
37
38
struct
CoulombScafacosImpl
:
public
CoulombScafacos
,
39
public
ScafacosContext
<::Scafacos::Coulomb> {
40
using
ScafacosContext
=
ScafacosContext<::Scafacos::Coulomb>
;
41
using
CoulombScafacos::CoulombScafacos;
42
using
ScafacosContext::ScafacosContext;
43
44
void
update_particle_data
()
override
;
45
void
update_particle_forces
()
const override
;
46
47
double
long_range_energy
()
override
{
48
update_particle_data
();
49
run(charges, positions, fields, potentials);
50
return
0.5 *
prefactor
* boost::inner_product(charges, potentials, 0.);
51
}
47
double
long_range_energy
()
override
{
…
}
52
53
void
add_long_range_forces
()
override
{
54
update_particle_data
();
55
run(charges, positions, fields, potentials);
56
update_particle_forces
();
57
}
53
void
add_long_range_forces
()
override
{
…
}
58
59
double
get_pair_force
(
double
dist)
const override
{
60
return
ScafacosContext::pair_force(dist);
61
}
59
double
get_pair_force
(
double
dist)
const override
{
…
}
62
63
double
get_pair_energy
(
double
dist)
const override
{
64
return
ScafacosContext::pair_energy(dist);
65
}
63
double
get_pair_energy
(
double
dist)
const override
{
…
}
66
67
void
set_near_field_delegation
(
bool
delegate)
override
{
68
return
ScafacosContext::set_near_field_delegation(delegate);
69
}
67
void
set_near_field_delegation
(
bool
delegate)
override
{
…
}
70
71
bool
get_near_field_delegation
()
const override
{
72
return
ScafacosContext::get_near_field_delegation();
73
}
71
bool
get_near_field_delegation
()
const override
{
…
}
74
75
double
get_r_cut
()
const override
{
return
ScafacosContext::r_cut(); }
76
77
private
:
78
/** Inputs */
79
std::vector<double> positions, charges;
80
/** Outputs */
81
std::vector<double> fields, potentials;
82
83
/** Determine runtime for a specific cutoff */
84
double
time_r_cut(
double
r_cut);
85
86
/** Determine the optimal cutoff by bisection */
87
void
tune_r_cut();
88
void
tune_impl
()
override
;
89
void
set_r_cut_and_tune(
double
r_cut) {
90
update_particle_data
();
91
set_r_cut(r_cut);
92
ScafacosContext::tune(charges, positions);
93
}
94
};
38
struct
CoulombScafacosImpl
:
public
CoulombScafacos
, {
…
};
95
96
#endif
// SCAFACOS
Coulomb.hpp
ScafacosContext.hpp
ScafacosContext implements the interface of the ScaFaCoS bridge.
Coulomb::Actor< CoulombScafacos >::prefactor
double prefactor
Electrostatics prefactor.
Definition
electrostatics/actor.hpp:46
config.hpp
This file contains the defaults for ESPResSo.
scafacos.hpp
CoulombScafacosImpl
Definition
electrostatics/scafacos_impl.hpp:39
CoulombScafacosImpl::update_particle_data
void update_particle_data() override
Definition
electrostatics/scafacos_impl.cpp:52
CoulombScafacosImpl::update_particle_forces
void update_particle_forces() const override
Definition
electrostatics/scafacos_impl.cpp:69
CoulombScafacosImpl::get_pair_force
double get_pair_force(double dist) const override
Definition
electrostatics/scafacos_impl.hpp:59
CoulombScafacosImpl::set_near_field_delegation
void set_near_field_delegation(bool delegate) override
Definition
electrostatics/scafacos_impl.hpp:67
CoulombScafacosImpl::get_pair_energy
double get_pair_energy(double dist) const override
Definition
electrostatics/scafacos_impl.hpp:63
CoulombScafacosImpl::tune_impl
void tune_impl() override
Definition
electrostatics/scafacos_impl.cpp:133
CoulombScafacosImpl::long_range_energy
double long_range_energy() override
Definition
electrostatics/scafacos_impl.hpp:47
CoulombScafacosImpl::get_near_field_delegation
bool get_near_field_delegation() const override
Definition
electrostatics/scafacos_impl.hpp:71
CoulombScafacosImpl::add_long_range_forces
void add_long_range_forces() override
Definition
electrostatics/scafacos_impl.hpp:53
CoulombScafacosImpl::get_r_cut
double get_r_cut() const override
Definition
electrostatics/scafacos_impl.hpp:75
CoulombScafacos
Definition
core/electrostatics/scafacos.hpp:38
ScafacosContext
Definition
ScafacosContext.hpp:47
src
core
electrostatics
scafacos_impl.hpp
Generated on Sat Apr 26 2025 01:17:01 for ESPResSo by
1.9.8