Escript  Revision_4320
BasisFunctions.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2013 by University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development since 2012 by School of Earth Sciences
13 *
14 *****************************************************************************/
15 
16 
17 /************************************************************************************/
18 
19 /* Finley: Reference elements */
20 
21 /************************************************************************************/
22 
23 #ifndef INC_FINLEY_REFERENCEELEMENTS
24 #define INC_FINLEY_REFERENCEELEMENTS
25 
26 
27 /************************************************************************************/
28 
29 #include "Finley.h"
30 #include "ShapeFunctions.h"
31 #include "Quadrature.h"
32 
33 /************************************************************************************/
34 
35 /* The ids of the allowed reference elements: */
36 
37 #define MAX_numNodes 64
38 
39 typedef enum {
116 
117  NoType /* marks end of list */
118 } ElementTypeId;
119 
120 /************************************************************************************/
121 
122 /* this struct holds the definition of the reference element: */
123 
125  ElementTypeId TypeId; /* the id */
126  char* Name; /* the name in text form e.g. Line1,Rec12,... */
127  dim_t numLocalDim; /* local dimension of the element */
128  dim_t numDim; /* dimension of the element */
129  dim_t numNodes; /* number of nodes defining the element*/
130  dim_t numShapes; /* number of shape functions, typically = numNodes*/
131  dim_t numOrder; /* order of the shape functions */
132  dim_t numVertices; /* number of vertices of the element */
133  ElementTypeId LinearTypeId; /* id of the linear version of the element */
134  index_t linearNodes[MAX_numNodes]; /* gives the list of nodes defining the linear or macro element, typically it is linearNodes[i]=i */
135  Finley_Shape_Function* getValues; /* function to evaluate the shape functions at a set of points */
136  Finley_Quad_getNodes* getQuadNodes; /* function to set the quadrature points */
137  Finley_Quad_getNumNodes* getNumQuadNodes; /* function selects the number of quadrature nodes for a given accuracy order */
138 
139 /********************************************************************************************************************************************************* */
140  dim_t numRelevantGeoNodes; /* number of nodes used to describe the geometry of the geometrically relevant part of the element
141  typically this is numNodes but for 'Face' elements where the quadrature points are defined on face of the element
142  this is the number of nodes on the particular face. */
143  index_t relevantGeoNodes[MAX_numNodes]; /* list to gather the geometrically relevant nodes (length used is numRelevantGeoNodes)
144  this list is used for the VTK interface */
145 
146  dim_t numNodesOnFace; /* if the element is allowed as a face element, numNodesOnFace defines the number of nodes defining the face */
147  /* the following lists are only used for face elements defined by numNodesOnFace>0 */
148  index_t faceNodes[MAX_numNodes]; /* list of the nodes defining the face */
149  index_t shiftNodes[MAX_numNodes]; /* defines a permutation of the nodes which rotates the nodes on the face */
150  index_t reverseNodes[MAX_numNodes]; /* reverses the order of the nodes on a face. The permutation has to keep 0 fixed. */
151  /* shiftNodes={-1} or reverseNodes={-1} are ignored. */
153 
154 /************************************************************************************/
155 
156 /* this struct holds the realization of a reference element */
157 
158 typedef struct Finley_ReferenceElement {
159  Finley_ReferenceElementInfo* Type; /* type of the reference element */
160  int numQuadNodes; /* number of quadrature points */
161  double *QuadNodes; /* coordinates of quadrature nodes */
162  double *QuadWeights; /* weights of the quadrature scheme */
163  double *S; /* shape functions at quadrature nodes */
164  double *dSdv; /* derivative of the shape functions at quadrature nodes */
166 
167 /************************************************************************************/
168 
169 /* interfaces: */
170 
174 
175 #endif /* #ifndef INC_FINLEY_REFERENCEELEMENTS */