OpenLB 1.7
Loading...
Searching...
No Matches
eul2LagrPostProcessor3D.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2020 Davide Dapelo
4 * E-mail contact: info@openlb.net
5 * The most recent release of OpenLB can be downloaded at
6 * <http://www.openlb.net/>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program 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
19 * License along with this program; if not, write to the Free
20 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22*/
23
28#ifndef EUL2LAGR_POST_PROCESSOR_H
29#define EUL2LAGR_POST_PROCESSOR_H
30
32
33namespace olb {
34
36/*
37 * Virtual base class for Eul2LagrOperator3D.
38 * Its raison d'etre lies on the fact that postprocessor classes cannot be templetized in PARTICLETYPE,
39 * and hence, a reference to Eul2LagrOperatorBase3D is passed.
40 */
41template<typename T, typename DESCRIPTOR>
43public:
44 virtual bool operator()(BlockLattice<T,DESCRIPTOR>& blockLattice) =0;
45protected:
47};
48
49/*
50 * Stores the particle density, converted to Euler
51 */
52template<typename T, typename DESCRIPTOR, template<typename U> class PARTICLETYPE>
53class Eul2LagrOperator3D final : public Eul2LagrOperatorBase3D<T,DESCRIPTOR> {
54public:
56 bool operator()(BlockLattice<T,DESCRIPTOR>& blockLattice) override;
57private:
58 SuperGeometry<T,3>& _superGeometry;
60};
61
62
64/*
65 * Postprocessor to store the particle density, converted to Euler.
66 * Due to the impossibility of templating the class on PARTICLETYPE, the real operations
67 * are outsourced in Eul2LagrOperator3D.
68 */
69template<typename T, typename DESCRIPTOR>
70class Eul2LagrPostProcessor3D final : public LocalPostProcessor3D<T,DESCRIPTOR> {
71public:
72 Eul2LagrPostProcessor3D ( int x0, int x1, int y0, int y1, int z0, int z1,
73 std::shared_ptr<Eul2LagrOperatorBase3D<T,DESCRIPTOR>> eul2LagrOperator );
74 Eul2LagrPostProcessor3D(std::shared_ptr<Eul2LagrOperatorBase3D<T,DESCRIPTOR>> eul2LagrOperator);
75 int extent() const override
76 {
77 return 1;
78 }
79 int extent(int whichDirection) const override
80 {
81 return 1;
82 }
83 void process(BlockLattice<T,DESCRIPTOR>& blockLattice) override;
85 int x0, int x1, int y0, int y1, int z0, int z1 ) override;
86private:
87 int _x0, _x1, _y0, _y1, _z0, _z1;
88 std::shared_ptr<Eul2LagrOperatorBase3D<T,DESCRIPTOR>> _eul2LagrOperator;
89};
90
91/*
92 * Generator of Eul2LagrPostProcessor3D
93 */
94template<typename T, typename DESCRIPTOR, template<typename U> class PARTICLETYPE>
96public:
97 Eul2LagrPostProcessorGenerator3D ( int x0_, int x1_, int y0_, int y1_, int z0_, int z1_,
100 PostProcessor3D<T,DESCRIPTOR>* generate() const override;
102private:
103 std::shared_ptr<Eul2LagrOperator3D<T,DESCRIPTOR,PARTICLETYPE>> _eul2LagrOperator;
104};
105
106
108/*
109 * Postprocessor test AnalyticalRandomNormal functional
110 * through storing a Normal density to eul2Lagr external field.
111 */
112template<typename T, typename DESCRIPTOR>
113class Eul2LagrNormDistrPostProcessor3D final : public LocalPostProcessor3D<T,DESCRIPTOR> {
114public:
115 Eul2LagrNormDistrPostProcessor3D(int x0, int x1, int y0, int y1, int z0, int z1, T mean, T stdDev, SuperGeometry<T,3>& superGeometry);
116 Eul2LagrNormDistrPostProcessor3D(T mean, T stdDev, SuperGeometry<T,3>& superGeometry);
117 int extent() const override
118 {
119 return 1;
120 }
121 int extent(int whichDirection) const override
122 {
123 return 1;
124 }
125 void process(BlockLattice<T,DESCRIPTOR>& blockLattice) override;
126 void processSubDomain ( BlockLattice<T,DESCRIPTOR>& blockLattice,
127 int x0, int x1, int y0, int y1, int z0, int z1 ) override;
128private:
129 int _x0, _x1, _y0, _y1, _z0, _z1;
130 AnalyticalRandomNormal<3,T,T> _randomNormal;
131 SuperGeometry<T,3>& _superGeometry;
132};
133
134/*
135 * Generator of Eul2LagrNormDistrPostProcessor3D
136 */
137template<typename T, typename DESCRIPTOR>
139public:
140 Eul2LagrNormDistrPostProcessorGenerator3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, T mean, T stdDev, SuperGeometry<T,3>& superGeometry);
141 Eul2LagrNormDistrPostProcessorGenerator3D(T mean, T stdDev, SuperGeometry<T,3>& superGeometry);
142 PostProcessor3D<T,DESCRIPTOR>* generate() const override;
144private:
145 T _mean;
146 T _stdDev;
147 SuperGeometry<T,3>& _superGeometry;
148};
149
150
151
152} // olb
153
154#endif
AnalyticalRandomNormal: DD -> 1D with random image in (0,1)
Platform-abstracted block lattice for external access and inter-block interaction.
int extent() const override
Extent of application area (0 for purely local operations)
int extent(int whichDirection) const override
Extent of application area along a direction (0 or 1)
void process(BlockLattice< T, DESCRIPTOR > &blockLattice) override
Execute post-processing step.
Eul2LagrNormDistrPostProcessor3D(int x0, int x1, int y0, int y1, int z0, int z1, T mean, T stdDev, SuperGeometry< T, 3 > &superGeometry)
void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0, int x1, int y0, int y1, int z0, int z1) override
Execute post-processing step on a sublattice.
Eul2LagrNormDistrPostProcessorGenerator3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, T mean, T stdDev, SuperGeometry< T, 3 > &superGeometry)
PostProcessorGenerator3D< T, DESCRIPTOR > * clone() const override
PostProcessor3D< T, DESCRIPTOR > * generate() const override
bool operator()(BlockLattice< T, DESCRIPTOR > &blockLattice) override
Eul2LagrOperator3D(ParticleSystem3D< T, PARTICLETYPE > &pSystem, SuperGeometry< T, 3 > &superGeometry)
virtual bool operator()(BlockLattice< T, DESCRIPTOR > &blockLattice)=0
int extent() const override
Extent of application area (0 for purely local operations)
void process(BlockLattice< T, DESCRIPTOR > &blockLattice) override
Execute post-processing step.
Eul2LagrPostProcessor3D(int x0, int x1, int y0, int y1, int z0, int z1, std::shared_ptr< Eul2LagrOperatorBase3D< T, DESCRIPTOR > > eul2LagrOperator)
int extent(int whichDirection) const override
Extent of application area along a direction (0 or 1)
void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0, int x1, int y0, int y1, int z0, int z1) override
Execute post-processing step on a sublattice.
Eul2LagrPostProcessorGenerator3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, SuperParticleSystem3D< T, PARTICLETYPE > &spSys, SuperGeometry< T, 3 > &superGeometry)
PostProcessorGenerator3D< T, DESCRIPTOR > * clone() const override
PostProcessor3D< T, DESCRIPTOR > * generate() const override
Representation of a statistic for a parallel 2D geometry.
The class superParticleSystem is the basis for particulate flows within OpenLB.
Top level namespace for all of OpenLB.