ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
observable.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 SRC_PARTICLE_OBSERVABLES_OBSERVABLE_HPP
20
#define SRC_PARTICLE_OBSERVABLES_OBSERVABLE_HPP
21
22
#include "
algorithms.hpp
"
23
#include "
properties.hpp
"
24
25
namespace
ParticleObservables
{
26
/**
27
* @brief Meta-Observable that returns the product of two
28
* other observables.
29
*
30
* The operand observables are stored by privately deriving
31
* from them to get the empty case optimization if they do
32
* not have state.
33
*
34
* @tparam Left left operand of the product.
35
* @tparam Right right operand of the product.
36
*/
37
template
<
class
Left,
class
Right>
struct
Product
: Left, Right {
38
Product
(Left left = {}, Right right = {})
39
: Left(std::move(left)), Right(std::move(right)) {}
40
41
template
<
class
Particle,
class
Traits = default_traits<Particle>>
42
decltype
(
auto
)
operator
()(
Particle
const
&p,
43
Traits
const
&
traits
= {})
const
{
44
return
Left::template operator()<
Particle
, Traits>(p,
traits
) *
45
Right::template
operator
()<
Particle
, Traits>(p,
traits
);
46
}
47
};
48
49
using
Momentum
=
Product<Mass, Velocity>
;
50
using
AverageMomentum
=
Average<Momentum>
;
51
using
CenterOfMassPosition
=
WeightedAverage<Position, Mass>
;
52
using
CenterOfMassVelocity
=
WeightedAverage<Velocity, Mass>
;
53
using
Identities
=
Map<Identity>
;
54
using
Forces
=
Map<Force>
;
55
using
Positions
=
Map<Position>
;
56
using
Velocities
=
Map<Velocity>
;
57
using
Directors
=
Map<Director>
;
58
using
DipoleFields
=
Map<DipoleField>
;
59
using
BodyVelocities
=
Map<BodyVelocity>
;
60
using
AngularVelocities
=
Map<AngularVelocity>
;
61
using
BodyAngularVelocities
=
Map<BodyAngularVelocity>
;
62
}
// namespace ParticleObservables
63
64
#endif
// SRC_PARTICLE_OBSERVABLES_OBSERVABLE_HPP
algorithms.hpp
Generic algorithms for the calculation of particle property derived observables.
ParticleObservables
Definition
ParticleTraits.hpp:28
traits
Definition
traits.hpp:24
properties.hpp
This file contains interface functionality for extracting particle properties via a particle traits c...
ParticleObservables::Average
Definition
algorithms.hpp:99
ParticleObservables::Map
Definition
algorithms.hpp:110
ParticleObservables::Product
Meta-Observable that returns the product of two other observables.
Definition
observable.hpp:37
ParticleObservables::Product::Product
Product(Left left={}, Right right={})
Definition
observable.hpp:38
ParticleObservables::WeightedAverage
Definition
algorithms.hpp:84
Particle
Struct holding all information for one particle.
Definition
Particle.hpp:395
src
particle_observables
include
particle_observables
observable.hpp
Generated on Fri Nov 8 2024 02:12:53 for ESPResSo by
1.9.8