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
19These tables are a much simplified version of content from finley's ShapeFunctions files
20
21This 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
30namespace 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
34static const double DTDV_1D[2][2] = { {-1., 1}, {-1., 1.} };
35
36// The repetition here is a hack to prevent out of bounds access
37static 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
43static 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)
53static const int localDims[8] = { 0, 1, 2, 3, 0, 1, 2, 0 };
54static 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
61static 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
64static 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.
68static 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
72static 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
75static const int QuadNums[4][2] = { {0, 0}, {1, 2}, {1, 3}, {1, 4} };
76
77// shape functions at quadrature nodes
78bool getQuadShape(dim_t sim, bool reduced, const double **shapearr);
79
80const char* getElementName(ElementTypeId id);
81
82} // namespace dudley
83
84#endif // __DUDLEY_SHAPETABLE_H__
85
A suite of factory methods for creating 2D and 3D dudley domains.
Definition dudley/src/Assemble.h:32
static const double DTDV_1D[2][2]
Definition ShapeTable.h:34
const char * getElementName(ElementTypeId id)
Definition ShapeTable.cpp:104
static const int Dims[8]
Definition ShapeTable.h:54
static const int localDims[8]
Definition ShapeTable.h:53
static const double DTDV_3D[4][3]
Definition ShapeTable.h:43
bool getQuadShape(dim_t dim, bool reduced, const double **shapearr)
Definition ShapeTable.cpp:28
static const int QuadNums[4][2]
Definition ShapeTable.h:75
static const int shiftNodesMap[8][4]
Definition ShapeTable.h:64
static const double DTDV_2D[3 *3][2]
Definition ShapeTable.h:37
ElementTypeId
Definition ElementType.h:25
static const double QuadWeight[4][2]
Definition ShapeTable.h:72
static const int reverseNodesMap[8][4]
Definition ShapeTable.h:68
static const int numNodesOnFaceMap[8]
Definition ShapeTable.h:61
index_t dim_t
Definition DataTypes.h:66