escript  Revision_
ShapeTable.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2020 by The University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Apache License, version 2.0
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014-2017 by Centre for Geoscience Computing (GeoComp)
14 * Development from 2019 by School of Earth and Environmental Sciences
15 **
16 *****************************************************************************/
17 
18 /* Shape Function info
19 These tables are a much simplified version of content from finley's ShapeFunctions files
20 
21 This file is not to be included in .h files - only .cpp files should have any use for it
22 */
23 
24 #ifndef __DUDLEY_SHAPETABLE_H__
25 #define __DUDLEY_SHAPETABLE_H__
26 
27 #include "Dudley.h"
28 #include "ElementType.h"
29 
30 namespace dudley {
31 
32 // These are constructed from dsdv in ShapeFunction.cpp in finley.
33 // The first one is just there for functions that want a pointer
34 static const double DTDV_1D[2][2] = { {-1., 1}, {-1., 1.} };
35 
36 // The repetition here is a hack to prevent out of bounds access
37 static const double DTDV_2D[3 * 3][2] = {
38  {-1, 1}, {0, -1.}, {0, 1},
39  {-1, 1}, {0, -1.}, {0, 1},
40  {-1, 1}, {0, -1.}, {0, 1}
41 };
42 
43 static const double DTDV_3D[4][3] = {
44  {-1, -1, -1},
45  { 1, 0, 0},
46  { 0, 1, 0},
47  { 0, 0, 1}
48 };
49 
50 // Index the following by ElementTypeID
51 // The number of local dimensions (as opposed to dimension of the embedding
52 // space)
53 static const int localDims[8] = { 0, 1, 2, 3, 0, 1, 2, 0 };
54 static const int Dims[8] = { 0, 1, 2, 3, 1, 2, 3, 0 };
55 
56 // the following lists are only used for face elements defined by
57 // numNodesOnFace>0
58 
59 // if the element is allowed as a face element, numNodesOnFace defines the
60 // number of nodes defining the face
61 static const int numNodesOnFaceMap[8] = { 1, 2, 3, 4, 1, 2, 4, -1 };
62 
63 // defines a permutation of the nodes which rotates the nodes on the face
64 static const int shiftNodesMap[8][4] = { {0}, {1, 0}, {1, 2, 0}, {-1}, {0, 1, 2}, {1, 0, 2}, {1, 2, 0, 3}, {0} };
65 
66 // reverses the order of the nodes on a face. the permutation has keep 0 fixed.
67 // shiftNodes={-1} or reverseNodes={-1} are ignored.
68 static const int reverseNodesMap[8][4] = { {-1}, {-1}, {0, 2, 1}, {-1}, {-1}, {-1}, {0, 2, 1, 3}, {0} };
69 
70 // [0] is reduced quadrature, [1] is full quadrature
71 // in order the positions are POINT, LINE, TRI, TET
72 static const double QuadWeight[4][2] = { {0, 0}, {1., 0.5}, {0.5, 1. / 6}, {1. / 6, 1. / 24} };
73 
74 // number of quadrature points per element
75 static const int QuadNums[4][2] = { {0, 0}, {1, 2}, {1, 3}, {1, 4} };
76 
77 // shape functions at quadrature nodes
78 bool getQuadShape(dim_t sim, bool reduced, const double **shapearr);
79 
80 const char* getElementName(ElementTypeId id);
81 
82 } // namespace dudley
83 
84 #endif // __DUDLEY_SHAPETABLE_H__
85 
dudley::QuadWeight
static const double QuadWeight[4][2]
Definition: ShapeTable.h:72
dudley::Dudley_Point1
@ Dudley_Point1
Definition: ElementType.h:26
_dudley_s_beta
#define _dudley_s_beta
dudley::Dudley_Tet4Face
@ Dudley_Tet4Face
Definition: ElementType.h:32
dudley::reverseNodesMap
static const int reverseNodesMap[8][4]
Definition: ShapeTable.h:68
dudley::shiftNodesMap
static const int shiftNodesMap[8][4]
Definition: ShapeTable.h:64
dudley::numNodesOnFaceMap
static const int numNodesOnFaceMap[8]
Definition: ShapeTable.h:61
dudley::DTDV_3D
static const double DTDV_3D[4][3]
Definition: ShapeTable.h:43
dudley::Dudley_Tri3Face
@ Dudley_Tri3Face
Definition: ElementType.h:31
Dudley.h
dudley::QuadNums
static const int QuadNums[4][2]
Definition: ShapeTable.h:75
dudley::DTDV_2D
static const double DTDV_2D[3 *3][2]
Definition: ShapeTable.h:37
dudley::localDims
static const int localDims[8]
Definition: ShapeTable.h:53
dudley
A suite of factory methods for creating 2D and 3D dudley domains.
Definition: dudley/src/Assemble.h:32
dudley::getQuadShape
bool getQuadShape(dim_t dim, bool reduced, const double **shapearr)
Definition: ShapeTable.cpp:28
dudley::DTDV_1D
static const double DTDV_1D[2][2]
Definition: ShapeTable.h:34
dudley::Dudley_Line2Face
@ Dudley_Line2Face
Definition: ElementType.h:30
escript::DataTypes::dim_t
index_t dim_t
Definition: DataTypes.h:66
dudley::Dims
static const int Dims[8]
Definition: ShapeTable.h:54
_dudley_s_alpha
#define _dudley_s_alpha
ShapeTable.h
ElementType.h
dudley::Dudley_Tet4
@ Dudley_Tet4
Definition: ElementType.h:29
dudley::getElementName
const char * getElementName(ElementTypeId id)
Definition: ShapeTable.cpp:104
dudley::Dudley_Line2
@ Dudley_Line2
Definition: ElementType.h:27
dudley::Dudley_Tri3
@ Dudley_Tri3
Definition: ElementType.h:28
dudley::ElementTypeId
ElementTypeId
Definition: ElementType.h:25