OpenLB 1.7
Loading...
Searching...
No Matches
smoothIndicatorBaseF3D.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, Albert Mink, 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_3D_H
25#define SMOOTH_INDICATOR_BASE_F_3D_H
26
27#include <vector>
28
29#include "core/vector.h"
30#include "core/blockStructure.h"
32#include "functors/genericF.h"
33
34namespace olb {
35
36
37template <typename T, typename S, bool PARTICLE=false>
39
46template <typename T, typename S>
47class SmoothIndicatorF3D<T,S,false> : public AnalyticalF3D<T,S> {
48protected:
50 //~SmoothIndicatorF3D() override {};
54 Vector<S,9> _rotMat; //saved values of rotation matrix
57 //Vector<S,3> _scale;
59 std::string _name = "smoothIndicator3D";
60public:
61 void init();
62 const Vector<S,3>& getMin() const;
63 const Vector<S,3>& getMax() const;
64 const Vector<S,3>& getPos() const;
65 const Vector<S,9>& getRotationMatrix() const;
66 const Vector<S,3>& getTheta() const;
67 const S& getCircumRadius() const;
68 const S& getEpsilon() const;
69 std::string name();
70 void setPos(Vector<S,3> pos);
71 void setTheta(Vector<S,3> theta); //set angle in radian
72 void setEpsilon(S epsilon);
73 virtual S getVolume( );
74 virtual Vector<S,4> calcMofiAndMass(S density);
75 virtual Vector<S,3> calcCenterOfMass();
76 virtual Vector<S,3> surfaceNormal(const Vector<S,3>& pos, const S meshSize);
77 virtual Vector<S,3> surfaceNormal(const Vector<S,3>& pos, const S meshSize,
78 std::function<Vector<S,3>(const Vector<S,3>&)> transformPos);
79 virtual const S signedDistance(const PhysR<T,3> input);
80 virtual bool distance(S& distance, const Vector<S,3>& origin, const Vector<S,3>& direction, S precision, S pitch);
81 virtual bool operator()(T output[], const S input[]);
82 bool isInsideCircumRadius(const PhysR<S,3>& input);
83
85};
86
87
88template <typename T, typename S>
89class SmoothIndicatorIdentity3D : public SmoothIndicatorF3D<T, S, false> {
90protected:
92public:
94 bool operator() (T output[], const S input[]) override;
95};
96
100template <typename T, typename S>
101class SmoothIndicatorF3D<T, S, true> : public AnalyticalF3D<T,S> {
102protected:
106 std::string _name="3D-Particle surface";
107
108public:
109 const S& getCircumRadius() const;
110 const S& getEpsilon() const;
111 std::string name();
112 void setEpsilon(S epsilon);
113 virtual S getVolume( );
114 virtual Vector<S,4> calcMofiAndMass(S density);
115 virtual Vector<S,3> calcCenterOfMass();
116 virtual Vector<S,3> surfaceNormal(const Vector<S,3>& pos, const S meshSize);
117 virtual Vector<S,3> surfaceNormal(const Vector<S,3>& pos, const S meshSize,
118 std::function<Vector<S,3>(const Vector<S,3>&)> transformPos);
119 virtual const S signedDistance(const PhysR<T,3> input);
120 virtual bool distance(S& distance, const Vector<S,3>& origin, const Vector<S,3>& direction, S precision, S pitch);
121 virtual bool operator()(T output[], const S input[]);
122 bool isInsideCircumRadius(const PhysR<S,3>& input);
123};
124
125}
126
127#endif
AnalyticalF are applications from DD to XD, where X is set by the constructor.
SmoothIndicatorF3D< T, S, false > & operator+(SmoothIndicatorF3D< T, S, false > &rhs)
bool operator()(T output[], const S input[]) override
has to be implemented for 'every' derived class
SmoothIndicatorF3D< T, S, false > & _f
SmoothIndicatorIdentity3D(SmoothIndicatorF3D< T, S, false > &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