Loading [MathJax]/extensions/TeX/AMSmath.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
DensityProfile.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
#ifndef OBSERVABLES_DENSITYPROFILE_HPP
20
#define OBSERVABLES_DENSITYPROFILE_HPP
21
22
#include "
BoxGeometry.hpp
"
23
#include "
Particle.hpp
"
24
#include "
PidProfileObservable.hpp
"
25
#include "system/System.hpp"
26
#include "
utils_histogram.hpp
"
27
28
#include <
utils/Histogram.hpp
>
29
30
#include <utility>
31
#include <vector>
32
33
namespace
Observables
{
34
35
class
DensityProfile
:
public
PidProfileObservable
{
36
public
:
37
using
PidProfileObservable::PidProfileObservable
;
38
39
std::vector<double>
40
evaluate
(boost::mpi::communicator
const
&comm,
41
ParticleReferenceRange
const
&local_particles,
42
const
ParticleObservables::traits<Particle>
&
traits
)
const override
{
43
using
pos_type
=
decltype
(
traits
.position(std::declval<Particle>()));
44
auto
const
&box_geo = *
System::get_system
().
box_geo
;
45
46
std::vector<pos_type>
local_folded_positions
{};
47
local_folded_positions
.reserve(local_particles.size());
48
49
for
(
auto
const
&p : local_particles) {
50
local_folded_positions
.emplace_back(
51
box_geo.folded_position(
traits
.position(p)));
52
}
53
54
auto
const
global_folded_positions
=
55
detail::gather(comm,
local_folded_positions
);
56
57
if
(comm.rank() != 0) {
58
return
{};
59
}
60
61
Utils::Histogram<double, 1>
histogram
(
n_bins
(),
limits
());
62
63
for
(
auto
const
&
vec
:
global_folded_positions
) {
64
for
(
auto
const
&p :
vec
) {
65
histogram
.update(p);
66
}
67
}
68
69
histogram
.normalize();
70
return
histogram
.get_histogram();
71
}
40
evaluate
(boost::mpi::communicator
const
&comm, {
…
}
72
};
35
class
DensityProfile
:
public
PidProfileObservable
{
…
};
73
}
// Namespace Observables
74
75
#endif
BoxGeometry.hpp
Histogram.hpp
Particle.hpp
Observables::DensityProfile
Definition
DensityProfile.hpp:35
Observables::DensityProfile::evaluate
std::vector< double > evaluate(boost::mpi::communicator const &comm, ParticleReferenceRange const &local_particles, const ParticleObservables::traits< Particle > &traits) const override
Definition
DensityProfile.hpp:40
Observables::PidProfileObservable
Definition
core/observables/PidProfileObservable.hpp:30
Observables::PidProfileObservable::PidProfileObservable
PidProfileObservable(std::vector< int > const &ids, int n_x_bins, int n_y_bins, int n_z_bins, double min_x, double max_x, double min_y, double max_y, double min_z, double max_z)
Definition
core/observables/PidProfileObservable.hpp:32
Observables::ProfileObservable::n_bins
auto n_bins() const
Definition
core/observables/ProfileObservable.hpp:70
Observables::ProfileObservable::limits
auto limits() const
Definition
core/observables/ProfileObservable.hpp:72
System::System::box_geo
std::shared_ptr< BoxGeometry > box_geo
Definition
core/system/System.hpp:312
Utils::Histogram
Histogram in Cartesian coordinates.
Definition
Histogram.hpp:46
stream
cudaStream_t stream[1]
CUDA streams for parallel computing on CPU and GPU.
Definition
common_cuda.cu:34
Observables
Definition
BondAngles.hpp:36
Observables::ParticleReferenceRange
std::vector< std::reference_wrapper< Particle const > > ParticleReferenceRange
Definition
core/observables/PidObservable.hpp:47
System::get_system
System & get_system()
Definition
core/system/System.cpp:126
traits
Definition
traits.hpp:24
PidProfileObservable.hpp
ParticleObservables::traits
Definition
properties.hpp:27
utils_histogram.hpp
src
core
observables
DensityProfile.hpp
Generated on Sat Apr 19 2025 01:15:00 for ESPResSo by
1.9.8