OpenLB 1.7
Loading...
Searching...
No Matches
smoothIndicatorBaseF2D.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 SMOOTH_INDICATOR_BASE_F_2D_H
25#define SMOOTH_INDICATOR_BASE_F_2D_H
26
27#include <vector>
28
29#include "core/vector.h"
30#include "core/blockStructure.h"
31#include "functors/genericF.h"
33
34namespace olb {
35
36template <typename T, typename S, bool PARTICLE=false>
38
45template <typename T, typename S>
46class SmoothIndicatorF2D<T,S,false> : public AnalyticalF2D<T,S> {
47protected:
52 Vector<S,4> _rotMat; //saved values of rotation matrix
56 std::string _name = "smoothIndicator2D";
57public:
58 void init();
59 const Vector<S,2>& getMin() const;
60 const Vector<S,2>& getMax() const;
61 const Vector<S,2>& getPos() const;
62 const Vector<S,4>& getRotationMatrix() const;
63 const S& getCircumRadius() const;
64 const S& getTheta() const;
65 const S& getEpsilon() const;
66 std::string name();
67 void setPos(Vector<S,2> pos);
68 void setTheta(S theta);
69 void setEpsilon(S epsilon);
70 virtual S getArea();
71 virtual Vector<S,2> calcMofiAndMass(S density);
72 virtual Vector<S,2> surfaceNormal(const Vector<S,2>& pos, const S meshSize);
73 virtual Vector<S,2> surfaceNormal(const Vector<S,2>& pos, const S meshSize,
74 std::function<Vector<S,2>(const Vector<S,2>&)> transformPos);
75 virtual const S signedDistance(const PhysR<T,2> input);
76 virtual bool distance(S& distance, const Vector<S,2>& origin, const Vector<S,2>& direction, S precision, S pitch);
77 virtual bool operator()(T output[], const S input[]);
78 bool isInsideCircumRadius(const PhysR<S,2>& input);
79
81};
82
83
84template <typename T, typename S>
86protected:
88public:
90 bool operator() (T output[], const S input[]) override;
91};
92
96template <typename T, typename S>
97class SmoothIndicatorF2D<T,S,true> : public AnalyticalF2D<T,S> {
98protected:
102 std::string _name = "2D-Particle surface";
103
104public:
105 const S& getCircumRadius() const;
106 const S& getEpsilon() const;
107 std::string name();
108 void setEpsilon(S epsilon);
109 virtual S getArea();
110 virtual Vector<S,2> calcMofiAndMass(S density);
111 virtual Vector<S,2> surfaceNormal(const Vector<S,2>& pos, const S meshSize);
112 virtual Vector<S,2> surfaceNormal(const Vector<S,2>& pos, const S meshSize,
113 std::function<Vector<S,2>(const Vector<S,2>&)> transformPos);
114 virtual const S signedDistance(const PhysR<T,2> input);
115 virtual bool distance(S& distance, const Vector<S,2>& origin, const Vector<S,2>& direction, S precision, S pitch);
116 virtual bool operator()(T output[], const S input[]);
117 bool isInsideCircumRadius(const PhysR<S,2>& input);
118};
119
120}
121
122#endif
AnalyticalF are applications from DD to XD, where X is set by the constructor.
SmoothIndicatorF2D< T, S, false > & operator+(SmoothIndicatorF2D< T, S, false > &rhs)
SmoothIndicatorIdentity2D(SmoothIndicatorF2D< T, S, false > &f)
SmoothIndicatorF2D< T, S, false > & _f
bool operator()(T output[], const S input[]) override
has to be implemented for 'every' derived class
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