OpenLB 1.7
Loading...
Searching...
No Matches
latticeDerivatives3D.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2013-2015 Patrick Nathen, 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 LATTICE_DERIVATIVES_3D_H
25#define LATTICE_DERIVATIVES_3D_H
26
27#include <list>
28
29#include "blockBaseF3D.h"
30#include "superBaseF3D.h"
31#include "core/unitConverter.h"
33
34
35namespace olb {
36
39template <typename T>
41private:
42 BlockGeometry<T,3>& _blockGeometry;
43 BlockF3D<T>& _blockFunctor;
44 std::list<int>& _matNumber;
45 int _targetDim;
46 int _n[3];
47public:
49 BlockF3D<T>& blockFunctor,
50 std::list<int>& matNumber);
51 bool operator() (T output[], const int input[]) override;
52};
53
56template <typename T>
58private:
59 SuperGeometry<T,3>& _sGeometry;
60 SuperF3D<T>& _sFunctor;
61 std::list<int>& _matNumber;
62public:
64 SuperF3D<T>& sFunctor,
65 std::list<int>& matNumber);
66};
67
68template <typename T, typename DESCRIPTOR>
70private:
71 BlockF3D<T>& _blockFinDiff;
72 int _targetDim;
73 const UnitConverter<T,DESCRIPTOR>& _converter;
74public:
76 const UnitConverter<T,DESCRIPTOR>& converter);
77 bool operator() (T output[], const int input[]) override;
78};
79
82template <typename T, typename DESCRIPTOR>
84private:
86 const UnitConverter<T,DESCRIPTOR>& _converter;
87public:
89 SuperF3D<T>& sFunctor,
90 std::list<int>& matNumber,
91 const UnitConverter<T,DESCRIPTOR>& converter);
92};
93
94
96// for each component of given functor
97// uses second order scheme (first order at the boundaries)
98template <typename T>
99class BlockLaplacian3D : public BlockF3D<T> {
100private:
101 BlockGeometry<T,3>& _blockGeometry;
102 BlockF3D<T>& _blockFunctor;
103 int _n[3];
104 bool _forthOrder;
105public:
107 BlockF3D<T>& blockFunctor,
108 bool forthOrder);
109 bool operator() (T output[], const int input[]) override;
110};
111
113template <typename T>
114class SuperLaplacian3D : public SuperF3D<T> {
115private:
116 SuperGeometry<T,3>& _sGeometry;
117 SuperF3D<T>& _sFunctor;
118public:
120 SuperF3D<T>& sFunctor,
121 bool forthOrder=true);
122};
123
125// scaled with h^-2
126template <typename T, typename DESCRIPTOR>
128private:
129 BlockF3D<T>& _blockLaplacian;
130 const UnitConverter<T,DESCRIPTOR>& _converter;
131 const T _factor;
132public:
133 BlockPhysLaplacian3D(BlockF3D<T>& blockFunctor,
134 const UnitConverter<T,DESCRIPTOR>& converter,
135 bool forthOrder);
136 bool operator() (T output[], const int input[]) override;
137};
138
140// scaled with h^-2
141template <typename T, typename DESCRIPTOR>
143private:
144 SuperLaplacian3D<T> _laplacian;
145 const UnitConverter<T,DESCRIPTOR>& _converter;
146public:
148 SuperF3D<T>& sFunctor,
149 const UnitConverter<T,DESCRIPTOR>& converter,
150 bool forthOrder=true);
151};
152
153} // end namespace olb
154
155#endif
represents all functors that operate on a cuboid in general, mother class of BlockLatticeF,...
functor to get pointwise finite difference Dissipation on local lattice, if globIC is not on the loca...
BlockFiniteDifference3D(BlockGeometry< T, 3 > &blockGeometry, BlockF3D< T > &blockFunctor, std::list< int > &matNumber)
bool operator()(T output[], const int input[]) override
has to be implemented for 'every' derived class
Representation of a block geometry.
functor to get pointwise finite difference Laplacian operator
BlockLaplacian3D(BlockGeometry< T, 3 > &blockGeometry, BlockF3D< T > &blockFunctor, bool forthOrder)
bool operator()(T output[], const int input[]) override
has to be implemented for 'every' derived class
BlockPhysFiniteDifference3D(BlockF3D< T > &blockFunctor, const UnitConverter< T, DESCRIPTOR > &converter)
bool operator()(T output[], const int input[]) override
has to be implemented for 'every' derived class
functor to get pointwise finite difference Laplacian operator
BlockPhysLaplacian3D(BlockF3D< T > &blockFunctor, const UnitConverter< T, DESCRIPTOR > &converter, bool forthOrder)
bool operator()(T output[], const int input[]) override
has to be implemented for 'every' derived class
represents all functors that operate on a SuperStructure<T,3> in general
functor to get pointwise explicit filter on local lattice, if globIC is not on the local processor,...
SuperFiniteDifference3D(SuperGeometry< T, 3 > &sGeometry, SuperF3D< T > &sFunctor, std::list< int > &matNumber)
Representation of a statistic for a parallel 2D geometry.
functor to get pointwise finite difference Laplacian operator
SuperLaplacian3D(SuperGeometry< T, 3 > &sGeometry, SuperF3D< T > &sFunctor, bool forthOrder=true)
functor to get pointwise explicit filter on local lattice, if globIC is not on the local processor,...
SuperPhysFiniteDifference3D(SuperGeometry< T, 3 > &sGeometry, SuperF3D< T > &sFunctor, std::list< int > &matNumber, const UnitConverter< T, DESCRIPTOR > &converter)
functor to get pointwise finite difference Laplacian operator
SuperPhysLaplacian3D(SuperGeometry< T, 3 > &sGeometry, SuperF3D< T > &sFunctor, const UnitConverter< T, DESCRIPTOR > &converter, bool forthOrder=true)
Conversion between physical and lattice units, as well as discretization.
Top level namespace for all of OpenLB.
Unit conversion handling – header file.