/[escript]/trunk/finley/src/ReferenceElements.h
ViewVC logotype

Contents of /trunk/finley/src/ReferenceElements.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6939 - (show annotations)
Mon Jan 20 03:37:18 2020 UTC (2 months, 1 week ago) by uqaeller
File MIME type: text/plain
File size: 5967 byte(s)
Updated the copyright header.


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
19 /****************************************************************************
20
21 Finley: Reference elements
22
23 *****************************************************************************/
24
25 #ifndef __FINLEY_REFERENCEELEMENTS_H__
26 #define __FINLEY_REFERENCEELEMENTS_H__
27
28 #include "Finley.h"
29 #include "ShapeFunctions.h"
30 #include "Quadrature.h"
31
32 // The ids of the allowed reference elements:
33 #define MAX_numNodes 64
34 #define MAX_numSubElements 8
35 #define MAX_numSides 2
36
37 namespace finley {
38
39 typedef enum {
40 Point1,
41 Line2,
42 Line3,
43 Line4,
44 Tri3,
45 Tri6,
46 Tri9,
47 Tri10,
48 Rec4,
49 Rec8,
50 Rec9,
51 Rec12,
52 Rec16,
53 Tet4,
54 Tet10,
55 Tet16,
56 Hex8,
57 Hex20,
58 Hex27,
59 Hex32,
60 Line2Face,
61 Line3Face,
62 Line4Face,
63 Tri3Face,
64 Tri6Face,
65 Tri9Face,
66 Tri10Face,
67 Rec4Face,
68 Rec8Face,
69 Rec9Face,
70 Rec12Face,
71 Rec16Face,
72 Tet4Face,
73 Tet10Face,
74 Tet16Face,
75 Hex8Face,
76 Hex20Face,
77 Hex27Face,
78 Hex32Face,
79 Point1_Contact,
80 Line2_Contact,
81 Line3_Contact,
82 Line4_Contact,
83 Tri3_Contact,
84 Tri6_Contact,
85 Tri9_Contact,
86 Tri10_Contact,
87 Rec4_Contact,
88 Rec8_Contact,
89 Rec9_Contact,
90 Rec12_Contact,
91 Rec16_Contact,
92 Line2Face_Contact,
93 Line3Face_Contact,
94 Line4Face_Contact,
95 Tri3Face_Contact,
96 Tri6Face_Contact,
97 Tri9Face_Contact,
98 Tri10Face_Contact,
99 Rec4Face_Contact,
100 Rec8Face_Contact,
101 Rec9Face_Contact,
102 Rec12Face_Contact,
103 Rec16Face_Contact,
104 Tet4Face_Contact,
105 Tet10Face_Contact,
106 Tet16Face_Contact,
107 Hex8Face_Contact,
108 Hex20Face_Contact,
109 Hex27Face_Contact,
110 Hex32Face_Contact,
111 Line3Macro,
112 Tri6Macro,
113 Rec9Macro,
114 Tet10Macro,
115 Hex27Macro,
116 NoRef // marks end of list
117 } ElementTypeId;
118
119
120 /// this struct holds the definition of the reference element
121 struct ReferenceElementInfo {
122 /// the type
123 ElementTypeId TypeId;
124 /// the name in text form e.g. "Line1", "Rec12", ...
125 const char* Name;
126 /// number of nodes defining the element
127 int numNodes;
128 /// number of subelements (>1 if macro elements are used)
129 int numSubElements;
130 /// the number of sides the element supports (=2 if contact elements are
131 /// used, otherwise =1)
132 int numSides;
133 /// offset to the side nodes: offsets[s]...offsets[s+1]-1 refer to the
134 /// nodes to be used for side s
135 int offsets[MAX_numSides+1];
136
137 /// type id of the linear version of the element
138 ElementTypeId LinearTypeId;
139 /// stores the list of nodes defining the linear or macro element
140 int linearNodes[MAX_numNodes*MAX_numSides];
141 /// quadrature scheme
142 QuadTypeId Quadrature;
143 /// shape function for parametrization of the element
144 ShapeFunctionTypeId Parametrization;
145 /// shape function for the basis functions
146 ShapeFunctionTypeId BasisFunctions;
147
148 /// the list of nodes defining the subelements, i.e.
149 /// subElementNodes[INDEX2(i,s,BasisFunctions->numShape*numSides)] is
150 /// the i-th node in the s-th subelement
151 int subElementNodes[MAX_numNodes*MAX_numSides*MAX_numSubElements];
152
153 /// deprecated
154 int numRelevantGeoNodes;
155 int relevantGeoNodes[MAX_numNodes];
156
157 /// if the element is allowed as a face element, numNodesOnFace defines
158 /// the number of nodes defining the face
159 int numNodesOnFace;
160
161 // the following lists are only used for face elements defined by
162 // numNodesOnFace>0:
163
164 /// list of the nodes defining the face
165 int faceNodes[MAX_numNodes];
166
167 // shiftNodes={-1} or reverseNodes={-1} are ignored.
168 /// defines a permutation of the nodes which rotates the nodes on the face
169 int shiftNodes[MAX_numNodes];
170 /// reverses the order of the nodes on a face. The permutation has to keep
171 /// 0 fixed.
172 int reverseNodes[MAX_numNodes];
173 };
174
175
176 /// this struct holds the realization of a reference element
177 struct ReferenceElement {
178 /// constructor with type ID and integration order
179 ReferenceElement(ElementTypeId id, int order);
180
181 /// destructor
182 ~ReferenceElement();
183
184 /// returns the element information structure for the given type id
185 static const ReferenceElementInfo* getInfo(ElementTypeId id);
186
187 /// returns the element type id from its textual representation
188 static ElementTypeId getTypeId(const char*);
189
190 ///
191 int getNumNodes() const { return Type->numNodes; }
192
193 /// type of the reference element
194 const ReferenceElementInfo* Type;
195 /// type of the linear reference element
196 const ReferenceElementInfo* LinearType;
197 /// used integration order
198 int integrationOrder;
199 int numNodes;
200 int numLocalDim;
201 int numLinearNodes;
202 const_ShapeFunction_ptr Parametrization;
203 const_ShapeFunction_ptr BasisFunctions;
204 const_ShapeFunction_ptr LinearBasisFunctions;
205 /// pointer to derivatives to basis function corresponding to the
206 /// Parametrization of quad points
207 double* DBasisFunctionDv;
208 /// if true indicates that DBasisFunctionDv is shared with another object
209 /// which is managing it
210 bool DBasisFunctionDvShared;
211 };
212
213 typedef boost::shared_ptr<ReferenceElement> ReferenceElement_ptr;
214 typedef boost::shared_ptr<const ReferenceElement> const_ReferenceElement_ptr;
215
216 } // namespace finley
217
218 #endif // __FINLEY_REFERENCEELEMENTS_H__
219

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26