25#ifndef __BITPIT_ELEMENT_REFERENCE_HPP__
26#define __BITPIT_ELEMENT_REFERENCE_HPP__
31#include "bitpit_common.hpp"
33#include "element_type.hpp"
40 BITPIT_PUBLIC_API
static const int MAX_ELEM_VERTICES = 8;
41 BITPIT_PUBLIC_API
static const int MAX_ELEM_FACES = 6;
42 BITPIT_PUBLIC_API
static const int MAX_ELEM_EDGES = 12;
54 std::array<ElementType, MAX_ELEM_FACES> faceTypeStorage;
55 std::array<std::array<int, MAX_ELEM_VERTICES>, MAX_ELEM_FACES> faceConnectStorage;
56 std::array<std::array<int, MAX_ELEM_FACES>, MAX_ELEM_FACES> faceEdgeStorage;
58 std::array<ElementType, MAX_ELEM_EDGES> edgeTypeStorage;
59 std::array<std::array<int, MAX_ELEM_VERTICES>, MAX_ELEM_EDGES> edgeConnectStorage;
63 virtual double evalSize(
const std::array<double, 3> *vertexCoords)
const = 0;
65 virtual void evalPointProjection(
const std::array<double, 3> &point,
const std::array<double, 3> *vertexCoords, std::array<double, 3> *projection,
double *distance)
const = 0;
66 virtual double evalPointDistance(
const std::array<double, 3> &point,
const std::array<double, 3> *vertexCoords)
const = 0;
74 void initializeFaceEdges(
const std::vector<const ReferenceElementInfo *> &facesInfo,
const std::vector<const ReferenceElementInfo *> &edgesInfo);
81 double evalSize(
const std::array<double, 3> *vertexCoords)
const override;
83 virtual double evalVolume(
const std::array<double, 3> *vertexCoords)
const = 0;
84 double evalSurfaceArea(
const std::array<double, 3> *vertexCoords)
const;
87 double evalFaceArea(
int face,
const std::array<double, 3> *vertexCoords)
const;
88 double evalEdgeLength(
int edge,
const std::array<double, 3> *vertexCoords)
const;
90 void evalPointProjection(
const std::array<double, 3> &point,
const std::array<double, 3> *vertexCoords, std::array<double, 3> *projection,
double *distance)
const override;
91 double evalPointDistance(
const std::array<double, 3> &point,
const std::array<double, 3> *vertexCoords)
const override;
103 double evalSize(
const std::array<double, 3> *vertexCoords)
const override;
105 double evalVolume(
const std::array<double, 3> *vertexCoords)
const override;
122 double evalSize(
const std::array<double, 3> *vertexCoords)
const override;
124 double evalVolume(
const std::array<double, 3> *vertexCoords)
const override;
141 double evalVolume(
const std::array<double, 3> *vertexCoords)
const override;
158 double evalVolume(
const std::array<double, 3> *vertexCoords)
const override;
175 double evalVolume(
const std::array<double, 3> *vertexCoords)
const override;
190 double evalSize(
const std::array<double, 3> *vertexCoords)
const override;
192 virtual double evalArea(
const std::array<double, 3> *vertexCoords)
const = 0;
193 double evalPerimeter(
const std::array<double, 3> *vertexCoords)
const;
195 double evalFaceLength(
int face,
const std::array<double, 3> *vertexCoords)
const;
197 virtual std::array<double, 3> evalNormal(
const std::array<double, 3> *vertexCoords,
const std::array<double, 3> &point = {{0.5, 0.5, 0.5}})
const = 0;
199 void evalPointProjection(
const std::array<double, 3> &point,
const std::array<double, 3> *vertexCoords, std::array<double, 3> *projection,
double *distance)
const override;
200 double evalPointDistance(
const std::array<double, 3> &point,
const std::array<double, 3> *vertexCoords)
const override;
211 void getCCWVertexCoords(
const std::array<double, 3> *vertexCoords,
const std::array<double, 3> **ccwVertexCoords, std::array<double, 3> *ccwVertexCoordsStorage)
const;
223 double evalSize(
const std::array<double, 3> *vertexCoords)
const override;
225 double evalArea(
const std::array<double, 3> *vertexCoords)
const override;
227 std::array<double, 3>
evalNormal(
const std::array<double, 3> *vertexCoords,
const std::array<double, 3> &point = {{0.5, 0.5, 0.5}})
const override;
229 void evalPointProjection(
const std::array<double, 3> &point,
const std::array<double, 3> *vertexCoords, std::array<double, 3> *projection,
double *distance)
const override;
230 double evalPointDistance(
const std::array<double, 3> &point,
const std::array<double, 3> *vertexCoords)
const override;
248 double evalSize(
const std::array<double, 3> *vertexCoords)
const override;
250 double evalArea(
const std::array<double, 3> *vertexCoords)
const override;
252 std::array<double, 3>
evalNormal(
const std::array<double, 3> *vertexCoords,
const std::array<double, 3> &point = {{0.5, 0.5, 0.5}})
const override;
278 double evalArea(
const std::array<double, 3> *vertexCoords)
const override;
280 std::array<double, 3>
evalNormal(
const std::array<double, 3> *vertexCoords,
const std::array<double, 3> &point = {{0.5, 0.5, 0.5}})
const override;
295 virtual double evalLength(
const std::array<double, 3> *vertexCoords)
const = 0;
297 virtual std::array<double, 3> evalNormal(
const std::array<double, 3> *vertexCoords,
const std::array<double, 3> &orientation = {{0., 0., 1.}},
const std::array<double, 3> &point = {{0.5, 0.5, 0.5}})
const = 0;
317 double evalSize(
const std::array<double, 3> *vertexCoords)
const override;
319 double evalLength(
const std::array<double, 3> *vertexCoords)
const override;
321 std::array<double, 3>
evalNormal(
const std::array<double, 3> *vertexCoords,
const std::array<double, 3> &orientation = {{0., 0., 1.}},
const std::array<double, 3> &point = {{0.5, 0.5, 0.5}})
const override;
323 void evalPointProjection(
const std::array<double, 3> &point,
const std::array<double, 3> *vertexCoords, std::array<double, 3> *projection,
double *distance)
const override;
324 double evalPointDistance(
const std::array<double, 3> &point,
const std::array<double, 3> *vertexCoords)
const override;
339 virtual std::array<double, 3> evalNormal(
const std::array<double, 3> *vertexCoords,
const std::array<double, 3> &orientation = {{1., 0., 0.}})
const = 0;
355 double evalSize(
const std::array<double, 3> *vertexCoords)
const override;
357 std::array<double, 3>
evalNormal(
const std::array<double, 3> *vertexCoords,
const std::array<double, 3> &orientation = {{1., 0., 0.}})
const override;
359 void evalPointProjection(
const std::array<double, 3> &point,
const std::array<double, 3> *vertexCoords, std::array<double, 3> *projection,
double *distance)
const override;
360 double evalPointDistance(
const std::array<double, 3> &point,
const std::array<double, 3> *vertexCoords)
const override;
The Reference0DElementInfo class allows to define information about reference zero-dimensional elemen...
Reference0DElementInfo(ElementType type)
The Reference1DElementInfo class allows to define information about reference one-dimensional element...
Reference1DElementInfo(ElementType type)
The Reference2DElementInfo class allows to define information about reference two-dimensional element...
virtual int getCCWOrderedVertex(int n) const
virtual int getCCWOrderedFace(int n) const
double evalPointDistance(const std::array< double, 3 > &point, const std::array< double, 3 > *vertexCoords) const override
double evalFaceLength(int face, const std::array< double, 3 > *vertexCoords) const
double evalSize(const std::array< double, 3 > *vertexCoords) const override
Reference2DElementInfo(ElementType type, int nVertices)
void evalPointProjection(const std::array< double, 3 > &point, const std::array< double, 3 > *vertexCoords, std::array< double, 3 > *projection, double *distance) const override
double evalPerimeter(const std::array< double, 3 > *vertexCoords) const
void getCCWVertexCoords(const std::array< double, 3 > *vertexCoords, const std::array< double, 3 > **ccwVertexCoords, std::array< double, 3 > *ccwVertexCoordsStorage) const
virtual bool areVerticesCCWOrdered() const
virtual bool areFacesCCWOrdered() const
The Reference3DElementInfo class allows to define information about reference three-dimensional eleme...
double evalSurfaceArea(const std::array< double, 3 > *vertexCoords) const
double evalSize(const std::array< double, 3 > *vertexCoords) const override
double evalEdgePerimeter(const std::array< double, 3 > *vertexCoords) const
double evalFaceArea(int face, const std::array< double, 3 > *vertexCoords) const
Reference3DElementInfo(ElementType type, int nVertices, int nFaces)
double evalPointDistance(const std::array< double, 3 > &point, const std::array< double, 3 > *vertexCoords) const override
void evalPointProjection(const std::array< double, 3 > &point, const std::array< double, 3 > *vertexCoords, std::array< double, 3 > *projection, double *distance) const override
double evalEdgeLength(int edge, const std::array< double, 3 > *vertexCoords) const
The ReferenceElementInfo class allows to define information about reference elements.
ReferenceElementInfo(int _dimension, ElementType _type, int _nVertices, int _nFaces, int _nEdges)
static bool hasInfo(ElementType type)
static BITPIT_PUBLIC_API const ReferenceElementInfo & getInfo(ElementType type)
void initializeFaceEdges(const std::vector< const ReferenceElementInfo * > &facesInfo, const std::vector< const ReferenceElementInfo * > &edgesInfo)
The ReferenceHexahedronInfo class defines the information about the reference hexahedron.
ReferenceHexahedronInfo()
double evalVolume(const std::array< double, 3 > *vertexCoords) const override
The ReferenceLineInfo class defines the information about the reference line.
std::array< double, 3 > evalNormal(const std::array< double, 3 > *vertexCoords, const std::array< double, 3 > &orientation={{0., 0., 1.}}, const std::array< double, 3 > &point={{0.5, 0.5, 0.5}}) const override
void evalPointProjection(const std::array< double, 3 > &point, const std::array< double, 3 > *vertexCoords, std::array< double, 3 > *projection, double *distance) const override
double evalLength(const std::array< double, 3 > *vertexCoords) const override
double evalPointDistance(const std::array< double, 3 > &point, const std::array< double, 3 > *vertexCoords) const override
double evalSize(const std::array< double, 3 > *vertexCoords) const override
The ReferencePixelInfo class defines the information about the reference pixel.
bool areVerticesCCWOrdered() const override
double evalSize(const std::array< double, 3 > *vertexCoords) const override
int getCCWOrderedVertex(int n) const override
std::array< double, 3 > evalNormal(const std::array< double, 3 > *vertexCoords, const std::array< double, 3 > &point={{0.5, 0.5, 0.5}}) const override
bool areFacesCCWOrdered() const override
int getCCWOrderedFace(int n) const override
double evalArea(const std::array< double, 3 > *vertexCoords) const override
The ReferencePyramidInfo class defines the information about the reference pyramid.
double evalVolume(const std::array< double, 3 > *vertexCoords) const override
The ReferenceQuadInfo class defines the information about the reference quadrangle.
double evalArea(const std::array< double, 3 > *vertexCoords) const override
std::array< double, 3 > evalNormal(const std::array< double, 3 > *vertexCoords, const std::array< double, 3 > &point={{0.5, 0.5, 0.5}}) const override
The ReferenceTetraInfo class defines the information about the reference tetrahedron.
double evalSize(const std::array< double, 3 > *vertexCoords) const override
double evalVolume(const std::array< double, 3 > *vertexCoords) const override
The ReferenceTriangleInfo class defines the information about the reference triangle.
double evalPointDistance(const std::array< double, 3 > &point, const std::array< double, 3 > *vertexCoords) const override
double evalArea(const std::array< double, 3 > *vertexCoords) const override
void evalPointProjection(const std::array< double, 3 > &point, const std::array< double, 3 > *vertexCoords, std::array< double, 3 > *projection, double *distance) const override
double evalSize(const std::array< double, 3 > *vertexCoords) const override
std::array< double, 3 > evalNormal(const std::array< double, 3 > *vertexCoords, const std::array< double, 3 > &point={{0.5, 0.5, 0.5}}) const override
The ReferenceVertexInfo class defines the information about the reference vertex.
std::array< double, 3 > evalNormal(const std::array< double, 3 > *vertexCoords, const std::array< double, 3 > &orientation={{1., 0., 0.}}) const override
double evalPointDistance(const std::array< double, 3 > &point, const std::array< double, 3 > *vertexCoords) const override
double evalSize(const std::array< double, 3 > *vertexCoords) const override
void evalPointProjection(const std::array< double, 3 > &point, const std::array< double, 3 > *vertexCoords, std::array< double, 3 > *projection, double *distance) const override
The ReferenceVoxelInfo class defines the information about the reference voxel.
double evalSize(const std::array< double, 3 > *vertexCoords) const override
double evalVolume(const std::array< double, 3 > *vertexCoords) const override
The ReferenceWedgeInfo class defines the information about the reference wedge.
double evalVolume(const std::array< double, 3 > *vertexCoords) const override