1
#*******************************************************
3
# Copyright (c) 2003-2010 by University of Queensland
4
# Earth Systems Science Computational Center (ESSCC)
5
# http://www.uq.edu.au/esscc
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
11
#******************************************************/
13
# this code generates the Dudley_ReferenceElement_InfoList in ReferenceElements.c
16
"Point": (1, 1, "Point", [0] ),
17
"Line": (2, 2, "Point", [0,2, 2,1]),
18
"Tri":(4, 3, "Line", [0, 3, 5, 5, 4, 2, 3, 1, 4, 4, 5, 3]),
19
"Rec" :(4, 4, "Line", [0, 4, 8, 7, 7, 8, 6, 3, 4, 1, 5, 8, 8, 5, 2, 6] ),
20
"Tet": (8, 4, "Tri", [0, 4, 6, 7, 4, 1, 5, 8, 6, 5, 2, 9, 7, 8, 9, 3, 4, 5, 6, 8, 5, 9, 8, 6, 9, 7, 6, 8, 7, 4, 6, 8] ),
21
"Hex": (8, 8, "Rec", [0, 8, 20, 11, 12, 21, 26, 24, 8, 1, 9, 20, 21, 13, 22, 26, 11, 20, 10, 3, 24, 26, 23, 15, 20, 9, 2, 10, 26, 22, 14, 23, 12, 21, 26, 24, 4, 16, 25, 19, 21, 13, 22, 26, 16, 5, 17, 25, 24, 26, 23, 15, 19, 25, 18, 7, 26, 22, 14, 23, 25, 17, 6, 18] )
40
"Tet10" : [0,1,2,4,5,6],
41
"Tet16" : [0,1,2,4,5,6,7,8,9],
43
"Hex20" : [0,1,2,3,8,9,10,11],
44
"Hex27" : [0,1,2,3,8,9,10,11,20],
45
"Hex32" : [0,1,2,3,8,9,10,11,12,13,14,15]
62
"Tet10" : [0,1,2,4,5,6],
63
"Tet16" : [0,1,2,4,5,6,7,8,9],
65
"Hex20" : [0,1,2,3,8,9,10,11],
66
"Hex27" : [0,1,2,3,8,9,10,11,20],
67
"Hex32" : [0,1,2,3,8,9,10,11,12,13,14,15]
71
"Point1" : ( (0,),(-1,)),
72
"Line2" : ( (1,0),(-1,)),
73
"Line3" : ( (1,0,2),(-1,)),
74
"Line4" : ( (1,0,3,2),(-1,)),
75
"Tri3" : ( (1,2,0),(0,2,1)),
76
"Tri6" : ( (1,2,0,4,5,3),(0,2,1,5,4,3)),
77
"Tri9" : ( (1,2,0,5,6,7,8,3,4),(0,2,1,8,7,6,5,4,3)),
78
"Tri10" : ( (1,2,0,5,6,7,8,3,4,9),(0,2,1,8,7,6,5,4,3,9)),
79
"Rec4" : ( (1,2,3,0),(0,3,2,1)),
80
"Rec8" : ( (1,2,3,0,5,6,7,4),(0,3,2,1,7,6,5,4)),
81
"Rec9" : ( (1,2,3,0,5,6,7,4,8),(0,3,2,1,7,6,5,4,8)),
82
"Rec12" : ( (1,2,3,0,6,7,8,9,10,11,4,5),(0,3,2,1,11,10,9,8,7,6,5,4)) ,
83
"Rec16" : ( (1,2,3,0,6,7,8,9,10,11,4,5,13,14,15,12),(0,3,2,1,11,10,9,8,7,6,5,4,12,15,14,13)),
84
"Tet4" : ( (-1,),(-1,)),
85
"Tet10" : ( (-1,),(-1,)),
86
"Tet16" : ( (-1,),(-1,)),
87
"Hex8" : ( (-1,),(-1,)),
88
"Hex20" : ( (-1,),(-1,)),
89
"Hex27" : ( (-1,),(-1,)),
90
"Hex32" : ( (-1,),(-1,)),
91
"Line2Face" : ( (0,1,2),(-1,)),
92
"Line3Face" : ( (0,1,2),(-1,)),
93
"Line4Face" : ( (0,1,2),(-1,)),
94
"Tri3Face" : ( (1,0,2), (-1,)),
95
"Tri6Face" : ( (1,0,2,3,5,4),(-1,)),
96
"Tri9Face" : ( (1,0,2,4,3,7,8,6,5),(-1,)),
97
"Tri10Face" : ( (1,0,2,4,3,7,8,6,5,9),(-1,)),
98
"Rec4Face" : ( (1,0,3,2),(-1,)),
99
"Rec8Face" : ( (1,0,3,2,4,7,6,5),(-1,)),
100
"Rec9Face" : ( (1,0,3,2,4,7,6,5,8),(-1,)),
101
"Rec12Face" : ( (1,0,3,2,5,4,11,10,9,8,7,6),(-1,)),
102
"Rec16Face" : ( (1,0,3,2,5,4,11,10,9,8,7,6,13,12,15,14),(-1,)),
103
"Tet4Face" : ( (1,2,0,3),(0,2,1,3)) ,
104
"Tet10Face" : ( (1,2,0,3,5,6,4,8,9,7),(0,2,1,3,6,7,9,8)),
105
"Tet16Face" : ( (1,2,0,3,6,7,8,9,4,5,11,12,10,14,15,13),(0,2,1,3,9,8,7,6,5,4,9,8,7,6,10,12,11,13,15,14)),
106
"Hex8Face" : ( (1,2,3,0,5,6,7,4),(0,3,2,1,4,7,6,5)),
107
"Hex20Face" : ( (1,2,3,0,5,6,7,4,9,10,11,8,13,14,15,12,17,18,19,16),(0,3,2,1,4,7,6,5,11,10,9,8,12,15,14,13,19,18,17,16)),
108
"Hex27Face" : ( (1,2,3,0,5,6,7,4,9,10,11,8,13,14,15,12,17,18,19,16,20,22,23,24,22,25,26),(0,3,2,1,4,7,6,5,11,10,9,8,12,15,14,13,19,18,17,16,20,24,23,22,21,25,26)),
109
"Hex32Face" : ( (1,2,3,0,5,6,7,4,10,11,12,13,14,15,8,9,17,18,19,16,21,22,23,20,26,27,28,29,30,31,34,25), (0,3,2,1,4,7,6,5,15,14,13,12,11,10,9,8,16,19,18,17,20,23,22,21,31,30,29,28,27,26,25,24))
111
def listToArrayStr(l):
128
outall="Dudley_ReferenceElementInfo Dudley_ReferenceElement_InfoList[]={\n"
130
for name in ["Point1", "Line2", "Tri3", "Tet4", "Line2Face", "Tri3Face", "Tet4Face" ]:
136
for z in [ "Point", "Line", "Tri", "Tet"] :
137
if name.startswith(z):
140
if s.find("Macro")>=0:
142
if s.find("Macro")>0: n=s[:s.find("Macro")]
143
s=s[s.find("Macro")+5:]
144
if s.find("Face")>=0:
146
if s.find("Face")>0: n=s[:s.find("Face")]
147
s=s[s.find("Face")+4:]
148
if s.find("_Contact")>=0:
150
if s.find("_Contact")>0: n=s[:s.find("_Contact")]
151
s=s[s.find("_Contact")+8:]
154
numLinearNodes=GEOBASE[z][1]
156
Quadrature=GEOBASE[z][2]
159
Parametrization="%s%s"%(z,n)
168
numSubElements=GEOBASE[z][0]
169
BasisFunctions="%s%s"%(z,numLinearNodes)
170
subElementNodes=GEOBASE[z][3]
173
BasisFunctions=Parametrization
174
subElementNodes=[ i for i in xrange(numNodes) ]
176
linearTypeId="%s%s"%(z,numLinearNodes)
177
linearNodes=[ i for i in xrange(numLinearNodes) ]
178
if isFace: linearTypeId+="Face"
181
linearTypeId+="_Contact"
182
linearNodes+=[ n+i for i in xrange(numLinearNodes) ]
185
relevantGeoNodes=RELEVANTGEO["%s%s"%(z,n)]
187
relevantGeoNodes=[ i for i in xrange(n) ]
195
faceNodes=FACENODES["%s%s"%(z,n)]
196
shiftNodes = SHIFTNODES["%s%sFace"%(z,n)][0]
197
reverseNodes = SHIFTNODES["%s%sFace"%(z,n)][1]
199
faceNodes=[ i for i in xrange(numNodes) ]
200
shiftNodes = SHIFTNODES["%s%s"%(z,n)][0]
201
reverseNodes = SHIFTNODES["%s%s"%(z,n)][1]
204
out = '{ %s, "%s", %d, %d, %d, %s, %s,\n %s, %sQuad, %sShape, %sShape,\n %s,\n %s, %s,\n %s, %s,\n %s,\n %s },\n'% \
205
(name, name, numNodes, numSubElements, numSides, listToArrayStr(offsets), linearTypeId, listToArrayStr(linearNodes),
206
Quadrature, Parametrization, BasisFunctions, listToArrayStr(subElementNodes),
207
len(relevantGeoNodes), listToArrayStr(relevantGeoNodes),
208
LENLEN(faceNodes), listToArrayStr(faceNodes), listToArrayStr(shiftNodes), listToArrayStr(reverseNodes) )
210
out = '{ %s, "%s", %d, %d, %d, %s, %s,\n %s, %s, %s, %s,\n %s,\n %s, %s,\n %s, %s,\n %s,\n %s }\n'% \
211
("NoRef", "noElement", 0, 0, 0, listToArrayStr([0]), "NoRef", listToArrayStr([0]),
212
"NoQuad", "NoShape", "NoShape", listToArrayStr([0]),
213
-1, listToArrayStr([0]), -1, listToArrayStr([0]), listToArrayStr([0]), listToArrayStr([0]) )