OpenLB 1.8.1
Loading...
Searching...
No Matches
blockIndicatorF3D.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_3D_H
25#define BLOCK_INDICATOR_F_3D_H
26
27#include <list>
28
31
32namespace olb {
33
35template <typename T>
36class BlockIndicatorFfromIndicatorF3D : public BlockIndicatorF3D<T> {
37protected:
39public:
46 BlockGeometry<T,3>& blockGeometry);
47
48 using BlockIndicatorF3D<T>::operator();
49 bool operator() (bool output[], const int input[]) override;
50
52 Vector<int,3> getMin() override;
54 Vector<int,3> getMax() override;
55};
56
58template <typename T>
60protected:
61 std::function<bool(LatticeR<3>)> _callableF;
62
63public:
64 template <typename F>
66 : BlockIndicatorF3D<T>(blockGeometry)
67 , _callableF(f)
68 { }
69
70 using BlockIndicatorF3D<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,3> getMin() override {
78 return std::numeric_limits<int>::min();
79 }
80 Vector<int,3> getMax() override {
81 return std::numeric_limits<int>::max();
82 }
83};
84
86template <typename T, bool HLBM>
88protected:
90public:
97 BlockGeometry<T,3>& blockGeometry);
98
99 using BlockIndicatorF3D<T>::operator();
100 bool operator() (bool output[], const int input[]) override;
101
103 Vector<int,3> getMin() override;
105 Vector<int,3> getMax() override;
106};
107
108
110template <typename T>
112protected:
113 const std::vector<int> _materials;
114public:
120 std::vector<int> materials);
126 std::list<int> materials);
132 int material);
133
134 using BlockIndicatorF3D<T>::operator();
135 bool operator() (bool output[], const int input[]) override;
136
138 bool isEmpty() override;
140 Vector<int,3> getMin() override;
142 Vector<int,3> getMax() override;
143};
144
146template <typename T, typename DESCRIPTOR, typename FIELD>
148protected:
150 const std::vector<int> _materials;
152 std::string _condition;
153public:
154 BlockIndicatorFieldThreshold3D(BlockGeometry<T,3>& blockGeometry, BlockLattice<T,DESCRIPTOR>& blockLattice, std::vector<int> materials, T thresholdValue, std::string condition);
155
156 using BlockIndicatorF3D<T>::operator();
157 bool operator() (bool output[], const int input[]) override;
159 bool isEmpty() override;
161 Vector<int,3> getMin() override;
163 Vector<int,3> getMax() override;
164};
165
167template <typename T>
169protected:
171
172public:
177
178 using BlockIndicatorF3D<T>::operator();
179 bool operator() (bool output[], const int input[]) override;
180
182 Vector<int,3> getMin() override;
184 Vector<int,3> getMax() override;
185};
186
188template <typename T>
190protected:
192public:
197
198 using BlockIndicatorF3D<T>::operator();
199 bool operator() (bool output[], const int input[]) override;
200
202 Vector<int,3> getMin() override;
204 Vector<int,3> getMax() override;
205};
206
208template <typename T>
210protected:
213public:
219
220 using BlockIndicatorF3D<T>::operator();
221 bool operator() (bool output[], const int input[]) override;
222
224 Vector<int,3> getMin() override;
226 Vector<int,3> getMax() override;
227};
228
230template <typename T>
232protected:
235public:
237
238 using BlockIndicatorF3D<T>::operator();
239 bool operator() (bool output[], const int input[]) override;
240
242 Vector<int,3> getMin() override;
244 Vector<int,3> getMax() override;
245};
246
248template <typename T>
250protected:
253public:
255
256 using BlockIndicatorF3D<T>::operator();
257 bool operator() (bool output[], const int input[]) override;
258
260 Vector<int,3> getMin() override;
262 Vector<int,3> getMax() override;
263};
264
265} // namespace olb
266
267#endif
Representation of a block geometry.
Block indicator identifying neighbors of boundary cells.
Definition aliases.h:224
Vector< int, 3 > getMax() override
Returns max lattice position of the indicated domain's bounding box.
Vector< int, 3 > 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
BlockIndicatorBoundaryNeighbor3D(BlockIndicatorF3D< T > &indicatorF, int overlap)
Base block indicator functor.
Definition aliases.h:204
Block indicator helper for people that don't like writing boilerplate.
Definition aliases.h:367
bool operator()(bool output[], const int input[]) override
has to be implemented for 'every' derived class
Vector< int, 3 > getMax() override
Returns max lattice position of the indicated subset's bounding box.
Vector< int, 3 > getMin() override
Returns min lattice position of the indicated subset's bounding box.
BlockIndicatorFfromCallableF3D(BlockGeometry< T, 3 > &blockGeometry, F &&f)
std::function< bool(LatticeR< 3 >)> _callableF
bool operator()(bool output[], const int input[]) override
has to be implemented for 'every' derived class
Vector< int, 3 > getMax() override
Returns max lattice position of the indicated domain's bounding box.
BlockIndicatorFfromIndicatorF3D(IndicatorF3D< T > &indicatorF, BlockGeometry< T, 3 > &blockGeometry)
Vector< int, 3 > getMin() override
Returns min lattice position of the indicated domain's bounding box.
BlockIndicatorF3D from SmoothIndicatorF3D.
Vector< int, 3 > getMin() override
Returns min lattice position of the indicated domain's bounding box.
SmoothIndicatorF3D< T, T, HLBM > & _indicatorF
BlockIndicatorFfromSmoothIndicatorF3D(SmoothIndicatorF3D< T, T, HLBM > &indicatorF, BlockGeometry< T, 3 > &blockGeometry)
Vector< int, 3 > 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
Block indicator threshold for external field.
Vector< int, 3 > getMin() override
Returns min lattice position of the indicated domain's bounding box.
bool isEmpty() override
Returns true iff indicated domain subset is empty.
BlockIndicatorFieldThreshold3D(BlockGeometry< T, 3 > &blockGeometry, BlockLattice< T, DESCRIPTOR > &blockLattice, std::vector< int > materials, T thresholdValue, std::string condition)
Vector< int, 3 > getMax() override
Returns max lattice position of the indicated domain's bounding box.
BlockLattice< T, DESCRIPTOR > & _blockLattice
bool operator()(bool output[], const int input[]) override
has to be implemented for 'every' derived class
Block indicator identity.
bool operator()(bool output[], const int input[]) override
has to be implemented for 'every' derived class
BlockIndicatorF3D< T > & _indicatorF
Vector< int, 3 > getMax() override
Returns max lattice position of the indicated domain's bounding box.
Vector< int, 3 > getMin() override
Returns min lattice position of the indicated domain's bounding box.
BlockIndicatorIdentity3D(BlockIndicatorF3D< T > &indicatorF)
Block indicator extended by a layer.
Vector< int, 3 > 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
Vector< int, 3 > getMax() override
Returns max lattice position of the indicated domain's bounding box.
BlockIndicatorLayer3D(BlockIndicatorF3D< T > &indicatorF)
BlockIndicatorF3D< T > & _indicatorF
Block indicator functor from material numbers.
Definition aliases.h:214
const std::vector< int > _materials
BlockIndicatorMaterial3D(BlockGeometry< T, 3 > &blockGeometry, std::vector< int > materials)
Vector< int, 3 > getMin() override
Returns min lattice position of the indicated domain's bounding box.
bool isEmpty() override
Returns true iff indicated domain subset is empty.
bool operator()(bool output[], const int input[]) override
has to be implemented for 'every' derived class
Vector< int, 3 > getMax() override
Returns max lattice position of the indicated domain's bounding box.
Block indicator intersection.
Vector< int, 3 > getMax() override
Returns max lattice position of the indicated domain's bounding box.
BlockIndicatorMultiplication3D(BlockIndicatorF3D< T > &f, BlockIndicatorF3D< T > &g)
bool operator()(bool output[], const int input[]) override
has to be implemented for 'every' derived class
Vector< int, 3 > getMin() override
Returns min lattice position of the indicated domain's bounding box.
Block indicator substraction.
Vector< int, 3 > getMax() override
Returns max lattice position of the indicated domain's bounding box.
Vector< int, 3 > getMin() override
Returns min lattice position of the indicated domain's bounding box.
BlockIndicatorSubstraction3D(BlockIndicatorF3D< T > &f, BlockIndicatorF3D< T > &g)
bool operator()(bool output[], const int input[]) override
has to be implemented for 'every' derived class
IndicatorF3D is an application from .
Definition aliases.h:244
Plain old scalar vector.
Top level namespace for all of OpenLB.