ASL
0.1.7
Advanced Simulation Library
Toggle main menu visibility
Loading...
Searching...
No Matches
src
math
aslDistanceFunction.h
Go to the documentation of this file.
1
/*
2
* Advanced Simulation Library <http://asl.org.il>
3
*
4
* Copyright 2015 Avtech Scientific <http://avtechscientific.com>
5
*
6
*
7
* This file is part of Advanced Simulation Library (ASL).
8
*
9
* ASL is free software: you can redistribute it and/or modify it
10
* under the terms of the GNU Affero General Public License as
11
* published by the Free Software Foundation, version 3 of the License.
12
*
13
* ASL 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 Affero General Public License for more details.
17
*
18
* You should have received a copy of the GNU Affero General Public License
19
* along with ASL. If not, see <http://www.gnu.org/licenses/>.
20
*
21
*/
22
23
24
#ifndef ASLDISTANCEFUNCTION_H
25
#define ASLDISTANCEFUNCTION_H
26
27
#include <
acl/aclMath/aclVectorOfElementsDef.h
>
28
#include <
aslUtilities.h
>
29
30
namespace
acl
31
{
32
class
KernelConfiguration
;
33
}
34
35
namespace
asl
{
36
37
template
<
typename
T>
class
AVec
;
38
class
Block
;
39
40
class
AbstractDataWithGhostNodes
;
41
typedef
std::shared_ptr<AbstractDataWithGhostNodes>
SPAbstractDataWithGhostNodes
;
42
45
48
class
DistanceFunction
49
{
50
protected
:
51
DistanceFunction
();
52
public
:
53
virtual
~DistanceFunction
();
54
virtual
acl::VectorOfElements
getDistance
(
const
acl::VectorOfElements
& pos)=0;
55
};
56
58
typedef
std::shared_ptr<DistanceFunction>
SPDistanceFunction
;
59
61
class
DistFBinaryOperation
:
public
DistanceFunction
62
{
63
protected
:
64
SPDistanceFunction
e1
;
65
SPDistanceFunction
e2
;
66
public
:
67
DistFBinaryOperation
(
SPDistanceFunction
a,
SPDistanceFunction
b);
68
};
69
71
class
DistFUnaryOperation
:
public
DistanceFunction
72
{
73
protected
:
74
SPDistanceFunction
e1
;
75
public
:
76
DistFUnaryOperation
(
SPDistanceFunction
a);
77
};
78
80
class
DistFOperationAnd
:
public
DistFBinaryOperation
81
{
82
public
:
83
DistFOperationAnd
(
SPDistanceFunction
a,
SPDistanceFunction
b);
84
virtual
acl::VectorOfElements
getDistance
(
const
acl::VectorOfElements
& pos);
85
};
86
88
class
DistFOperationOr
:
public
DistFBinaryOperation
89
{
90
public
:
91
DistFOperationOr
(
SPDistanceFunction
a,
SPDistanceFunction
b);
92
virtual
acl::VectorOfElements
getDistance
(
const
acl::VectorOfElements
& pos);
93
};
94
96
class
DistFOperationInversion
:
public
DistFUnaryOperation
97
{
98
public
:
99
DistFOperationInversion
(
SPDistanceFunction
a);
100
virtual
acl::VectorOfElements
getDistance
(
const
acl::VectorOfElements
& pos);
101
};
102
103
105
class
DistFSphere
:
public
DistanceFunction
106
{
107
private
:
108
acl::VectorOfElements
radius;
109
acl::VectorOfElements
center;
110
public
:
111
DistFSphere
(
double
r,
const
AVec<double>
& c);
112
virtual
acl::VectorOfElements
getDistance
(
const
acl::VectorOfElements
& pos);
113
};
114
116
118
class
DistFCylinder
:
public
DistanceFunction
119
{
120
private
:
121
acl::VectorOfElements
radius;
122
acl::VectorOfElements
orientation;
123
acl::VectorOfElements
center;
124
public
:
130
DistFCylinder
(
double
r,
const
AVec<double>
& l,
const
AVec<double>
& c);
131
virtual
acl::VectorOfElements
getDistance
(
const
acl::VectorOfElements
& pos);
132
};
133
135
137
class
DistFCone
:
public
DistanceFunction
138
{
139
private
:
140
acl::VectorOfElements
tanTheta;
141
acl::VectorOfElements
orientation;
142
acl::VectorOfElements
apex;
143
public
:
149
DistFCone
(
double
th,
const
AVec<double>
& l,
const
AVec<double>
& a);
150
virtual
acl::VectorOfElements
getDistance
(
const
acl::VectorOfElements
& pos);
151
};
152
154
156
class
DistFPlane
:
public
DistanceFunction
157
{
158
private
:
159
acl::VectorOfElements
normal;
160
acl::VectorOfElements
b;
161
public
:
162
DistFPlane
(
AVec<double>
n,
AVec<double>
p0);
163
virtual
acl::VectorOfElements
getDistance
(
const
acl::VectorOfElements
& pos);
164
};
165
166
169
class
DistFNormalization
:
public
DistFUnaryOperation
170
{
171
protected
:
172
acl::VectorOfElements
factor
;
173
public
:
174
static
const
double
scaleFactor
;
175
DistFNormalization
(
SPDistanceFunction
a,
double
dx
);
176
virtual
acl::VectorOfElements
getDistance
(
const
acl::VectorOfElements
& pos);
177
};
178
181
class
DataInterpolation
:
public
DistanceFunction
182
{
183
protected
:
184
SPAbstractDataWithGhostNodes
data
;
185
186
public
:
187
DataInterpolation
(
SPAbstractDataWithGhostNodes
d);
188
virtual
acl::VectorOfElements
getDistance
(
const
acl::VectorOfElements
& pos);
189
};
190
191
}
// asl
192
193
#endif
// ASLDISTANCEFUNCTION
aclVectorOfElementsDef.h
aslUtilities.h
useful common utilities
acl::KernelConfiguration
ACL Kernel configuration class.
Definition
aclKernelConfiguration.h:35
acl::VectorOfElements
The class represents several Element.
Definition
aclVectorOfElementsDef.h:92
asl::AVec
Definition
aslVectorsDynamicLength.h:40
asl::AbstractDataWithGhostNodes
Definition
aslDataWithGhostNodes.h:39
asl::Block
Definition
aslBlocks.h:57
asl::DataInterpolation::DataInterpolation
DataInterpolation(SPAbstractDataWithGhostNodes d)
asl::DataInterpolation::data
SPAbstractDataWithGhostNodes data
Definition
aslDistanceFunction.h:184
asl::DataInterpolation::getDistance
virtual acl::VectorOfElements getDistance(const acl::VectorOfElements &pos)
asl::DistFBinaryOperation::DistFBinaryOperation
DistFBinaryOperation(SPDistanceFunction a, SPDistanceFunction b)
asl::DistFBinaryOperation::e2
SPDistanceFunction e2
Definition
aslDistanceFunction.h:65
asl::DistFBinaryOperation::e1
SPDistanceFunction e1
Definition
aslDistanceFunction.h:64
asl::DistFCone::DistFCone
DistFCone(double th, const AVec< double > &l, const AVec< double > &a)
asl::DistFCone::getDistance
virtual acl::VectorOfElements getDistance(const acl::VectorOfElements &pos)
asl::DistFCylinder::getDistance
virtual acl::VectorOfElements getDistance(const acl::VectorOfElements &pos)
asl::DistFCylinder::DistFCylinder
DistFCylinder(double r, const AVec< double > &l, const AVec< double > &c)
asl::DistFNormalization::DistFNormalization
DistFNormalization(SPDistanceFunction a, double dx)
asl::DistFNormalization::getDistance
virtual acl::VectorOfElements getDistance(const acl::VectorOfElements &pos)
asl::DistFNormalization::factor
acl::VectorOfElements factor
Definition
aslDistanceFunction.h:172
asl::DistFNormalization::scaleFactor
static const double scaleFactor
Definition
aslDistanceFunction.h:174
asl::DistFOperationAnd::getDistance
virtual acl::VectorOfElements getDistance(const acl::VectorOfElements &pos)
asl::DistFOperationAnd::DistFOperationAnd
DistFOperationAnd(SPDistanceFunction a, SPDistanceFunction b)
asl::DistFOperationInversion::getDistance
virtual acl::VectorOfElements getDistance(const acl::VectorOfElements &pos)
asl::DistFOperationInversion::DistFOperationInversion
DistFOperationInversion(SPDistanceFunction a)
asl::DistFOperationOr::getDistance
virtual acl::VectorOfElements getDistance(const acl::VectorOfElements &pos)
asl::DistFOperationOr::DistFOperationOr
DistFOperationOr(SPDistanceFunction a, SPDistanceFunction b)
asl::DistFPlane::getDistance
virtual acl::VectorOfElements getDistance(const acl::VectorOfElements &pos)
asl::DistFPlane::DistFPlane
DistFPlane(AVec< double > n, AVec< double > p0)
asl::DistFSphere::DistFSphere
DistFSphere(double r, const AVec< double > &c)
asl::DistFSphere::getDistance
virtual acl::VectorOfElements getDistance(const acl::VectorOfElements &pos)
asl::DistFUnaryOperation::DistFUnaryOperation
DistFUnaryOperation(SPDistanceFunction a)
asl::DistFUnaryOperation::e1
SPDistanceFunction e1
Definition
aslDistanceFunction.h:74
asl::DistanceFunction::DistanceFunction
DistanceFunction()
asl::DistanceFunction::getDistance
virtual acl::VectorOfElements getDistance(const acl::VectorOfElements &pos)=0
asl::DistanceFunction::~DistanceFunction
virtual ~DistanceFunction()
asl::dx
acl::VectorOfElements dx(const TemplateVE &a)
differential operator
asl::SPDistanceFunction
std::shared_ptr< DistanceFunction > SPDistanceFunction
Definition
aslGeomInc.h:45
acl
Advanced Computational Language.
Definition
acl.h:41
asl
Advanced Simulation Library.
Definition
aslDataInc.h:31
asl::SPAbstractDataWithGhostNodes
std::shared_ptr< AbstractDataWithGhostNodes > SPAbstractDataWithGhostNodes
Definition
aslGenerators.h:51
Generated by
1.17.0