OpenLB 1.8.1
Loading...
Searching...
No Matches
dualFunctors3D.hh
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_HH
25#define DUAL_FUNCTORS_HH
26
27
33
34
35namespace olb {
36
37namespace opti {
38
39template <typename T, typename DESCRIPTOR>
41 BlockLattice<T,DESCRIPTOR>& blockLattice,
42 int overlap,
43 const UnitConverter<T,DESCRIPTOR>& converter)
44 : BlockLatticeF<T,DESCRIPTOR>(blockLattice,DESCRIPTOR::q),
45 _overlap(overlap),
46 _converter(converter)
47{
48 this->getName() = "dPhysDissipationDf";
49}
50
51template <typename T, typename DESCRIPTOR>
53{
54 const T omega = _converter.getLatticeRelaxationFrequency();
55 const T dt = _converter.getConversionFactorTime();
56
57 T rho, u[DESCRIPTOR::d], pi[util::TensorVal<DESCRIPTOR >::n];
58 auto cell = this->_blockLattice.get(latticeR);
59 cell.computeAllMomenta(rho, u, pi);
60
61 for (int jPop=0; jPop < DESCRIPTOR::q; ++jPop) {
62 dDdf[jPop] = T();
65 for (int iAlpha=0; iAlpha < DESCRIPTOR::d; ++iAlpha) {
66 for (int iBeta=0; iBeta < DESCRIPTOR::d; ++iBeta) {
67 const int iPi = util::serialSymmetricTensorIndex<DESCRIPTOR::d>(iAlpha, iBeta);
68 dDdf[jPop] += pi[iPi] * dpidf[iPi] - pi[iPi] * pi[iPi] / rho;
69 }
70 }
71 dDdf[jPop] *= T(2)*util::pow(omega*descriptors::invCs2<T,DESCRIPTOR>()/rho,2)/2.*_converter.getPhysViscosity()/dt/dt;
72 }
73 return true;
74}
75
76
77template <typename T, typename DESCRIPTOR>
80 : SuperLatticePhysF<T,DESCRIPTOR>(sLattice, converter, DESCRIPTOR::q)
81{
82 this->getName() = "dPhysDissipationDf";
83 for (int iC = 0; iC < sLattice.getLoadBalancer().size(); ++iC) {
84 this->_blockF.emplace_back(
86 sLattice.getBlock(iC),
87 sLattice.getOverlap(),
88 converter)
89 );
90 }
91}
92
93
94template <typename T, typename DESCRIPTOR>
96 BlockLattice<T,DESCRIPTOR>& blockLattice,
97 int overlap,
98 const UnitConverter<T,DESCRIPTOR>& converter,
99 int nDim, int extractDim)
100 : BlockLatticeF3D<T,DESCRIPTOR>(blockLattice,DESCRIPTOR::q*DESCRIPTOR::d),
101 _overlap(overlap),
102 _converter(converter),
103 _nDim(nDim), _extractDim(extractDim)
104{
105 this->getName() = "dPhysVelocityDf";
106}
107
108template <typename T, typename DESCRIPTOR>
109bool BlockLatticeDphysVelocityDf3D<T,DESCRIPTOR>::operator()(T dVelocityDf[], const int latticeR[])
110{
111 T rho, u[3];
112 this->_blockLattice.get(latticeR).computeRhoU(rho, u);
113
114 for (int jPop=0; jPop < DESCRIPTOR::q; ++jPop) {
115 for (int iDim=0; iDim < DESCRIPTOR::d; ++iDim) {
116 if (iDim != _extractDim && _extractDim != -1) {
117 dVelocityDf[jPop*DESCRIPTOR::d + iDim] = T(0);
118 }
119 else {
120 dVelocityDf[jPop*DESCRIPTOR::d + iDim] = (descriptors::c<DESCRIPTOR>(jPop,iDim)-u[iDim])/rho * this->_converter.getConversionFactorVelocity();
121 }
122 }
123 }
124 return true;
125}
126
127template <typename T, typename DESCRIPTOR>
130 : SuperLatticePhysF3D<T,DESCRIPTOR>(sLattice, converter, DESCRIPTOR::q)
131{
132 this->getName() = "dPhysVelocityDf";
133 for (int iC = 0; iC < sLattice.getLoadBalancer().size(); ++iC) {
134 this->_blockF.emplace_back(
136 sLattice.getBlock(iC),
137 sLattice.getOverlap(),
138 converter,
139 -1, -1)
140 );
141 }
142}
143
144template <typename T, typename DESCRIPTOR>
147 const UnitConverter<T,DESCRIPTOR>& converter,
149 : SuperLatticePhysF3D<T,DESCRIPTOR>(sLattice, converter, DESCRIPTOR::q)
150{
151 this->getName() = "dPhysVelocityDf";
152 for (int iC = 0; iC < sLattice.getLoadBalancer().size(); ++iC) {
153 this->_blockF.emplace_back(
155 sLattice.getBlock(iC),
156 sLattice.getOverlap(),
157 converter,
158 1, sExtract.getExtractDim())
159 );
160 }
161}
162
163
164template <typename T, typename DESCRIPTOR>
169 FunctorPtr<SuperIndicatorF3D<T>>&& indicatorF)
170 : SuperIdentity3D<T,T>([&]()
171{
172 using namespace functor_dsl;
173
174 auto wantedLatticeF = restrictF(wantedF.toShared(), sLattice);
175 auto differenceF = norm<2>(f.toShared() - wantedLatticeF, indicatorF.toShared());
176
177 return util::pow(differenceF, 2) / T(2.0);
178}())
179{
180 this->getName() = "differenceObjective";
181}
182
183template<typename T, typename DESCRIPTOR>
187 FunctorPtr<SuperIndicatorF3D<T>>&& indicatorF)
189 f->getSuperLattice(),
190 std::static_pointer_cast<SuperF3D<T,T>>(f.toShared()),
191 std::forward<decltype(wantedF)>(wantedF),
192 std::forward<decltype(indicatorF)>(indicatorF))
193{ }
194
195template<typename T, typename DESCRIPTOR>
200 SuperGeometry<T,3>& geometry,
201 int material)
203 sLattice,
204 std::forward<decltype(f)>(f),
205 std::forward<decltype(wantedF)>(wantedF),
206 geometry.getMaterialIndicator(material))
207{ }
208
209
210template <typename T, typename DESCRIPTOR>
212 BlockLattice<T,DESCRIPTOR>& blockLattice,
213 BlockF3D<T>& f,
214 BlockF3D<T>& dFdF,
215 BlockF3D<T>& wantedF,
216 BlockIndicatorF3D<T>& indicatorF,
217 T weight)
218 : BlockLatticeF3D<T,DESCRIPTOR>(blockLattice, f.getTargetDim()),
219 _f(f),
220 _dFdF(dFdF),
221 _wantedF(wantedF),
222 _indicatorF(indicatorF),
223 _weight(weight)
224{
225 this->getName() = "BlockDdifferenceObjectiveDf";
226}
227
228template <typename T, typename DESCRIPTOR>
230{
231 for (int i=0; i < DESCRIPTOR::q; i++) {
232 dJdF[i] = T();
233 }
234
235 if (_indicatorF(latticeR)) {
236 const int nDim = _f.getTargetDim();
237
238 std::vector<T> dJdD(nDim,T());
239
240 T f[nDim];
241 _f(f, latticeR);
242
243 T wantedF[nDim];
244 _wantedF(wantedF, latticeR);
245
246 T dFdF[nDim*DESCRIPTOR::q];
247 _dFdF(dFdF,latticeR);
248
249 for (int iDim=0; iDim<nDim; iDim++) {
250 dJdD[iDim] = (f[iDim] - wantedF[iDim]) * _weight;
251
252 for (int jPop=0; jPop < DESCRIPTOR::q; ++jPop) {
253 dJdF[jPop] += dJdD[iDim] * dFdF[jPop*nDim + iDim];
254 }
255 }
256 }
257
258 return true;
259}
260
261template <typename T, typename DESCRIPTOR>
266 FunctorPtr<SuperIndicatorF3D<T>>&& indicatorF)
267 : SuperLatticeF3D<T,DESCRIPTOR>(f->getSuperLattice(), f->getTargetDim()),
268 _f(std::move(f)),
269 _dFdF(std::move(dFdF)),
270 _wantedF(std::forward<decltype(wantedF)>(wantedF), f->getSuperLattice()),
271 _indicatorF(std::move(indicatorF))
272{
273 this->getName() = "dDifferenceObjectiveDf";
274
275 const T weight = util::pow(_f->getSuperStructure().getCuboidDecomposition().getDeltaR(), 3);
276
277 for (int iC = 0; iC < this->getSuperLattice().getLoadBalancer().size(); ++iC) {
278 this->_blockF.emplace_back(
280 this->getSuperLattice().getBlock(iC),
281 _f->getBlockF(iC),
282 _dFdF->getBlockF(iC),
283 _wantedF.getBlockF(iC),
284 _indicatorF->getBlockIndicatorF(iC),
285 weight)
286 );
287 }
288}
289
290template <typename T, typename DESCRIPTOR>
291bool DdifferenceObjectiveDf3D<T,DESCRIPTOR>::operator()(T dJdF[], const int latticeR[])
292{
293 for (int i=0; i < DESCRIPTOR::q; ++i) {
294 dJdF[i] = T();
295 }
296
297 auto& load = this->getSuperLattice().getLoadBalancer();
298
299 if (load.isLocal(latticeR[0])) {
300 return this->getBlockF(load.loc(latticeR[0]))(dJdF, &latticeR[1]);
301 }
302 else {
303 return true;
304 }
305}
306
307
308template<typename T, typename DESCRIPTOR>
313 FunctorPtr<SuperIndicatorF3D<T>>&& indicatorF)
314 : SuperIdentity3D<T,T>([&]()
315{
316 using namespace functor_dsl;
317
318 auto wantedLatticeF = restrictF(wantedF.toShared(), sLattice);
319 auto relativeDifferenceF = norm<2>(f.toShared() - wantedLatticeF, indicatorF.toShared()) /
320 norm<2>(wantedLatticeF, indicatorF.toShared());
321
322 return pow(relativeDifferenceF, 2) / T(2.0);
323}())
324{
325 this->getName() = "relativeDifferenceObjective";
326}
327
328template<typename T, typename DESCRIPTOR>
332 FunctorPtr<SuperIndicatorF3D<T>>&& indicatorF)
334 f->getSuperLattice(),
335 std::static_pointer_cast<SuperF3D<T,T>>(f.toShared()),
336 std::forward<decltype(wantedF)>(wantedF),
337 std::forward<decltype(indicatorF)>(indicatorF))
338{ }
339
340template<typename T, typename DESCRIPTOR>
345 SuperGeometry<T,3>& geometry,
346 std::vector<int> materials)
348 sLattice,
349 std::forward<decltype(f)>(f),
350 std::forward<decltype(wantedF)>(wantedF),
351 geometry.getMaterialIndicator(materials))
352{ }
353
354template<typename T, typename DESCRIPTOR>
359 SuperGeometry<T,3>& geometry,
360 int material)
362 sLattice,
363 std::forward<decltype(f)>(f),
364 std::forward<decltype(wantedF)>(wantedF),
365 geometry.getMaterialIndicator(material))
366{ }
367
368template<typename T, typename DESCRIPTOR>
372 FunctorPtr<SuperF3D<T,T>>&& wantedF,
373 FunctorPtr<SuperIndicatorF3D<T>>&& indicatorF)
374 : SuperIdentity3D<T,T>([&]()
375{
376 using namespace functor_dsl;
377
378 // auto wantedLatticeF = restrictF(wantedF.toShared(), sLattice);
379 auto relativeDifferenceF = norm<2>(f.toShared() - wantedF.toShared(), indicatorF.toShared()) /
380 norm<2>(wantedF.toShared(), indicatorF.toShared());
381
382 return pow(relativeDifferenceF, 2) / T(2.0);
383}())
384{
385 this->getName() = "relativeDifferenceObjective";
386}
387
388
389template <typename T, typename DESCRIPTOR>
391 BlockStructureD<3>& blockStructure,
392 BlockF3D<T>& f,
393 BlockF3D<T>& dFdF,
394 BlockF3D<T>& wantedF,
395 BlockIndicatorF3D<T>& indicatorF,
396 T globalValue,
397 T weight):
398 BlockF3D<T>(blockStructure, DESCRIPTOR::q),
399 _f(f), _dFdF(dFdF), _wantedF(wantedF), _indicatorF(indicatorF),
400 _globalValue(globalValue), _weight(weight)
401{
402 this->getName() = "BlockDrelativeDifferenceObjectiveDf";
403}
404
405template <typename T, typename DESCRIPTOR>
407{
408 for (int jPop=0; jPop < DESCRIPTOR::q; ++jPop) {
409 dJdF[jPop] = T{};
410 }
411
412 if (_indicatorF(latticeR)) {
413 const int nDim = DESCRIPTOR::d;
414
415 T dJdD[nDim] {};
416
417 T f[nDim] {};
418 _f(f, latticeR);
419
420 T wantedF[nDim] {};
421 _wantedF(wantedF, latticeR);
422
423 T dFdF[nDim*DESCRIPTOR::q] {};
424 _dFdF(dFdF, latticeR);
425
426 for (int iDim=0; iDim < nDim; ++iDim) {
427 dJdD[iDim] = (f[iDim] - wantedF[iDim]) / _globalValue * _weight;
428
429 for (int jPop=0; jPop < DESCRIPTOR::q; ++jPop) {
430 dJdF[jPop] += dJdD[iDim] * dFdF[jPop*nDim + iDim];
431 }
432 }
433 }
434
435 return true;
436}
437
438template <typename T, typename DESCRIPTOR>
443 FunctorPtr<SuperF3D<T,T>>&& wantedF,
444 FunctorPtr<SuperIndicatorF3D<T>>&& indicatorF)
445 : SuperF3D<T,T>(sLattice, DESCRIPTOR::q),
446 _f(std::move(f)),
447 _dFdF(std::move(dFdF)),
448 _wantedF(std::move(wantedF)),
449 _indicatorF(std::move(indicatorF))
450{
451 this->getName() = "dRelativeDifferenceObjectiveDf_Lattice";
452
453 SuperL2Norm3D<T> wantedFlp(*_wantedF, *_indicatorF);
454 T output[1] {};
455 wantedFlp(output, nullptr);
456
457 const T globalValue = util::pow(output[0], 2);
458 const T weight = util::pow(sLattice.getCuboidDecomposition().getDeltaR(), 3);
459 // util::pow(_f->getSuperStructure().getCuboidDecomposition().getDeltaR(), 3);
460
461 for (int iC = 0; iC < sLattice.getLoadBalancer().size(); ++iC) {
462 this->_blockF.emplace_back(
464 sLattice.getBlock(iC),
465 _f->getBlockF(iC),
466 _dFdF->getBlockF(iC),
467 _wantedF->getBlockF(iC),
468 _indicatorF->getBlockIndicatorF(iC),
469 globalValue,
470 weight)
471 );
472 }
473}
474
475template <typename T, typename DESCRIPTOR>
481 FunctorPtr<SuperIndicatorF3D<T>>&& indicatorF)
483 std::forward<decltype(f)>(f),
484 std::forward<decltype(dFdF)>(dFdF),
485 std::unique_ptr<SuperF3D<T,T>>(
486 std::make_unique<SuperLatticeFfromAnalyticalF3D<T,DESCRIPTOR>>(
487 std::forward<decltype(wantedF)>(wantedF), sLattice)),
488 std::forward<decltype(indicatorF)>(indicatorF))
489{ }
490
491template <typename T, typename DESCRIPTOR>
497 SuperGeometry<T,3>& geometry,
498 std::vector<int> materials)
500 std::forward<decltype(f)>(f),
501 std::forward<decltype(dFdF)>(dFdF),
502 std::forward<decltype(wantedF)>(wantedF),
503 geometry.getMaterialIndicator(materials))
504{ }
505
506template <typename T, typename DESCRIPTOR>
512 SuperGeometry<T,3>& geometry,
513 int material)
515 std::forward<decltype(f)>(f),
516 std::forward<decltype(dFdF)>(dFdF),
517 std::forward<decltype(wantedF)>(wantedF),
518 geometry.getMaterialIndicator(material))
519{ }
520
521template <typename T, typename DESCRIPTOR>
523{
524 for (int i=0; i < DESCRIPTOR::q; ++i) {
525 dJdF[i] = T{};
526 }
527
528 auto& load = _f->getSuperStructure().getLoadBalancer();
529
530 if (load.isLocal(latticeR[0])) {
531 return this->getBlockF(load.loc(latticeR[0]))(dJdF, &latticeR[1]);
532 }
533 else {
534 return true;
535 }
536}
537
538
539template <typename T, typename DESCRIPTOR>
541 BlockStructureD<3>& blockStructure,
543 BlockF3D<T>& dFdF,
544 BlockF3D<T>& wantedF,
545 BlockIndicatorF3D<T>& indicatorF,
546 T globalValue,
547 T weight):
548 BlockF3D<T>(blockStructure, DESCRIPTOR::q),
549 _f(f), _dFdF(dFdF), _wantedF(wantedF), _indicatorF(indicatorF),
550 _extractDim(f.getExtractDim()), _globalValue(globalValue), _weight(weight)
551{
552 this->getName() = "BlockDrelativeDifferenceObjectiveComponentDf";
553}
554
555template <typename T, typename DESCRIPTOR>
557{
558 for (int jPop=0; jPop < DESCRIPTOR::q; ++jPop) {
559 dJdF[jPop] = T{};
560 }
561
562 if (_indicatorF(latticeR)) {
563 const int nDim = DESCRIPTOR::d;
564
565 T dJdD[nDim] {};
566
567 T f[1] {};
568 _f(f, latticeR);
569
570 T wantedF[nDim] {};
571 _wantedF(wantedF, latticeR);
572
573 T dFdF[nDim*DESCRIPTOR::q] {};
574 _dFdF(dFdF, latticeR);
575
576 for (int iDim=0; iDim < nDim; ++iDim) {
577 if (iDim == _extractDim) {
578 // Note that by convention wantedF is always one-dimensional.
579 // This is why f[0] - wantedF[0] is correct (as compared to f[0] - wantedF[iDim])
580 dJdD[iDim] = (f[0] - wantedF[0]) / _globalValue * _weight;
581 }
582
583 for (int jPop=0; jPop < DESCRIPTOR::q; ++jPop) {
584 dJdF[jPop] += dJdD[iDim] * dFdF[jPop*nDim + iDim];
585 }
586 }
587 }
588
589 return true;
590}
591
592template <typename T, typename DESCRIPTOR>
595 FunctorPtr<SuperF3D<T,T>>&& f, int extractDim,
598 FunctorPtr<SuperIndicatorF3D<T>>&& indicatorF)
599 : SuperF3D<T,T>(sLattice, DESCRIPTOR::q),
600 _f(std::forward<decltype(f)>(f), extractDim),
601 _dFdF(std::move(dFdF)),
602 _wantedF(std::forward<decltype(wantedF)>(wantedF), sLattice),
603 _indicatorF(std::move(indicatorF))
604{
605 this->getName() = "dRelativeDifferenceObjectiveDf";
606
607 SuperL2Norm3D<T> wantedFlp(_wantedF, *_indicatorF);
608 T output[1] {};
609 wantedFlp(output, nullptr);
610
611 const T globalValue = util::pow(output[0], 2);
612 const T weight = util::pow(_f.getSuperStructure().getCuboidDecomposition().getDeltaR(), 3);
613
614 for (int iC = 0; iC < sLattice.getLoadBalancer().size(); ++iC) {
615 this->_blockF.emplace_back(
617 sLattice.getBlock(iC),
618 static_cast<BlockExtractComponentF3D<T>&>(_f.getBlockF(iC)),
619 _dFdF->getBlockF(iC),
620 _wantedF.getBlockF(iC),
621 _indicatorF->getBlockIndicatorF(iC),
622 globalValue,
623 weight)
624 );
625 }
626}
627
628template <typename T, typename DESCRIPTOR>
630{
631 for (int i=0; i < DESCRIPTOR::q; ++i) {
632 dJdF[i] = T{};
633 }
634
635 auto& load = _f.getSuperStructure().getLoadBalancer();
636
637 if (load.isLocal(latticeR[0])) {
638 return this->getBlockF(load.loc(latticeR[0]))(dJdF, &latticeR[1]);
639 }
640 else {
641 return true;
642 }
643}
644
645} // namespace opti
646
647} // namespace olb
648
649#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
std::string & getName()
Definition genericF.hh:51
functor to extract one component
represents all functors that operate on a SuperStructure<T,3> in general
Definition aliases.h:184
SuperStructure< T, 3 > & getSuperStructure()
BlockF3D< W > & getBlockF(int iCloc)
std::vector< std::unique_ptr< BlockF3D< W > > > _blockF
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
SuperLattice< T, DESCRIPTOR > & getSuperLattice()
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.
BlockLattice< T, DESCRIPTOR > & getBlock(int locC)
Return BlockLattice with local index locC.
Functor that returns the Lp norm over omega of the the euklid norm of the input functor.
int getOverlap()
Read and write access to the overlap.
LoadBalancer< T > & getLoadBalancer()
Read and write access to the load balancer.
CuboidDecomposition< T, D > & getCuboidDecomposition()
Read and write access to cuboid geometry.
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[])
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
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)
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)
SuperLatticeDphysDissipationDf(SuperLattice< T, DESCRIPTOR > &sLattice, const UnitConverter< T, DESCRIPTOR > &converter)
SuperLatticeDphysVelocityDf3D(SuperLattice< T, DESCRIPTOR > &sLattice, const UnitConverter< T, DESCRIPTOR > &converter)
Helper functions for the implementation of LB dynamics.
constexpr T invCs2() any_platform
Definition functions.h:107
constexpr int c(unsigned iPop, unsigned iDim) any_platform
Definition functions.h:83
Expr pow(Expr base, Expr exp)
Definition expr.cpp:235
unsigned serialSymmetricTensorIndex(unsigned i, unsigned j) any_platform
Compute serial index of symmetric tensor.
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
std::string getName(OperatorScope scope)
Returns human-readable name of scope.
constexpr T norm(const ScalarVector< T, D, IMPL > &a) any_platform
Euclidean vector norm.
Optimization Code.
static void dPiDf(CELL &cell, DPIDF &dpidf, int jPop) any_platform
derive stress pi by population component
Compute number of elements of a symmetric d-dimensional tensor.
Definition util.h:216