OpenLB 1.7
Loading...
Searching...
No Matches
blockBaseF3D.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2012 Lukas Baron, Mathias J. Krause, Albert Mink
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 BLOCK_BASE_F_3D_H
25#define BLOCK_BASE_F_3D_H
26
27#include "functors/genericF.h"
28#include "core/blockData.h"
29#include "core/blockStructure.h"
30#include "core/unitConverter.h"
31
32#include <memory>
33
34/* Note: Throughout the whole source code directory genericFunctions, the
35 * template parameters for i/o dimensions are:
36 * F: S^m -> T^n (S=source, T=target)
37 */
38
39namespace olb {
40
41
42template <typename T> class BlockIndicatorF3D;
43
45template <typename T>
46class BlockF3D : public GenericF<T,int> {
47protected:
48 BlockF3D(BlockStructureD<3>& blockStructure, int targetDim);
50public:
52 ~BlockF3D() override {};
54
55 using GenericF<T,int>::operator();
56
61};
62
64template <typename T, typename BaseType>
65class BlockDataF3D : public BlockF3D<BaseType> {
66protected:
67 BlockDataF3D(int nx, int ny, int nz, int size=1);
68
69 std::unique_ptr<BlockData<3,T,BaseType>> _blockDataStorage;
71public:
79 bool operator() (BaseType output[], const int input[]) override;
80};
81
83template <typename T>
84class BlockIdentity3D final : public BlockF3D<T> {
85protected:
87public:
89 // access operator should not delete f, since f still has the identity as child
90 bool operator() (T output[], const int input[]) override;
91};
92
94template <typename T>
96protected:
99public:
100 BlockExtractComponentF3D(BlockF3D<T>& f, int extractDim);
101 int getExtractDim();
102 bool operator() (T output[], const int input[]);
103};
104
106template <typename T>
108protected:
110public:
112 BlockIndicatorF3D<T>& indicatorF);
113 bool operator() (T output[], const int input[]) override;
114};
115
117template <typename T>
119protected:
122public:
124 BlockIndicatorF3D<T>& indicatorF);
125 bool operator() (T output[], const int input[]);
126};
127
129// user has to guarantee that cast is well-defined
130template <typename T, typename T2>
131class BlockTypecastF3D : public BlockF3D<T> {
132protected:
134public:
136 bool operator() (T output[], const int input[]);
137};
138
140template <typename T, typename DESCRIPTOR>
141class BlockLatticeF3D : public BlockF3D<T> {
142protected:
143 BlockLatticeF3D(BlockLattice<T,DESCRIPTOR>& blockLattice, int targetDim);
145public:
147 //BlockLatticeF3D(BlockLatticeF3D<T,DESCRIPTOR> const& rhs);
149 //BlockLatticeF3D<T,DESCRIPTOR>& operator=(BlockLatticeF3D<T,DESCRIPTOR> const& rhs);
150
152};
153
154
156template <typename T, typename DESCRIPTOR>
157class BlockLatticeIdentity3D final : public BlockLatticeF3D<T,DESCRIPTOR> {
158protected:
160public:
162 bool operator() (T output[], const int input[]) override;
163};
164
165
167template <typename T, typename DESCRIPTOR>
168class BlockLatticePhysF3D : public BlockLatticeF3D<T,DESCRIPTOR> {
169protected:
172 const UnitConverter<T,DESCRIPTOR>& converter, int targetDim);
173public:
175 //BlockLatticePhysF3D(BlockLatticePhysF3D<T,DESCRIPTOR> const& rhs);
177 //BlockLatticePhysF3D<T,DESCRIPTOR>& operator=(BlockLatticePhysF3D<T,DESCRIPTOR> const& rhs);
178};
179
181template <typename T, typename DESCRIPTOR, typename TDESCRIPTOR>
188
189
190} // end namespace olb
191
192#endif
BlockDataF3D can store data of any BlockFunctor3D.
bool operator()(BaseType output[], const int input[]) override
access to _blockData via its get()
BlockData< 3, T, BaseType > & getBlockData()
returns _blockData
BlockData< 3, T, BaseType > & _blockData
std::unique_ptr< BlockData< 3, T, BaseType > > _blockDataStorage
BlockDataF3D(int nx, int ny, int nz, int size=1)
functor to extract one component
bool operator()(T output[], const int input[])
has to be implemented for 'every' derived class
BlockExtractComponentF3D(BlockF3D< T > &f, int extractDim)
functor to extract one component inside an indicator
BlockExtractComponentIndicatorF3D(BlockF3D< T > &f, int extractDim, BlockIndicatorF3D< T > &indicatorF)
bool operator()(T output[], const int input[]) override
has to be implemented for 'every' derived class
BlockIndicatorF3D< T > & _indicatorF
functor to extract data inside an indicator
BlockExtractIndicatorF3D(BlockF3D< T > &f, BlockIndicatorF3D< T > &indicatorF)
bool operator()(T output[], const int input[])
has to be implemented for 'every' derived class
BlockIndicatorF3D< T > & _indicatorF
represents all functors that operate on a cuboid in general, mother class of BlockLatticeF,...
BlockF3D< T > & operator-(BlockF3D< T > &rhs)
BlockF3D< T > & operator+(BlockF3D< T > &rhs)
BlockF3D< T > & operator/(BlockF3D< T > &rhs)
BlockF3D(BlockStructureD< 3 > &blockStructure, int targetDim)
BlockStructureD< 3 > & _blockStructure
virtual BlockStructureD< 3 > & getBlockStructure() const
~BlockF3D() override
virtual destructor for defined behaviour
BlockF3D< T > & operator*(BlockF3D< T > &rhs)
identity functor
BlockIdentity3D(BlockF3D< T > &f)
BlockF3D< T > & _f
bool operator()(T output[], const int input[]) override
has to be implemented for 'every' derived class
Base block indicator functor.
represents all functors that operate on a DESCRIPTOR in general, e.g. getVelocity(),...
BlockLattice< T, DESCRIPTOR > & getBlock()
Copy Constructor.
BlockLatticeF3D(BlockLattice< T, DESCRIPTOR > &blockLattice, int targetDim)
BlockLattice< T, DESCRIPTOR > & _blockLattice
bool operator()(T output[], const int input[]) override
has to be implemented for 'every' derived class
BlockLatticeF3D< T, DESCRIPTOR > & _f
BlockLatticeIdentity3D(BlockLatticeF3D< T, DESCRIPTOR > &f)
represents all functors that operate on a DESCRIPTOR with output in Phys, e.g. physVelocity(),...
const UnitConverter< T, DESCRIPTOR > & _converter
BlockLatticePhysF3D(BlockLattice< T, DESCRIPTOR > &blockLattice, const UnitConverter< T, DESCRIPTOR > &converter, int targetDim)
represents all thermal functors that operate on a DESCRIPTOR with output in Phys, e....
BlockLatticeThermalPhysF3D(BlockLattice< T, TDESCRIPTOR > &blockLattice, const ThermalUnitConverter< T, DESCRIPTOR, TDESCRIPTOR > &converter, int targetDim)
const ThermalUnitConverter< T, DESCRIPTOR, TDESCRIPTOR > & _converter
Platform-abstracted block lattice for external access and inter-block interaction.
Base of a regular block.
perform explicit typecast from output type T2 to T
BlockF3D< T2 > & _f
BlockTypecastF3D(BlockF3D< T2 > &f)
bool operator()(T output[], const int input[])
has to be implemented for 'every' derived class
GenericF is a base class, that can represent continuous as well as discrete functions.
Definition genericF.h:50
Conversion between physical and lattice units, as well as discretization specialized for thermal appl...
Conversion between physical and lattice units, as well as discretization.
The description of a generic interface for all functor classes – header file.
Top level namespace for all of OpenLB.
typename util::BaseTypeHelper< T >::type BaseType
Definition baseType.h:59
Unit conversion handling – header file.