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
LBFluidPressureTensor.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_LB_FLUID_STRESS_HPP
20
#define OBSERVABLES_LB_FLUID_STRESS_HPP
21
22
#include "
Observable.hpp
"
23
#include "system/System.hpp"
24
25
#include <
utils/math/sqr.hpp
>
26
#include <
utils/serialization/array.hpp
>
27
28
#include <boost/mpi/collectives/reduce.hpp>
29
30
#include <cstddef>
31
#include <functional>
32
#include <vector>
33
34
namespace
Observables
{
35
class
LBFluidPressureTensor
:
public
Observable
{
36
public
:
37
std::vector<std::size_t>
shape
()
const override
{
return
{3, 3}; }
38
std::vector<double>
39
operator()
(boost::mpi::communicator
const
&comm)
const override
{
40
auto
const
&lb =
System::get_system
().
lb
;
41
auto
const
pressure_conv = 1. / (lb.get_agrid() *
Utils::sqr
(lb.get_tau()));
42
auto
const
local_tensor = lb.
get_pressure_tensor
() * pressure_conv;
43
std::remove_const_t<
decltype
(local_tensor)> tensor;
44
boost::mpi::reduce(comm, local_tensor, tensor, std::plus<>(), 0);
45
return
tensor.as_vector();
46
}
39
operator()
(boost::mpi::communicator
const
&comm)
const override
{
…
}
47
};
35
class
LBFluidPressureTensor
:
public
Observable
{
…
};
48
49
}
// Namespace Observables
50
51
#endif
array.hpp
Observables::LBFluidPressureTensor
Definition
LBFluidPressureTensor.hpp:35
Observables::LBFluidPressureTensor::operator()
std::vector< double > operator()(boost::mpi::communicator const &comm) const override
Definition
LBFluidPressureTensor.hpp:39
Observables::LBFluidPressureTensor::shape
std::vector< std::size_t > shape() const override
Definition
LBFluidPressureTensor.hpp:37
Observables::Observable
Base class for observables.
Definition
core/observables/Observable.hpp:42
System::System::lb
LB::Solver lb
Definition
core/system/System.hpp:310
Observables
Definition
BondAngles.hpp:36
System::get_system
System & get_system()
Definition
core/system/System.cpp:126
Utils::sqr
DEVICE_QUALIFIER constexpr T sqr(T x)
Calculates the SQuaRe of x.
Definition
sqr.hpp:28
Observable.hpp
sqr.hpp
LB::Solver::get_pressure_tensor
Utils::VectorXd< 9 > get_pressure_tensor() const
Definition
lb/Solver.cpp:190
src
core
observables
LBFluidPressureTensor.hpp
Generated on Thu Apr 24 2025 01:16:06 for ESPResSo by
1.9.8