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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4499 - (show annotations)
Tue Jul 16 05:42:19 2013 UTC (6 years, 10 months ago) by caltinay
File MIME type: text/plain
File size: 5829 byte(s)
finley: mainly const'ness fixes, some formatting.

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26