OpenLB 1.8.1
Loading...
Searching...
No Matches
blockIndicatorF2D.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2017 Adrian Kummerlaender
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_INDICATOR_F_2D_H
25#define BLOCK_INDICATOR_F_2D_H
26
27#include <list>
28
31
32namespace olb {
33
35template <typename T>
36class BlockIndicatorFfromIndicatorF2D : public BlockIndicatorF2D<T> {
37protected:
39public:
46 BlockGeometry<T,2>& blockGeometry);
47
48 using BlockIndicatorF2D<T>::operator();
49 bool operator() (bool output[], const int input[]) override;
50
52 Vector<int,2> getMin() override;
54 Vector<int,2> getMax() override;
55};
56
58template <typename T>
60protected:
61 std::function<bool(LatticeR<2>)> _callableF;
62
63public:
64 template <typename F>
66 : BlockIndicatorF2D<T>(blockGeometry)
67 , _callableF(f)
68 { }
69
70 using BlockIndicatorF2D<T>::operator();
71
72 bool operator() (bool output[], const int input[]) override {
73 output[0] = _callableF(input);
74 return true;
75 }
76
77 Vector<int,2> getMin() override {
78 return std::numeric_limits<int>::min();
79 }
80 Vector<int,2> getMax() override {
81 return std::numeric_limits<int>::max();
82 }
83};
84
86
90template <typename T, bool HLBM>
92protected:
94public:
101 BlockGeometry<T,2>& blockGeometry);
102
103 using BlockIndicatorF2D<T>::operator();
104 bool operator() (bool output[], const int input[]) override;
105
107 Vector<int,2> getMin() override;
109 Vector<int,2> getMax() override;
110};
111
112
114template <typename T>
116protected:
117 const std::vector<int> _materials;
118public:
124 std::vector<int> materials);
130 std::list<int> materials);
136 int material);
137
138 using BlockIndicatorF2D<T>::operator();
139 bool operator() (bool output[], const int input[]) override;
140
142 bool isEmpty() override;
144 Vector<int,2> getMin() override;
146 Vector<int,2> getMax() override;
147};
148
149
151template <typename T>
153protected:
155public:
160
161 using BlockIndicatorF2D<T>::operator();
162 bool operator() (bool output[], const int input[]) override;
163
165 Vector<int,2> getMin() override;
167 Vector<int,2> getMax() override;
168};
169
171template <typename T>
173protected:
176public:
178
179 using BlockIndicatorF2D<T>::operator();
180 bool operator() (bool output[], const int input[]) override;
181
183 Vector<int,2> getMin() override;
185 Vector<int,2> getMax() override;
186};
187
188} // namespace olb
189
190#endif
Representation of a block geometry.
Block indicator identifying neighbors of boundary cells.
Definition aliases.h:223
Vector< int, 2 > getMax() override
Returns max lattice position of the indicated domain's bounding box.
BlockIndicatorBoundaryNeighbor2D(BlockIndicatorF2D< T > &indicatorF, int overlap)
bool operator()(bool output[], const int input[]) override
has to be implemented for 'every' derived class
Vector< int, 2 > getMin() override
Returns min lattice position of the indicated domain's bounding box.
Base block indicator functor (discrete)
Definition aliases.h:203
Block indicator helper for people that don't like writing boilerplate.
Definition aliases.h:366
BlockIndicatorFfromCallableF2D(BlockGeometry< T, 2 > &blockGeometry, F &&f)
bool operator()(bool output[], const int input[]) override
has to be implemented for 'every' derived class
std::function< bool(LatticeR< 2 >)> _callableF
Vector< int, 2 > getMin() override
Returns min lattice position of the indicated subset's bounding box.
Vector< int, 2 > getMax() override
Returns max lattice position of the indicated subset's bounding box.
Vector< int, 2 > getMax() override
Returns max lattice position of the indicated domain's bounding box.
BlockIndicatorFfromIndicatorF2D(IndicatorF2D< T > &indicatorF, BlockGeometry< T, 2 > &blockGeometry)
Vector< int, 2 > getMin() override
Returns min lattice position of the indicated domain's bounding box.
bool operator()(bool output[], const int input[]) override
has to be implemented for 'every' derived class
BlockIndicatorF2D from SmoothIndicatorF2D.
bool operator()(bool output[], const int input[]) override
has to be implemented for 'every' derived class
Vector< int, 2 > getMin() override
Returns a min lattice position of the indicated domain's bounding box.
SmoothIndicatorF2D< T, T, HLBM > & _indicatorF
Vector< int, 2 > getMax() override
Returns a max lattice position of the indicated domain's bounding box.
BlockIndicatorFfromSmoothIndicatorF2D(SmoothIndicatorF2D< T, T, HLBM > &indicatorF, BlockGeometry< T, 2 > &blockGeometry)
Block indicator identity.
bool operator()(bool output[], const int input[]) override
has to be implemented for 'every' derived class
BlockIndicatorIdentity2D(BlockIndicatorF2D< T > &indicatorF)
BlockIndicatorF2D< T > & _indicatorF
Vector< int, 2 > getMin() override
Returns min lattice position of the indicated domain's bounding box.
Vector< int, 2 > getMax() override
Returns max lattice position of the indicated domain's bounding box.
Block indicator functor from material numbers.
Definition aliases.h:213
Vector< int, 2 > getMax() override
Returns max lattice position of the indicated domain's bounding box.
bool operator()(bool output[], const int input[]) override
has to be implemented for 'every' derived class
bool isEmpty() override
Returns true iff indicated domain subset is empty.
BlockIndicatorMaterial2D(BlockGeometry< T, 2 > &blockGeometry, std::vector< int > materials)
const std::vector< int > _materials
Vector< int, 2 > getMin() override
Returns min lattice position of the indicated domain's bounding box.
IndicatorF2D is an application from .
Definition aliases.h:243
Plain old scalar vector.
Top level namespace for all of OpenLB.