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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6651 - (show annotations)
Wed Feb 7 02:12:08 2018 UTC (20 months, 1 week ago) by jfenwick
File MIME type: text/plain
File size: 5891 byte(s)
Make everyone sad by touching all the files

Copyright dates update

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26