aslDistanceFunction.h
Go to the documentation of this file.
/*
* Advanced Simulation Library <http://asl.org.il>
*
* Copyright 2015 Avtech Scientific <http://avtechscientific.com>
*
*
* This file is part of Advanced Simulation Library (ASL).
*
* ASL is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, version 3 of the License.
*
* ASL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with ASL. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef ASLDISTANCEFUNCTION_H
#define ASLDISTANCEFUNCTION_H
#include <acl/aclMath/aclVectorOfElementsDef.h>
#include <aslUtilities.h>
namespace acl
{
class KernelConfiguration;
}
namespace asl {
template <typename T> class AVec;
class Block;
class AbstractDataWithGhostNodes;
typedef std::shared_ptr<AbstractDataWithGhostNodes> SPAbstractDataWithGhostNodes;
class DistanceFunction
{
protected:
DistanceFunction();
public:
virtual ~DistanceFunction();
virtual acl::VectorOfElements getDistance(const acl::VectorOfElements & pos)=0;
};
typedef std::shared_ptr<DistanceFunction> SPDistanceFunction;
class DistFBinaryOperation: public DistanceFunction
{
protected:
SPDistanceFunction e1;
SPDistanceFunction e2;
public:
DistFBinaryOperation(SPDistanceFunction a, SPDistanceFunction b);
};
class DistFUnaryOperation: public DistanceFunction
{
protected:
SPDistanceFunction e1;
public:
DistFUnaryOperation(SPDistanceFunction a);
};
class DistFOperationAnd: public DistFBinaryOperation
{
public:
DistFOperationAnd(SPDistanceFunction a, SPDistanceFunction b);
virtual acl::VectorOfElements getDistance(const acl::VectorOfElements & pos);
};
class DistFOperationOr: public DistFBinaryOperation
{
public:
DistFOperationOr(SPDistanceFunction a, SPDistanceFunction b);
virtual acl::VectorOfElements getDistance(const acl::VectorOfElements & pos);
};
class DistFOperationInversion: public DistFUnaryOperation
{
public:
DistFOperationInversion(SPDistanceFunction a);
virtual acl::VectorOfElements getDistance(const acl::VectorOfElements & pos);
};
class DistFSphere: public DistanceFunction
{
private:
acl::VectorOfElements radius;
acl::VectorOfElements center;
public:
DistFSphere(double r, const AVec<double> & c);
virtual acl::VectorOfElements getDistance(const acl::VectorOfElements & pos);
};
class DistFCylinder: public DistanceFunction
{
private:
acl::VectorOfElements radius;
acl::VectorOfElements orientation;
acl::VectorOfElements center;
public:
DistFCylinder(double r, const AVec<double> & l, const AVec<double> & c);
virtual acl::VectorOfElements getDistance(const acl::VectorOfElements & pos);
};
class DistFCone: public DistanceFunction
{
private:
acl::VectorOfElements tanTheta;
acl::VectorOfElements orientation;
acl::VectorOfElements apex;
public:
DistFCone(double th, const AVec<double> & l, const AVec<double> & a);
virtual acl::VectorOfElements getDistance(const acl::VectorOfElements & pos);
};
class DistFPlane: public DistanceFunction
{
private:
acl::VectorOfElements normal;
acl::VectorOfElements b;
public:
DistFPlane(AVec<double> n, AVec<double> p0);
virtual acl::VectorOfElements getDistance(const acl::VectorOfElements & pos);
};
class DistFNormalization: public DistFUnaryOperation
{
protected:
acl::VectorOfElements factor;
public:
static const double scaleFactor;
DistFNormalization(SPDistanceFunction a, double dx);
virtual acl::VectorOfElements getDistance(const acl::VectorOfElements & pos);
};
class DataInterpolation: public DistanceFunction
{
protected:
SPAbstractDataWithGhostNodes data;
public:
DataInterpolation(SPAbstractDataWithGhostNodes d);
virtual acl::VectorOfElements getDistance(const acl::VectorOfElements & pos);
};
} // asl
#endif // ASLDISTANCEFUNCTION
acl::VectorOfElements
The class represents several Element.
Definition: aclVectorOfElementsDef.h:92
asl::AVec< double >
asl::DataInterpolation
Definition: aslDistanceFunction.h:182
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
Definition: aslDistanceFunction.h:62
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
Definition: aslDistanceFunction.h:138
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
Definition: aslDistanceFunction.h:119
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
Definition: aslDistanceFunction.h:170
asl::DistFNormalization::DistFNormalization
DistFNormalization(SPDistanceFunction a, double dx)
asl::DistFNormalization::scaleFactor
static const double scaleFactor
Definition: aslDistanceFunction.h:174
asl::DistFNormalization::getDistance
virtual acl::VectorOfElements getDistance(const acl::VectorOfElements &pos)
asl::DistFNormalization::factor
acl::VectorOfElements factor
Definition: aslDistanceFunction.h:172
asl::DistFOperationAnd
Definition: aslDistanceFunction.h:81
asl::DistFOperationAnd::getDistance
virtual acl::VectorOfElements getDistance(const acl::VectorOfElements &pos)
asl::DistFOperationAnd::DistFOperationAnd
DistFOperationAnd(SPDistanceFunction a, SPDistanceFunction b)
asl::DistFOperationInversion
Definition: aslDistanceFunction.h:97
asl::DistFOperationInversion::getDistance
virtual acl::VectorOfElements getDistance(const acl::VectorOfElements &pos)
asl::DistFOperationInversion::DistFOperationInversion
DistFOperationInversion(SPDistanceFunction a)
asl::DistFOperationOr
Definition: aslDistanceFunction.h:89
asl::DistFOperationOr::getDistance
virtual acl::VectorOfElements getDistance(const acl::VectorOfElements &pos)
asl::DistFOperationOr::DistFOperationOr
DistFOperationOr(SPDistanceFunction a, SPDistanceFunction b)
asl::DistFPlane
Definition: aslDistanceFunction.h:157
asl::DistFPlane::getDistance
virtual acl::VectorOfElements getDistance(const acl::VectorOfElements &pos)
asl::DistFPlane::DistFPlane
DistFPlane(AVec< double > n, AVec< double > p0)
asl::DistFSphere
Definition: aslDistanceFunction.h:106
asl::DistFSphere::DistFSphere
DistFSphere(double r, const AVec< double > &c)
asl::DistFSphere::getDistance
virtual acl::VectorOfElements getDistance(const acl::VectorOfElements &pos)
asl::DistFUnaryOperation
Definition: aslDistanceFunction.h:72
asl::DistFUnaryOperation::DistFUnaryOperation
DistFUnaryOperation(SPDistanceFunction a)
asl::DistFUnaryOperation::e1
SPDistanceFunction e1
Definition: aslDistanceFunction.h:74
asl::DistanceFunction
Definition: aslDistanceFunction.h:49
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:44
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:50