33 #ifndef __H__UG__LIB_DISC__REFERENCE_ELEMENT__REFERENCE_ELEMENT__
34 #define __H__UG__LIB_DISC__REFERENCE_ELEMENT__REFERENCE_ELEMENT__
110 size_t num(
int dim_i,
size_t i,
int dim_j)
const
127 int id(
int dim_i,
size_t i,
int dim_j,
size_t j)
const
128 {
return m_id[dim_i][i][dim_j][j];}
219 std::stringstream ss; ss <<
"Reference Element not found for "
262 UG_ASSERT(roid >= 0,
"roid ="<<roid<<
" wrong")
265 UG_ASSERT(vDimElem[roid] != NULL,
"Null pointer for roid ="<<roid);
266 return *vDimElem[roid];
384 UG_ASSERT(pos[0] >= 0.0 && pos[0] <= 1.0,
385 "Local position "<<pos<<
" outside Reference Element");
433 UG_ASSERT(pos[0] >= 0.0 && pos[0] <= 1.0 &&
434 pos[1] >= 0.0 && pos[1] <= 1.0 &&
435 pos[0]+pos[1] <= 1.0,
436 "Local position "<<pos<<
" outside Reference Element");
483 UG_ASSERT(pos[0] >= 0.0 && pos[0] <= 1.0 &&
484 pos[1] >= 0.0 && pos[1] <= 1.0,
485 "Local position "<<pos<<
" outside Reference Element");
533 UG_ASSERT(pos[0] >= 0.0 && pos[0] <= 1.0 &&
534 pos[1] >= 0.0 && pos[1] <= 1.0 &&
535 pos[2] >= 0.0 && pos[2] <= 1.0 &&
536 pos[0]+pos[1]+pos[2] <= 1.0,
537 "Local position "<<pos<<
" outside Reference Element");
634 UG_ASSERT(pos[0] >= 0.0 && pos[0] <= 1.0 &&
635 pos[1] >= 0.0 && pos[1] <= 1.0 &&
636 pos[0]+pos[1] <= 1.0 &&
637 pos[2] >= 0.0 && pos[2] <= 1.0,
638 "Local position "<<pos<<
" outside Reference Element");
687 UG_ASSERT(pos[0] >= 0.0 && pos[0] <= 1.0 &&
688 pos[1] >= 0.0 && pos[1] <= 1.0 &&
689 pos[2] >= 0.0 && pos[2] <= 1.0,
690 "Local position "<<pos<<
" outside Reference Element");
dimension dependent base class for reference elements
Definition: reference_element.h:183
MathVector< dim > m_vCorner[MAXCORNERS]
coordinates of Reference Corner
Definition: reference_element.h:205
MathVector< dim, int > m_vCoInt[MAXCORNERS]
Definition: reference_element.h:206
const MathVector< dim > & corner(size_t i) const
coordinates of reference corner (i = 0 ... num(0))
Definition: reference_element.h:192
void print_info() const
print informations about the reference element
Definition: reference_element.cpp:100
const MathVector< dim, int > * corner() const
coordinates of reference corner as integer
Definition: reference_element.h:195
static const int dim
dimension, where the reference element is defined
Definition: reference_element.h:186
@ MAXCORNERS
Definition: reference_element.h:202
const MathVector< dim > * corners() const
coordinates of reference corner in a vector
Definition: reference_element.h:189
Definition: reference_element.h:345
static const int numSides
number of sides
Definition: reference_element.h:366
ReferenceObjectID reference_object_id() const
Definition: reference_element.h:373
static void check_position(const MathVector< dim > &pos)
Definition: reference_element.h:382
static const ReferenceObjectID REFERENCE_OBJECT_ID
type of reference element
Definition: reference_element.h:348
int dimension() const
returns the dimension where reference element lives
Definition: reference_element.h:376
static const int dim
dimension of reference element
Definition: reference_element.h:351
static const int numEdges
number of eges
Definition: reference_element.h:357
static const int numVolumes
number of volumes
Definition: reference_element.h:363
number size() const
returns the size (e.g. area or volume) of the reference element
Definition: reference_element.h:379
static const int numCorners
number of corners
Definition: reference_element.h:354
static const int numFaces
number of faces
Definition: reference_element.h:360
ReferenceEdge()
Constructor.
Definition: reference_element.cpp:246
base class for reference elements
Definition: reference_element.h:70
@ MAXOBJECTS
Definition: reference_element.h:146
number m_size
size of reference element
Definition: reference_element.h:155
ReferenceElement()
Constructor filling the arrays.
Definition: reference_element.cpp:42
size_t num(int dim) const
returns the number of geometric objects of dim
Definition: reference_element.h:95
void print_info() const
print informations about the reference element
Definition: reference_element.cpp:66
ReferenceObjectID roid() const
returns the reference object id
Definition: reference_element.h:76
size_t m_vSubNum[MAXDIM+1][MAXOBJECTS][MAXDIM+1]
number of Geometric Objects contained in a (Sub-)Geometric Object of the Element
Definition: reference_element.h:161
size_t num(ReferenceObjectID type) const
number of reference elements this element contains
Definition: reference_element.h:131
size_t m_vNumRefElem[NUM_REFERENCE_OBJECTS]
number of reference elements
Definition: reference_element.h:167
int id(int dim_i, size_t i, int dim_j, size_t j) const
id of object j in dimension dim_j of obj i in dimension dim_i
Definition: reference_element.h:127
int dimension() const
returns the dimension where reference element lives
Definition: reference_element.h:80
@ MAXDIM
Definition: reference_element.h:149
number size() const
returns the size (e.g. area or volume) of the reference element
Definition: reference_element.h:83
ReferenceObjectID m_vRefElemType[MAXDIM+1][MAXOBJECTS]
type of reference elements
Definition: reference_element.h:170
int m_dim
dimension of the reference world
Definition: reference_element.h:152
size_t m_vNum[MAXDIM+1]
number of Geometric Objects of a dimension
Definition: reference_element.h:158
@ VOLUME
Definition: reference_element.h:143
@ EDGE
Definition: reference_element.h:143
@ POINT
Definition: reference_element.h:143
@ FACE
Definition: reference_element.h:143
ReferenceObjectID roid(int dim_i, size_t i) const
reference element type of obj nr i in dimension dim_i
Definition: reference_element.h:135
int m_id[MAXDIM+1][MAXOBJECTS][MAXDIM+1][MAXOBJECTS]
indices of GeomObjects
Definition: reference_element.h:164
size_t num(int dim_i, size_t i, int dim_j) const
returns the number of object of dim for a sub-geometric object
Definition: reference_element.h:110
Provider for Reference Elements.
Definition: reference_element.h:229
static bool add_dim_elem(const DimReferenceElement< dim > &elem)
adds a Reference Element
Definition: reference_element.cpp:179
static bool add_elem(const ReferenceElement &elem)
adds a Reference Element
Definition: reference_element.cpp:161
ReferenceElementProvider & operator=(const ReferenceElementProvider &)
static const ReferenceElement & get_elem(ReferenceObjectID roid)
returns a Reference Element
Definition: reference_element.cpp:170
static const DimReferenceElement< dim > ** get_vector()
returns vector of DimReferenceElement
Definition: reference_element.h:271
static const ReferenceElement & get(ReferenceObjectID roid)
returns a Reference Element
Definition: reference_element.h:286
static ReferenceElementProvider & instance()
provide instance of singleton
Definition: reference_element.h:239
static const DimReferenceElement< dim > & get_dim_elem(ReferenceObjectID roid)
returns a Reference Element
Definition: reference_element.h:260
ReferenceElementProvider(const ReferenceElementProvider &)
Definition: reference_element.h:235
static const ReferenceElement * m_vElem[NUM_REFERENCE_OBJECTS]
vector storing all ReferenceElement
Definition: reference_element.h:252
ReferenceElementProvider()
constructor
Definition: reference_element.cpp:122
static const DimReferenceElement< dim > & get(ReferenceObjectID roid)
returns a dimension dependent Reference Element
Definition: reference_element.h:280
reference element for a hexahedron
Definition: reference_element.h:648
static const int dim
dimension of reference element
Definition: reference_element.h:654
ReferenceObjectID reference_object_id() const
Definition: reference_element.h:676
int dimension() const
returns the dimension where reference element lives
Definition: reference_element.h:679
static const int numVolumes
number of volumes
Definition: reference_element.h:666
ReferenceHexahedron()
Constructor filling the arrays.
Definition: reference_element.cpp:1327
static const int numFaces
number of faces
Definition: reference_element.h:663
static const int numSides
number of sides
Definition: reference_element.h:669
static void check_position(const MathVector< dim > &pos)
Definition: reference_element.h:685
number size() const
returns the size (e.g. area or volume) of the reference element
Definition: reference_element.h:682
static const int numCorners
number of corners
Definition: reference_element.h:657
static const int numEdges
number of eges
Definition: reference_element.h:660
static const ReferenceObjectID REFERENCE_OBJECT_ID
type of reference element
Definition: reference_element.h:651
Definition: reference_element.h:699
static const int numSides
number of sides
Definition: reference_element.h:720
number size() const
returns the size (e.g. area or volume) of the reference element
Definition: reference_element.h:733
static const int numFaces
number of faces
Definition: reference_element.h:714
int dimension() const
returns the dimension where reference element lives
Definition: reference_element.h:730
static const int dim
dimension of reference element
Definition: reference_element.h:705
ReferenceOctahedron()
Constructor.
Definition: reference_element.cpp:1650
static const int numCorners
number of corners
Definition: reference_element.h:708
ReferenceObjectID reference_object_id() const
Definition: reference_element.h:727
static const int numVolumes
number of volumes
Definition: reference_element.h:717
static const ReferenceObjectID REFERENCE_OBJECT_ID
type of reference element
Definition: reference_element.h:702
static const int numEdges
number of edges
Definition: reference_element.h:711
static void check_position(const MathVector< dim > &pos)
Definition: reference_element.h:736
Definition: reference_element.h:595
static const int numCorners
number of corners
Definition: reference_element.h:604
number size() const
returns the size (e.g. area or volume) of the reference element
Definition: reference_element.h:629
static const int dim
dimension of reference element
Definition: reference_element.h:601
ReferenceObjectID reference_object_id() const
Definition: reference_element.h:623
static const ReferenceObjectID REFERENCE_OBJECT_ID
type of reference element
Definition: reference_element.h:598
static const int numSides
number of sides
Definition: reference_element.h:616
static const int numFaces
number of faces
Definition: reference_element.h:610
static void check_position(const MathVector< dim > &pos)
Definition: reference_element.h:632
ReferencePrism()
Constructor.
Definition: reference_element.cpp:1034
static const int numVolumes
number of volumes
Definition: reference_element.h:613
static const int numEdges
number of eges
Definition: reference_element.h:607
int dimension() const
returns the dimension where reference element lives
Definition: reference_element.h:626
Definition: reference_element.h:546
static const int numFaces
number of faces
Definition: reference_element.h:561
number size() const
returns the size (e.g. area or volume) of the reference element
Definition: reference_element.h:580
ReferenceObjectID reference_object_id() const
Definition: reference_element.h:574
int dimension() const
returns the dimension where reference element lives
Definition: reference_element.h:577
static void check_position(const MathVector< dim > &pos)
Definition: reference_element.h:583
static const int numEdges
number of eges
Definition: reference_element.h:558
static const int numVolumes
number of volumes
Definition: reference_element.h:564
static const int dim
dimension of reference element
Definition: reference_element.h:552
static const int numCorners
number of corners
Definition: reference_element.h:555
static const ReferenceObjectID REFERENCE_OBJECT_ID
type of reference element
Definition: reference_element.h:549
ReferencePyramid()
Constructor.
Definition: reference_element.cpp:768
static const int numSides
number of sides
Definition: reference_element.h:567
Definition: reference_element.h:445
static void check_position(const MathVector< dim > &pos)
Definition: reference_element.h:481
static const int numFaces
number of faces
Definition: reference_element.h:460
ReferenceObjectID reference_object_id() const
Definition: reference_element.h:472
static const int numVolumes
number of volumes
Definition: reference_element.h:463
ReferenceQuadrilateral()
Definition: reference_element.cpp:428
static const int numEdges
number of eges
Definition: reference_element.h:457
number size() const
returns the size (e.g. area or volume) of the reference element
Definition: reference_element.h:478
static const int numCorners
number of corners
Definition: reference_element.h:454
static const int numSides
number of sides
Definition: reference_element.h:466
static const int dim
dimension of reference element
Definition: reference_element.h:451
static const ReferenceObjectID REFERENCE_OBJECT_ID
type of reference element
Definition: reference_element.h:448
int dimension() const
returns the dimension where reference element lives
Definition: reference_element.h:475
Definition: reference_element.h:494
static const int numFaces
number of faces
Definition: reference_element.h:509
static const int numSides
number of sides
Definition: reference_element.h:515
static void check_position(const MathVector< dim > &pos)
Definition: reference_element.h:531
number size() const
returns the size (e.g. area or volume) of the reference element
Definition: reference_element.h:528
static const int dim
dimension of reference element
Definition: reference_element.h:500
static const ReferenceObjectID REFERENCE_OBJECT_ID
type of reference element
Definition: reference_element.h:497
int dimension() const
returns the dimension where reference element lives
Definition: reference_element.h:525
static const int numEdges
number of eges
Definition: reference_element.h:506
static const int numCorners
number of corners
Definition: reference_element.h:503
ReferenceTetrahedron()
Constructor.
Definition: reference_element.cpp:547
ReferenceObjectID reference_object_id() const
Definition: reference_element.h:522
static const int numVolumes
number of volumes
Definition: reference_element.h:512
Definition: reference_element.h:394
static const int numVolumes
number of volumes
Definition: reference_element.h:412
ReferenceObjectID reference_object_id() const
Definition: reference_element.h:422
static const int numEdges
number of eges
Definition: reference_element.h:406
number size() const
returns the size (e.g. area or volume) of the reference element
Definition: reference_element.h:428
static const int numFaces
number of faces
Definition: reference_element.h:409
static void check_position(const MathVector< dim > &pos)
Definition: reference_element.h:431
static const ReferenceObjectID REFERENCE_OBJECT_ID
type of reference element
Definition: reference_element.h:397
static const int dim
dimension of reference element
Definition: reference_element.h:400
static const int numSides
number of sides
Definition: reference_element.h:415
int dimension() const
returns the dimension where reference element lives
Definition: reference_element.h:425
ReferenceTriangle()
Constructor filling the arrays.
Definition: reference_element.cpp:315
static const int numCorners
number of corners
Definition: reference_element.h:403
Definition: reference_element.h:303
static const int numCorners
number of corners
Definition: reference_element.h:312
ReferenceObjectID reference_object_id() const
Definition: reference_element.h:331
static const int dim
dimension of reference element
Definition: reference_element.h:309
ReferenceVertex()
Constructor filling the arrays.
Definition: reference_element.cpp:202
int dimension() const
returns the dimension where reference element lives
Definition: reference_element.h:334
static const int numFaces
number of faces
Definition: reference_element.h:318
static const int numSides
number of sides
Definition: reference_element.h:324
static const int numVolumes
number of volumes
Definition: reference_element.h:321
static const ReferenceObjectID REFERENCE_OBJECT_ID
type of reference element
Definition: reference_element.h:306
number size() const
returns the size (e.g. area or volume) of the reference element
Definition: reference_element.h:337
static const int numEdges
number of eges
Definition: reference_element.h:315
Instances of this class or of derived classes are thrown if errors arise.
Definition: error.h:104
void push_msg(const std::string &msg, const char *file=" -- no file -- ", const unsigned long line=0)
adds a message to the message stack
Definition: error.h:119
#define UG_ASSERT(expr, msg)
Definition: assert.h:70
double number
Definition: types.h:124
ReferenceObjectID
these ids are used to identify the shape of a geometric object.
Definition: grid_base_objects.h:74
@ ROID_TETRAHEDRON
Definition: grid_base_objects.h:80
@ ROID_QUADRILATERAL
Definition: grid_base_objects.h:79
@ NUM_REFERENCE_OBJECTS
Definition: grid_base_objects.h:85
@ ROID_PYRAMID
Definition: grid_base_objects.h:83
@ ROID_PRISM
Definition: grid_base_objects.h:82
@ ROID_EDGE
Definition: grid_base_objects.h:77
@ ROID_OCTAHEDRON
Definition: grid_base_objects.h:84
@ ROID_HEXAHEDRON
Definition: grid_base_objects.h:81
@ ROID_TRIANGLE
Definition: grid_base_objects.h:78
@ ROID_VERTEX
Definition: grid_base_objects.h:76
Exception thrown when reference element not found.
Definition: reference_element.h:215
ReferenceObjectID roid
Definition: reference_element.h:224
UGError_ReferenceElementMissing(int dim_, ReferenceObjectID roid_)
Definition: reference_element.h:216
int dim
Definition: reference_element.h:223