escript  Revision_
ShapeTable.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2016 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 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16 
17 /* Shape Function info
18 These tables are a much simplified version of content from finley's ShapeFunctions files
19 
20 This file is not to be included in .h files - only .c files should have any use for it
21 */
22 
23 #ifndef SHAPETABLE_DUDLEY
24 #define SHAPETABLE_DUDLEY
25 
26 #include "esysUtils/types.h"
27 
28 #include "ElementType.h"
29 
30 /* These are constructed from dsdv in ShapeFunction.c in finley
31  The first two are just there for functions that want a pointer
32 */
33 static const double DTDV_0D[1][1] = { {0} };
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] = { {-1, 1}, {0, -1.}, {0, 1},
38 {-1, 1}, {0, -1.}, {0, 1},
39 {-1, 1}, {0, -1.}, {0, 1}
40 };
41 static const double DTDV_3D[4][3] = { {-1, -1, -1}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1} };
42 
43 /* Index by the following by Dudley_ElementTypeID
44  * The number of local dimensions (as opposed to dimension of the embedding space) */
45 static const dim_t localDims[8] = { 0, 1, 2, 3, 0, 1, 2, 0 };
46 static const dim_t Dims[8] = { 0, 1, 2, 3, 1, 2, 3, 0 };
47 
48 /* the following lists are only used for face elements defined by numNodesOnFace>0 */
49 static const dim_t numNodesOnFaceMap[8] = { 1, 2, 3, 4, 1, 2, 4, -1 }; /* if the element is allowed as a face element, numNodesOnFace defines the number of nodes defining the face */
50 static const dim_t shiftNodesMap[8][4] = { {0}, {1, 0}, {1, 2, 0}, {-1}, {0, 1, 2}, {1, 0, 2}, {1, 2, 0, 3}, {0} }; /* defines a permutation of the nodes which rotates the nodes on the face */
51 static const dim_t reverseNodesMap[8][4] = { {-1}, {-1}, {0, 2, 1}, {-1}, {-1}, {-1}, {0, 2, 1, 3}, {0} }; /* reverses the order of the nodes on a face. the permutation has keep 0 fixed. */
52  /* shiftNodes={-1} or reverseNodes={-1} are ignored. */
53 
54 /* [0] is reduced quadrature, [1] is full quadrature */
55 /* in order the positions are POINT, LINE, TRI, TET */
56 static const double QuadWeight[4][2] = { {0, 0}, {1., 0.5}, {0.5, 1. / 6}, {1. / 6, 1. / 24} };
57 
58 /* number of quadrature points per element */
59 static const dim_t QuadNums[4][2] = { {0, 0}, {1, 2}, {1, 3}, {1, 4} };
60 
61 /*shape functions at quadrature nodes */
62 bool getQuadShape(dim_t sim, bool reduced, const double **shapearr);
63 
64 const char *getElementName(Dudley_ElementTypeId id);
65 
66 #endif
static const double DTDV_0D[1][1]
Definition: ShapeTable.h:33
static const dim_t Dims[8]
Definition: ShapeTable.h:46
static const double DTDV_2D[3 *3][2]
Definition: ShapeTable.h:37
static const double DTDV_3D[4][3]
Definition: ShapeTable.h:41
bool getQuadShape(dim_t sim, bool reduced, const double **shapearr)
Definition: ShapeTable.cpp:27
Dudley_ElementTypeId
Definition: ElementType.h:20
const char * getElementName(Dudley_ElementTypeId id)
Definition: ShapeTable.cpp:124
static const dim_t QuadNums[4][2]
Definition: ShapeTable.h:59
static const double DTDV_1D[2][2]
Definition: ShapeTable.h:34
static const dim_t reverseNodesMap[8][4]
Definition: ShapeTable.h:51
static const dim_t shiftNodesMap[8][4]
Definition: ShapeTable.h:50
index_t dim_t
Definition: types.h:27
static const dim_t numNodesOnFaceMap[8]
Definition: ShapeTable.h:49
static const double QuadWeight[4][2]
Definition: ShapeTable.h:56
static const dim_t localDims[8]
Definition: ShapeTable.h:45