OpenLB 1.8.1
Loading...
Searching...
No Matches
dualFunctors3D.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2014 Mathias J. Krause
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
24#ifndef DUAL_FUNCTORS_H
25#define DUAL_FUNCTORS_H
26
27
31
32namespace olb {
33
34namespace opti {
35
38template <typename T, typename DESCRIPTOR>
39class BlockLatticeDphysDissipationDf : public BlockLatticeF<T,DESCRIPTOR> {
40protected:
41 const int _overlap;
43public:
45 int overlap,
46 const UnitConverter<T,DESCRIPTOR>& converter);
47 bool operator()(T output[], const int input[]);
48};
49
52template <typename T, typename DESCRIPTOR>
58
59
62// this is made a BGK-type momenta computation.
63template <typename T, typename DESCRIPTOR>
64class BlockLatticeDphysVelocityDf3D : public BlockLatticeF3D<T,DESCRIPTOR> {
65protected:
66 const int _overlap;
68private:
69 const int _nDim;
70 const int _extractDim;
71public:
73 int overlap,
74 const UnitConverter<T,DESCRIPTOR>& converter,
75 int nDim, int extractDim);
76 bool operator()(T output[], const int input[]);
77};
78
81template <typename T, typename DESCRIPTOR>
90
91
93template <typename T, typename DESCRIPTOR>
113
114
116template <typename T, typename DESCRIPTOR>
117class BlockDdifferenceObjectiveDf3D : public BlockLatticeF3D<T,DESCRIPTOR> {
118private:
119 BlockF3D<T>& _f;
120 BlockF3D<T>& _dFdF;
121 BlockF3D<T>& _wantedF;
122 BlockIndicatorF3D<T>& _indicatorF;
123
124 const T _weight;
125public:
127 BlockLattice<T,DESCRIPTOR>& blockLattice,
128 BlockF3D<T>& f,
129 BlockF3D<T>& dFdF,
130 BlockF3D<T>& wantedF,
131 BlockIndicatorF3D<T>& indicatorF,
132 T weight);
133
134 bool operator()(T output[], const int input[]);
135};
136
138template <typename T, typename DESCRIPTOR>
154
155
157template<typename T, typename DESCRIPTOR>
159public:
164 FunctorPtr<SuperIndicatorF3D<T>>&& indicatorF);
168 FunctorPtr<SuperIndicatorF3D<T>>&& indicatorF);
169
174 SuperGeometry<T,3>& geometry,
175 std::vector<int> materials);
180 SuperGeometry<T,3>& geometry,
181 int material);
182
183 // with two lattice functors
187 FunctorPtr<SuperF3D<T,T>>&& wantedF,
188 FunctorPtr<SuperIndicatorF3D<T>>&& indicatorF);
189};
190
191
193template <typename T, typename DESCRIPTOR>
195private:
196 BlockF3D<T>& _f;
197 BlockF3D<T>& _dFdF;
198 BlockF3D<T>& _wantedF;
199 BlockIndicatorF3D<T>& _indicatorF;
200
201 const T _globalValue;
202 const T _weight;
203public:
205 BlockStructureD<3>& blockStructure,
206 BlockF3D<T>& f,
207 BlockF3D<T>& dFdF,
208 BlockF3D<T>& wantedF,
209 BlockIndicatorF3D<T>& indicatorF,
210 T globalValue,
211 T weight);
212
213 bool operator()(T output[], const int input[]);
214};
215
217template <typename T, typename DESCRIPTOR>
219private:
222 FunctorPtr<SuperF3D<T,T>> _wantedF;
224public:
228 FunctorPtr<SuperF3D<T,T>>&& wantedF,
229 FunctorPtr<SuperIndicatorF3D<T>>&& indicatorF);
234 FunctorPtr<SuperIndicatorF3D<T>>&& indicatorF);
239 SuperGeometry<T,3>& geometry,
240 std::vector<int> materials);
245 SuperGeometry<T,3>& geometry,
246 int material);
247
248 bool operator()(T output[], const int input[]);
249};
250
252template <typename T, typename DESCRIPTOR>
254private:
255 BlockF3D<T>& _f;
256 BlockF3D<T>& _dFdF;
257 BlockF3D<T>& _wantedF;
258 BlockIndicatorF3D<T>& _indicatorF;
259
260 const int _extractDim;
261 const T _globalValue;
262 const T _weight;
263public:
265 BlockStructureD<3>& blockStructure,
267 BlockF3D<T>& dFdF,
268 BlockF3D<T>& wantedF,
269 BlockIndicatorF3D<T>& indicatorF,
270 T globalValue,
271 T weight);
272
273 bool operator()(T output[], const int input[]);
274};
275
277template <typename T, typename DESCRIPTOR>
279private:
284public:
287 FunctorPtr<SuperF3D<T,T>>&& f, int extractDim,
290 FunctorPtr<SuperIndicatorF3D<T>>&& indicatorF);
291
292 bool operator()(T output[], const int input[]);
293};
294
295} // namespace opti
296
297} // namespace olb
298
299#endif
AnalyticalF are applications from DD to XD, where X is set by the constructor.
functor to extract one component
represents all functors that operate on a cuboid in general, mother class of BlockLatticeF,...
Definition aliases.h:174
Base block indicator functor.
Definition aliases.h:204
represents all functors that operate on a DESCRIPTOR in general, e.g. getVelocity(),...
Definition aliases.h:144
Base of a regular block.
Smart pointer for managing the various ways of passing functors around.
Definition functorPtr.h:60
functor to extract one component
represents all functors that operate on a SuperStructure<T,3> in general
Definition aliases.h:184
Representation of a statistic for a parallel 2D geometry.
identity functor for memory management
Base indicator functor (discrete)
Definition aliases.h:194
represents all functors that operate on a SuperLattice in general, e.g. getVelocity(),...
Definition aliases.h:115
Functor used to convert analytical functions to lattice functions.
represents all functors that operate on a DESCRIPTOR with output in Phys, e.g. physVelocity(),...
Definition aliases.h:315
Super class maintaining block lattices for a cuboid decomposition.
Conversion between physical and lattice units, as well as discretization.
functor to compute 0.5*(f-f_wanted)^2 on a lattice
BlockDdifferenceObjectiveDf3D(BlockLattice< T, DESCRIPTOR > &blockLattice, BlockF3D< T > &f, BlockF3D< T > &dFdF, BlockF3D< T > &wantedF, BlockIndicatorF3D< T > &indicatorF, T weight)
bool operator()(T output[], const int input[])
has to be implemented for 'every' derived class
functor to compute 0.5*(f[extractDim]-f_wanted[0])^2/f_wanted^2 on a lattice
bool operator()(T output[], const int input[])
has to be implemented for 'every' derived class
BlockDrelativeDifferenceObjectiveComponentDf3D(BlockStructureD< 3 > &blockStructure, BlockExtractComponentF3D< T > &f, BlockF3D< T > &dFdF, BlockF3D< T > &wantedF, BlockIndicatorF3D< T > &indicatorF, T globalValue, T weight)
functor to compute 0.5(f-f_wanted)^2/f_wanted^2 on a lattice
bool operator()(T output[], const int input[])
has to be implemented for 'every' derived class
BlockDrelativeDifferenceObjectiveDf3D(BlockStructureD< 3 > &blockStructure, BlockF3D< T > &f, BlockF3D< T > &dFdF, BlockF3D< T > &wantedF, BlockIndicatorF3D< T > &indicatorF, T globalValue, T weight)
functor to get the pointwise dual dissipation density on local lattices, if globIC is not on the loca...
const UnitConverter< T, DESCRIPTOR > & _converter
bool operator()(T output[], const int input[])
BlockLatticeDphysDissipationDf(BlockLattice< T, DESCRIPTOR > &blockLattice, int overlap, const UnitConverter< T, DESCRIPTOR > &converter)
functor to get pointwise dual velocity density on local lattices, if globIC is not on the local proce...
BlockLatticeDphysVelocityDf3D(BlockLattice< T, DESCRIPTOR > &blockLattice, int overlap, const UnitConverter< T, DESCRIPTOR > &converter, int nDim, int extractDim)
bool operator()(T output[], const int input[])
has to be implemented for 'every' derived class
const UnitConverter< T, DESCRIPTOR > & _converter
functor to compute 0.5*(f-f_wanted)^2 on a lattice
bool operator()(T output[], const int input[])
DdifferenceObjectiveDf3D(FunctorPtr< SuperLatticePhysF3D< T, DESCRIPTOR > > &&f, FunctorPtr< SuperLatticePhysF3D< T, DESCRIPTOR > > &&dFdF, FunctorPtr< AnalyticalF3D< T, T > > &&wantedF, FunctorPtr< SuperIndicatorF3D< T > > &&indicatorF)
functor to compute 0.5*L2Norm(f-f_wanted)^2 on a lattice
DifferenceObjective3D(SuperLattice< T, DESCRIPTOR > &sLattice, FunctorPtr< SuperF3D< T, T > > &&f, FunctorPtr< AnalyticalF3D< T, T > > &&wantedF, FunctorPtr< SuperIndicatorF3D< T > > &&indicatorF)
functor to compute 0.5*(f[extractDim]-f_wanted[0])^2/f_wanted^2 on a lattice
DrelativeDifferenceObjectiveComponentDf3D(SuperLattice< T, DESCRIPTOR > &sLattice, FunctorPtr< SuperF3D< T, T > > &&f, int extractDim, FunctorPtr< SuperF3D< T, T > > &&dFdF, FunctorPtr< AnalyticalF3D< T, T > > &&wantedF, FunctorPtr< SuperIndicatorF3D< T > > &&indicatorF)
bool operator()(T output[], const int input[])
functor to compute 0.5(f-f_wanted)^2/f_wanted^2 on a lattice
DrelativeDifferenceObjectiveDf3D(SuperLattice< T, DESCRIPTOR > &sLattice, FunctorPtr< SuperF3D< T, T > > &&f, FunctorPtr< SuperF3D< T, T > > &&dFdF, FunctorPtr< SuperF3D< T, T > > &&wantedF, FunctorPtr< SuperIndicatorF3D< T > > &&indicatorF)
bool operator()(T output[], const int input[])
functor to compute 0.5*L2Norm(f-f_wanted)^2/L2Norm(f_wanted)^2 on a lattice
RelativeDifferenceObjective3D(SuperLattice< T, DESCRIPTOR > &sLattice, FunctorPtr< SuperF3D< T, T > > &&f, FunctorPtr< AnalyticalF3D< T, T > > &&wantedF, FunctorPtr< SuperIndicatorF3D< T > > &&indicatorF)
functor to get pointwise dual dissipation density on local lattices, if globIC is not on the local pr...
SuperLatticeDphysDissipationDf(SuperLattice< T, DESCRIPTOR > &sLattice, const UnitConverter< T, DESCRIPTOR > &converter)
functor to get pointwise dual velocity density on local lattices, if globIC is not on the local proce...
SuperLatticeDphysVelocityDf3D(SuperLattice< T, DESCRIPTOR > &sLattice, const UnitConverter< T, DESCRIPTOR > &converter)
Top level namespace for all of OpenLB.
std::conditional_t< DESCRIPTOR::d==2, BlockLatticeF2D< T, DESCRIPTOR >, BlockLatticeF3D< T, DESCRIPTOR > > BlockLatticeF
Definition aliases.h:147
std::conditional_t< DESCRIPTOR::d==2, SuperLatticePhysF2D< T, DESCRIPTOR >, SuperLatticePhysF3D< T, DESCRIPTOR > > SuperLatticePhysF
Definition aliases.h:318
Optimization Code.