OpenLB 1.7
Loading...
Searching...
No Matches
blockIndicatorBaseF2D.hh
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_BASE_F_2D_HH
25#define BLOCK_INDICATOR_BASE_F_2D_HH
26
29
30namespace olb {
31
32template <typename T>
34 : BlockF2D<bool>(geometry, 1),
35 _blockGeometryStructure(geometry),
36 _cachedData{nullptr}
37{ }
38
39template <typename T>
41{
42 return _blockGeometryStructure;
43}
44
45template <typename T>
46bool BlockIndicatorF2D<T>::operator() (const int input[])
47{
48 bool output{};
49 if (_cachedData == nullptr) {
50 this->operator()(&output, input);
51 }
52 else {
53 _cachedData->get(input);
54 }
55 return output;
56}
57
58template <typename T>
60{
61 int latticeR[2] { iX, iY };
62 return this->operator()(latticeR);
63}
64
65template <typename T>
67{
68 return operator()(loc[0], loc[1]);
69}
70
71template <typename T>
73{
74 _cachedData = &cache;
75}
76
77template <typename T>
79{
80 // There is no way to determine domain emptyness in a fashion that is both
81 // generic and efficient.
82 return false;
83}
84
85} // namespace olb
86
87#endif
Representation of the 2D block geometry view – header file.
represents all functors that operate on a cuboid in general, mother class of BlockLatticeF,...
Representation of a block geometry.
bool operator()(const int input[])
Block indicator specific function operator overload.
BlockGeometry< T, 2 > & getBlockGeometry()
Get underlying block geometry structure.
void setCache(const BlockData< 2, T, bool > &cache)
Set bool-mask cache to be used by indicator operator overloads.
virtual bool isEmpty()
Returns true only if the indicated domain subset is empty.
BlockIndicatorF2D(BlockGeometry< T, 2 > &geometry)
Plain old scalar vector.
Definition vector.h:47
Top level namespace for all of OpenLB.