OpenLB 1.7
Loading...
Searching...
No Matches
blockBaseF2D.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_2D_H
25#define BLOCK_BASE_F_2D_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 <fstream>
33#include <memory>
34
35/* Note: Throughout the whole source code directory genericFunctions, the
36 * template parameters for i/o dimensions are:
37 * F: S^m -> T^n (S=source, T=target)
38 */
39
40namespace olb {
41
42template <typename T> class BlockIndicatorF2D;
43
44
46template <typename T>
47class BlockF2D : public GenericF<T,int> {
48protected:
49 BlockF2D(BlockStructureD<2>& blockStructure, int targetDim);
50 BlockF2D(int targetDim); //added from old
52public:
54 //~BlockF2D() override {};
55 virtual BlockStructureD<2>& getBlockStructure(); // const;
56 void setBlockStructure(BlockStructureD<2>* blockStructure);
57
58 using GenericF<T,int>::operator();
59
64};
65
67template <typename T, typename BaseType>
68class BlockDataF2D : public BlockF2D<BaseType> {
69protected:
70 BlockDataF2D(int nx, int ny, int size=1);
72 bool _owning;
73public:
82 bool operator() (BaseType output[], const int input[]) override;
83};
84
86template <typename T>
87class BlockIdentity2D final : public BlockF2D<T> {
88protected:
90public:
92 // access operator should not delete f, since f still has the identity as child
93 bool operator() (T output[], const int input[]) override;
94};
95
97template <typename T>
99protected:
102public:
103 BlockExtractComponentF2D(BlockF2D<T>& f, int extractDim);
104 int getExtractDim();
105 bool operator() (T output[], const int input[]);
106};
107
109template <typename T>
111protected:
113public:
115 BlockIndicatorF2D<T>& indicatorF);
116 bool operator() (T output[], const int input[]) override;
117};
118
120template <typename T>
122protected:
125public:
127 BlockIndicatorF2D<T>& indicatorF);
128 bool operator() (T output[], const int input[]);
129};
130
132template <typename T, typename DESCRIPTOR>
133class BlockLatticeF2D : public BlockF2D<T> {
134protected:
135 BlockLatticeF2D(BlockLattice<T,DESCRIPTOR>& blockLattice, int targetDim);
137public:
139 //BlockLatticeF2D(BlockLatticeF2D<T,DESCRIPTOR> const& rhs);
141 //BlockLatticeF2D<T,DESCRIPTOR>& operator=(BlockLatticeF2D<T,DESCRIPTOR> const& rhs);
142
144};
145
146
148template <typename T, typename DESCRIPTOR>
149class BlockLatticeIdentity2D final : public BlockLatticeF2D<T,DESCRIPTOR> {
150protected:
152public:
154 bool operator() (T output[], const int input[]) override;
155};
156
157
159template <typename T, typename DESCRIPTOR>
160class BlockLatticePhysF2D : public BlockLatticeF2D<T,DESCRIPTOR> {
161protected:
164 const UnitConverter<T,DESCRIPTOR>& converter, int targetDim);
165public:
167 //BlockLatticePhysF2D(BlockLatticePhysF2D<T,DESCRIPTOR> const& rhs);
169 //BlockLatticePhysF2D<T,DESCRIPTOR>& operator=(BlockLatticePhysF2D<T,DESCRIPTOR> const& rhs);
170};
171
173template <typename T, typename DESCRIPTOR, typename TDESCRIPTOR>
180
181
182} // end namespace olb
183
184#endif
BlockDataF2D can store data of any BlockFunctor2D.
bool operator()(BaseType output[], const int input[]) override
access to _blockData via its get()
BlockData< 2, T, BaseType > & getBlockData()
returns _blockData
BlockDataF2D(int nx, int ny, int size=1)
BlockData< 2, T, BaseType > * _blockData
functor to extract one component
bool operator()(T output[], const int input[])
has to be implemented for 'every' derived class
BlockExtractComponentF2D(BlockF2D< T > &f, int extractDim)
functor to extract one component inside an indicator
BlockIndicatorF2D< T > & _indicatorF
BlockExtractComponentIndicatorF2D(BlockF2D< T > &f, int extractDim, BlockIndicatorF2D< T > &indicatorF)
bool operator()(T output[], const int input[]) override
has to be implemented for 'every' derived class
functor to extract data inside an indicator
bool operator()(T output[], const int input[])
has to be implemented for 'every' derived class
BlockIndicatorF2D< T > & _indicatorF
BlockExtractIndicatorF2D(BlockF2D< T > &f, BlockIndicatorF2D< T > &indicatorF)
represents all functors that operate on a cuboid in general, mother class of BlockLatticeF,...
virtual BlockStructureD< 2 > & getBlockStructure()
virtual destructor for defined behaviour
BlockF2D< T > & operator+(BlockF2D< T > &rhs)
BlockF2D< T > & operator*(BlockF2D< T > &rhs)
BlockF2D< T > & operator-(BlockF2D< T > &rhs)
BlockF2D(BlockStructureD< 2 > &blockStructure, int targetDim)
void setBlockStructure(BlockStructureD< 2 > *blockStructure)
BlockF2D< T > & operator/(BlockF2D< T > &rhs)
BlockStructureD< 2 > * _blockStructure
identity functor
BlockF2D< T > & _f
bool operator()(T output[], const int input[]) override
has to be implemented for 'every' derived class
BlockIdentity2D(BlockF2D< T > &f)
Base block indicator functor (discrete)
represents all functors that operate on a DESCRIPTOR in general, e.g. getVelocity(),...
BlockLattice< T, DESCRIPTOR > & _blockLattice
BlockLattice< T, DESCRIPTOR > & getBlock()
Copy Constructor.
BlockLatticeF2D(BlockLattice< T, DESCRIPTOR > &blockLattice, int targetDim)
bool operator()(T output[], const int input[]) override
has to be implemented for 'every' derived class
BlockLatticeF2D< T, DESCRIPTOR > & _f
BlockLatticeIdentity2D(BlockLatticeF2D< T, DESCRIPTOR > &f)
represents all functors that operate on a DESCRIPTOR with output in Phys, e.g. physVelocity(),...
const UnitConverter< T, DESCRIPTOR > & _converter
BlockLatticePhysF2D(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....
BlockLatticeThermalPhysF2D(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.
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.