OpenLB 1.7
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_3D_H
25#define DUAL_FUNCTORS_3D_H
26
27
30
31namespace olb {
32
33namespace opti {
34
37template <typename T, typename DESCRIPTOR>
39protected:
40 const int _overlap;
42public:
44 int overlap,
45 const UnitConverter<T,DESCRIPTOR>& converter);
46 bool operator()(T output[], const int input[]);
47};
48
51template <typename T, typename DESCRIPTOR>
53public:
55 const UnitConverter<T,DESCRIPTOR>& converter);
56 bool operator()(T output[], const int input[]);
57};
58
59
62template <typename T, typename DESCRIPTOR>
63class BlockLatticeDphysVelocityDf3D : public BlockLatticeF3D<T,DESCRIPTOR> {
64protected:
65 const int _overlap;
67private:
68 const int _nDim;
69 const int _extractDim;
70public:
72 int overlap,
73 const UnitConverter<T,DESCRIPTOR>& converter,
74 int nDim, int extractDim);
75 bool operator()(T output[], const int input[]);
76};
77
80template <typename T, typename DESCRIPTOR>
82public:
84 const UnitConverter<T,DESCRIPTOR>& converter);
86 const UnitConverter<T,DESCRIPTOR>& converter,
88 bool operator()(T output[], const int input[]);
89};
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:
224public:
229 FunctorPtr<SuperIndicatorF3D<T>>&& indicatorF);
234 SuperGeometry<T,3>& geometry,
235 std::vector<int> materials);
240 SuperGeometry<T,3>& geometry,
241 int material);
242
243 bool operator()(T output[], const int input[]);
244};
245
247// with two lattice functors
248template <typename T, typename DESCRIPTOR>
250private:
253 FunctorPtr<SuperF3D<T,T>> _wantedF;
255public:
259 FunctorPtr<SuperF3D<T,T>>&& wantedF,
260 FunctorPtr<SuperIndicatorF3D<T>>&& indicatorF);
261
262 bool operator()(T output[], const int input[]);
263};
264
266template <typename T, typename DESCRIPTOR>
268private:
269 BlockF3D<T>& _f;
270 BlockF3D<T>& _dFdF;
271 BlockF3D<T>& _wantedF;
272 BlockIndicatorF3D<T>& _indicatorF;
273
274 const int _extractDim;
275 const T _globalValue;
276 const T _weight;
277public:
279 BlockStructureD<3>& blockStructure,
281 BlockF3D<T>& dFdF,
282 BlockF3D<T>& wantedF,
283 BlockIndicatorF3D<T>& indicatorF,
284 T globalValue,
285 T weight);
286
287 bool operator()(T output[], const int input[]);
288};
289
291template <typename T, typename DESCRIPTOR>
293private:
298public:
301 FunctorPtr<SuperF3D<T,T>>&& f, int extractDim,
304 FunctorPtr<SuperIndicatorF3D<T>>&& indicatorF);
305
306 bool operator()(T output[], const int input[]);
307};
308
309} // namespace opti
310
311} // namespace olb
312
313#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,...
Base block indicator functor.
represents all functors that operate on a DESCRIPTOR in general, e.g. getVelocity(),...
Platform-abstracted block lattice for external access and inter-block interaction.
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
Representation of a statistic for a parallel 2D geometry.
identity functor for memory management
Base indicator functor (discrete)
represents all functors that operate on a SuperLattice in general, e.g. getVelocity(),...
Functor used to convert analytical functions to lattice functions.
represents all functors that operate on a DESCRIPTOR with output in Phys, e.g. physVelocity(),...
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...
bool operator()(T output[], const int input[])
has to be implemented for 'every' derived class
BlockLatticeDphysDissipationDf3D(BlockLattice< T, DESCRIPTOR > &blockLattice, int overlap, const UnitConverter< T, DESCRIPTOR > &converter)
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_Lattice(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(f-f_wanted)^2/f_wanted^2 on a lattice
bool operator()(T output[], const int input[])
DrelativeDifferenceObjectiveDf3D(SuperLattice< T, DESCRIPTOR > &sLattice, FunctorPtr< SuperF3D< T, T > > &&f, FunctorPtr< SuperF3D< T, T > > &&dFdF, FunctorPtr< AnalyticalF3D< T, T > > &&wantedF, FunctorPtr< SuperIndicatorF3D< T > > &&indicatorF)
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...
SuperLatticeDphysDissipationDf3D(SuperLattice< T, DESCRIPTOR > &sLattice, const UnitConverter< T, DESCRIPTOR > &converter)
bool operator()(T output[], const int input[])
functor to get pointwise dual velocity density on local lattices, if globIC is not on the local proce...
bool operator()(T output[], const int input[])
SuperLatticeDphysVelocityDf3D(SuperLattice< T, DESCRIPTOR > &sLattice, const UnitConverter< T, DESCRIPTOR > &converter)
Top level namespace for all of OpenLB.
Optimization Code.