OpenLB 1.7
Loading...
Searching...
No Matches
indicatorBaseF2D.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2014-2016 Cyril Masquelier, Mathias J. Krause, Benjamin Förster
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 INDICATOR_BASE_F_2D_H
25#define INDICATOR_BASE_F_2D_H
26
27#include <functional>
28#include <vector>
29
30#include "core/vector.h"
31#include "functors/genericF.h"
32#include "indicatorBase.h"
33
34namespace olb {
35
36
41template <typename S>
42class IndicatorF1D : public GenericF<bool,S> {
43protected:
47public:
48 using GenericF<bool,S>::operator();
49
50 virtual Vector<S,1>& getMin();
51 virtual Vector<S,1>& getMax();
52
56
58
61 virtual bool operator() (const S input[]);
62};
63
64
69template <typename S>
70class IndicatorF2D : public GenericF<bool,S> {
71protected:
75public:
76 using GenericF<bool,S>::operator();
77
78 virtual Vector<S,2>& getMin();
79 virtual Vector<S,2>& getMax();
80
82
85 virtual bool distance(S& distance, const Vector<S,2>& origin, S precision, const Vector<S,2>& direction);
86 virtual bool distance(S& distance, const Vector<S,2>& origin, const Vector<S,2>& direction, S precision, S pitch);
87 virtual bool distance(S& distance, const Vector<S,2>& origin, const Vector<S,2>& direction, int iC=-1);
88 virtual bool distance(S& distance, const Vector<S,2>& origin);
89 virtual bool distance(S& distance, const S input[]);
91
94 virtual bool normal(Vector<S,2>& normal, const Vector<S,2>& origin, const Vector<S,2>& direction, int iC=-1);
96 virtual bool operator() (bool output[1], const S input[2]);
98 virtual S signedDistance(const Vector<S,2>& input);
100 virtual Vector<S,2> surfaceNormal(const Vector<S,2>& pos, const S meshSize);
102 Vector<S,2> surfaceNormal(const Vector<S,2>& pos, const S meshSize,
103 std::function<Vector<S,2>(const Vector<S,2>&)> transformPos);
105 bool isInsideBox(Vector<S,2> point);
106
108
111 virtual bool operator() (const S input[]);
112};
113
114
116template <typename S>
118public:
119 std::shared_ptr<IndicatorF2D<S>> _f;
120
121 IndicatorIdentity2D(std::shared_ptr<IndicatorF2D<S>> f);
122 bool operator() (bool output[1], const S input[2]);
123};
124
125
126}
127
128#endif
GenericF is a base class, that can represent continuous as well as discrete functions.
Definition genericF.h:50
IndicatorF1D is an application from .
IndicatorF1D< S > & operator-(IndicatorF1D< S > &rhs)
Vector< S, 1 > _myMin
IndicatorF1D< S > & operator*(IndicatorF1D< S > &rhs)
virtual bool operator()(const S input[])
Indicator specific function operator overload.
Vector< S, 1 > _myMax
virtual Vector< S, 1 > & getMin()
virtual Vector< S, 1 > & getMax()
IndicatorF1D< S > & operator+(IndicatorF1D< S > &rhs)
IndicatorF2D is an application from .
virtual bool distance(S &distance, const Vector< S, 2 > &origin, S precision, const Vector< S, 2 > &direction)
returns false or true and pos. distance if there was one found for an given origin and direction
Vector< S, 2 > _myMin
Vector< S, 2 > _myMax
virtual Vector< S, 2 > surfaceNormal(const Vector< S, 2 > &pos, const S meshSize)
Return surface normal.
virtual Vector< S, 2 > & getMin()
virtual bool operator()(bool output[1], const S input[2])
Returns true if input is inside the indicator.
virtual bool normal(Vector< S, 2 > &normal, const Vector< S, 2 > &origin, const Vector< S, 2 > &direction, int iC=-1)
returns true and the normal if there was one found for an given origin and direction
virtual Vector< S, 2 > & getMax()
virtual S signedDistance(const Vector< S, 2 > &input)
Returns signed distance to the nearest point on the indicator surface.
bool isInsideBox(Vector< S, 2 > point)
Returns true if point is inside a cube with corners _myMin and _myMax
IndicatorIdentity2D(std::shared_ptr< IndicatorF2D< S > > f)
bool operator()(bool output[1], const S input[2])
Returns true if input is inside the indicator.
std::shared_ptr< IndicatorF2D< S > > _f
Plain old scalar vector.
Definition vector.h:47
The description of a generic interface for all functor classes – header file.
Top level namespace for all of OpenLB.
efficient implementation of a vector class