NeoPZ
TPZRefCube.cpp
Go to the documentation of this file.
1 
5 #include "TPZGeoCube.h"
6 #include "TPZRefCube.h"
7 #include "pzshapecube.h"
8 #include "TPZGeoElement.h"
9 #include "pzgeoelside.h"
10 #include "pzgeoel.h"
11 #include "pzgmesh.h"
12 
13 using namespace pzshape;
14 using namespace std;
15 
16 namespace pzrefine {
17  static int nsubeldata[27] = {1,1,1,1,1,1,1,1,3,3,3,3,3,3,3,3,3,3,3,3,9,9,9,9,9,9,27};
18 
19  static int subeldata[27][27][2] = {
20  /*00*/{{0,0}},
21  /*01*/{{1,1}},
22  /*02*/{{2,2}},
23  /*03*/{{3,3}},
24  /*04*/{{4,4}},
25  /*05*/{{5,5}},
26  /*06*/{{6,6}},
27  /*07*/{{7,7}},
28  /*08*/{{0,1},{0,8},{1,8}},
29  /*09*/{{1,2},{1,9},{2,9}},
30  /*10*/{{2,3},{2,10},{3,10}},
31  /*11*/{{0,3},{0,11},{3,11}},
32  /*12*/{{0,4},{0,12},{4,12}},
33  /*13*/{{1,5},{1,13},{5,13}},
34  /*14*/{{2,6},{2,14},{6,14}},
35  /*15*/{{3,7},{3,15},{7,15}},
36  /*16*/{{4,5},{4,16},{5,16}},
37  /*17*/{{5,6},{5,17},{6,17}},
38  /*18*/{{6,7},{6,18},{7,18}},
39  /*19*/{{4,7},{4,19},{7,19}},
40  /*20*/{{0,2},{0,9},{0,10},{2,8},{2,11},{0,20},{1,20},{2,20},{3,20}},
41  /*21*/{{0,5},{0,13},{0,16},{5,8},{5,12},{0,21},{1,21},{4,21},{5,21}},
42  /*22*/{{1,6},{1,14},{1,17},{6,9},{6,13},{1,22},{2,22},{5,22},{6,22}},
43  /*23*/{{2,7},{2,15},{2,18},{7,10},{7,14},{2,23},{3,23},{6,23},{7,23}},
44  /*24*/{{0,7},{0,15},{0,19},{7,11},{7,12},{0,24},{3,24},{4,24},{7,24}},
45  /*25*/{{4,6},{4,17},{4,18},{6,16},{6,19},{4,25},{5,25},{6,25},{7,25}},
46  /*26*/{{0,14},{0,17},{0,18},{6,8},{6,11},{6,12},{0,26},{1,26},{2,26},{3,26},{4,26},{5,26},{6,26},
47  {7,26},{0,22},{0,23},{0,25},{1,25},{2,21},{2,24},{2,25},{3,25},{4,22},{4,23},{6,21},{6,24},{0,6}}
48  };
49 
50  static int MidSideNodes[19][2] = {
51  {0,1},{1,2},{2,3},{3,0},{4,0},{5,1},
52  {6,2},{7,3},{4,5},{5,6},{6,7},{7,4}, //lados
53  {0,2},{0,5},{1,6},{2,7},{0,7},{4,6}, //faces
54  {0,6} };//centro
55 
56  static REAL MidCoord[19][3] = { {0.,-1.,-1.},{1.,0.,-1.},{0.,1.,-1.},{-1.,0.,-1.},{-1.,-1.,0.},{1.,-1.,0.},
57  {1.,1.,0.},{-1.,1.,0.},{0.,-1.,1.},{1.,0.,1.},{0.,1.,1.},{-1.,0.,1.},
58  {0.,0.,-1.},{0.,-1.,0.},{1.,0.,0.},{0.,1.,0.},{-1.,0.,0.},{0.,0.,1.},{0.,0.,0.} };
59 
65  const int NumInNeigh = 19;
66  static int InNeigh[8][NumInNeigh][3] = {
67  {{1,1,0},{2,1,3},{3,3,0},{4,4,0},{5,1,4},{6,1,7},{7,3,4},{9,1,11},{10,3,8},{13,1,12},{14,1,15},{15,3,12},{16,4,8},{17,1,19},{18,3,16},{19,4,11},{22,1,24},{23,3,21},{25,4,20}},
68  {{0,0,1},{2,2,1},{3,2,0},{4,5,0},{5,5,1},{6,2,5},{7,2,4},{10,2,8},{11,0,9},{12,0,13},{14,2,13},{15,2,12},{16,5,8},{17,5,9},{18,2,16},{19,5,11},{23,2,21},{24,0,22},{25,5,20}},
69  {{0,3,1},{1,1,2},{3,3,2},{4,3,5},{5,6,1},{6,6,2},{7,6,3},{8,1,10},{11,3,9},{12,3,13},{13,1,14},{15,3,14},{16,6,8},{17,6,9},{18,6,10},{19,6,11},{21,1,23},{24,3,22},{25,6,20}},
70  {{0,0,3},{1,0,2},{2,2,3},{4,7,0},{5,4,2},{6,2,7},{7,7,3},{8,0,10},{9,2,11},{12,0,15},{13,0,14},{14,2,15},{16,7,8},{17,2,19},{18,7,10},{19,7,11},{21,0,23},{22,2,24},{25,7,20}},
71  {{0,0,4},{1,0,5},{2,5,3},{3,0,7},{5,5,4},{6,5,7},{7,7,4},{8,0,16},{9,0,17},{10,0,18},{11,0,19},{13,5,12},{14,5,15},{15,7,12},{17,5,19},{18,7,16},{20,0,25},{22,5,24},{23,7,21}},
72  {{0,4,1},{1,1,5},{2,1,6},{3,6,0},{4,4,5},{6,6,5},{7,6,4},{8,1,16},{9,1,17},{10,1,18},{11,4,9},{12,4,13},{14,6,13},{15,6,12},{18,6,16},{19,4,17},{20,1,25},{23,6,21},{24,4,22}},
73  {{0,7,1},{1,5,2},{2,2,6},{3,7,2},{4,7,5},{5,5,6},{7,7,6},{8,5,10},{9,2,17},{10,2,18},{11,7,9},{12,7,13},{13,5,14},{15,7,14},{16,5,18},{19,7,17},{20,2,25},{21,5,23},{24,7,22}},
74  {{0,4,3},{1,0,6},{2,3,6},{3,3,7},{4,4,7},{5,4,6},{6,6,7},{8,4,10},{9,3,17},{10,3,18},{11,3,19},{12,4,15},{13,4,14},{14,6,15},{16,4,18},{17,6,19},{20,3,25},{21,4,23},{22,6,24}} };
75 
79  static int CornerSons[8][8] = {
80  {0,8,20,11,12,21,26,24},{8,1,9,20,21,13,22,26},{20,9,2,10,26,22,14,23},
81  {11,20,10,3,24,26,23,15},{12,21,26,24,4,16,25,19},{21,13,22,26,16,5,17,25},
82  {26,22,14,23,25,17,6,18},{24,26,23,15,19,25,18,7} };
83 
84  static REAL buildt[8][27][4][3] = {//por colunas
85  /*S0*/{
86  /*00*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{-1.,-1.,-1.}},
87  /*01*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
88  /*02*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
89  /*03*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
90  /*04*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
91  /*05*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
92  /*06*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
93  /*07*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
94  /*08*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
95  /*09*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,-.5,0.}},
96  /*10*/{{-.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
97  /*11*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
98  /*12*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
99  /*13*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,-.5,0.}},
100  /*14*/{{0.,0.,0.5},{0.,0.,0.},{0.,0.,0.},{0.,0.,-0.5}},
101  /*15*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,-.5,0.}},
102  /*16*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
103  /*17*/{{0.,0.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,-0.5,0.}},
104  /*18*/{{-0.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-0.5,0.,0.}},
105  /*19*/{{-.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
106  /*20*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{-.5,-.5,0.}},
107  /*21*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{-.5,-.5,0.}},
108  /*22*/{{0.,0.5,0.},{0.,0.,0.5},{0.,0.,0.},{0.,-0.5,-0.5}},
109  /*23*/{{0.5,0.,0.},{0.,0.,0.5},{0.,0.,0.},{-0.5,0.,-0.5}},
110  /*24*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{-.5,-.5,0.}},
111  /*25*/{{0.5,0.,0.},{0.,0.5,0.},{0.,0.,0.},{-0.5,-0.5,0.}},
112  /*26*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,.5},{-.5,-.5,-.5}}},
113  /*S1*/{
114  /*00*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
115  /*01*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{1,-1,-1}},
116  /*02*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
117  /*03*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
118  /*04*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
119  /*05*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
120  /*06*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
121  /*07*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
122  /*08*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
123  /*09*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
124  /*10*/{{-.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
125  /*11*/{{0.,-.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,-.5,0.}},
126  /*12*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,-.5,0.}},
127  /*13*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
128  /*14*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,-.5,0.}},
129  /*15*/{{0.,0.,0.5},{0.,0.,0.},{0.,0.,0.},{0.,0.,-0.5}},
130  /*16*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
131  /*17*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
132  /*18*/{{-0.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.5,0.,0.}},
133  /*19*/{{0.,-0.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,-0.5,0.}},
134  /*20*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{.5,-.5,0.}},
135  /*21*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{.5,-.5,0.}},
136  /*22*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{-.5,-.5,0.}},
137  /*23*/{{0.5,0.,0.},{0.,0.,0.5},{0.,0.,0.},{0.5,0.,-0.5}},
138  /*24*/{{0.,0.5,0.},{0.,0.,0.5},{0.,0.,0.},{0.,-0.5,-0.5}},
139  /*25*/{{0.5,0.,0.},{0.,0.5,0.},{0.,0.,0.},{0.5,-0.5,0.}},
140  /*26*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,.5},{.5,-.5,-.5}}},
141  /*S2*/{
142  /*00*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
143  /*01*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
144  /*02*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{1,1,-1}},
145  /*03*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
146  /*04*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
147  /*05*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
148  /*06*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
149  /*07*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
150  /*08*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
151  /*09*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
152  /*10*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
153  /*11*/{{0.,-.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,.5,0.}},
154  /*12*/{{0.,0.,0.5},{0.,0.,0.},{0.,0.,0.},{0.,0.,-0.5}},
155  /*13*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,-.5,0.}},
156  /*14*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
157  /*15*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,-.5,0.}},
158  /*16*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
159  /*17*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
160  /*18*/{{-.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
161  /*19*/{{0.,-0.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.5,0.}},
162  /*20*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{.5,.5,0.}},
163  /*21*/{{0.5,0.,0.},{0.,0.,0.5},{0.,0.,0.},{0.5,0.,-0.5}},
164  /*22*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{.5,-.5,0.}},
165  /*23*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{.5,-.5,0.}},
166  /*24*/{{0.,0.5,0.},{0.,0.,0.5},{0.,0.,0.},{0.,0.5,-0.5}},
167  /*25*/{{0.5,0.,0.},{0.,0.5,0.},{0.,0.,0.},{0.5,0.5,0.}},
168  /*26*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,.5},{.5,.5,-.5}}},
169  /*S3*/{
170  /*00*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
171  /*01*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
172  /*02*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
173  /*03*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{-1,1,-1}},
174  /*04*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
175  /*05*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
176  /*06*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
177  /*07*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
178  /*08*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
179  /*09*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,.5,0.}},
180  /*10*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
181  /*11*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
182  /*12*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,-.5,0.}},
183  /*13*/{{0.,0.,.5},{0.,0.,0.},{0.,0.,0.},{0.,0.,-.5}},
184  /*14*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,-.5,0.}},
185  /*15*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
186  /*16*/{{0.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-0.5,0.,0.}},
187  /*17*/{{0.,0.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.5,0.}},
188  /*18*/{{-.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
189  /*19*/{{-.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
190  /*20*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{-.5,.5,0.}},
191  /*21*/{{0.5,0.,0.},{0.,0.,0.5},{0.,0.,0.},{-0.5,0.,-0.5}},
192  /*22*/{{0.,0.5,0.},{0.,0.,0.5},{0.,0.,0.},{0.,0.5,-0.5}},
193  /*23*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{-.5,-.5,0.}},
194  /*24*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{.5,-.5,0.}},
195  /*25*/{{0.5,0.,0.},{0.,0.5,0.},{0.,0.,0.},{-0.5,0.5,0.}},
196  /*26*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,.5},{-.5,.5,-.5}}},
197  /*S4*/{
198  /*00*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
199  /*01*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
200  /*02*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
201  /*03*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
202  /*04*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{-1,-1,1}},
203  /*05*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
204  /*06*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
205  /*07*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
206  /*08*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
207  /*09*/{{0.,0.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,-0.5,0.}},
208  /*10*/{{-0.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-0.5,0.,0.}},
209  /*11*/{{-.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
210  /*12*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
211  /*13*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,.5,0.}},
212  /*14*/{{0.,0.,0.5},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.5}},
213  /*15*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,.5,0.}},
214  /*16*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
215  /*17*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,-.5,0.}},
216  /*18*/{{-.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
217  /*19*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
218  /*20*/{{0.5,0.,0.},{0.,0.5,0.},{0.,0.,0.},{-0.5,-0.5,0.}},
219  /*21*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{-.5,.5,0.}},
220  /*22*/{{0.,0.5,0.},{0.,0.,0.5},{0.,0.,0.},{0.,-0.5,0.5}},
221  /*23*/{{0.5,0.,0.},{0.,0.,0.5},{0.,0.,0.},{-0.5,0.,0.5}},
222  /*24*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{-.5,.5,0.}},
223  /*25*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{-.5,-.5,0.}},
224  /*26*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,.5},{-.5,-.5,.5}}},
225  /*S5*/{
226  /*00*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
227  /*01*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
228  /*02*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
229  /*03*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
230  /*04*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
231  /*05*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{1,-1,1}},
232  /*06*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
233  /*07*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
234  /*08*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
235  /*09*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
236  /*10*/{{-0.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.5,0.,0.}},
237  /*11*/{{0.,-0.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,-0.5,0.}},
238  /*12*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,.5,0.}},
239  /*13*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
240  /*14*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,.5,0.}},
241  /*15*/{{0.,0.,0.5},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.5}},
242  /*16*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
243  /*17*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
244  /*18*/{{-.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
245  /*19*/{{0.,-.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,-.5,0.}},
246  /*20*/{{0.5,0.,0.},{0.,0.5,0.},{0.,0.,0.},{0.5,-0.5,0.}},
247  /*21*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{.5,.5,0.}},
248  /*22*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{-.5,.5,0.}},
249  /*23*/{{0.5,0.,0.},{0.,0.,0.5},{0.,0.,0.},{0.5,0.,0.5}},
250  /*24*/{{0.,0.5,0.},{0.,0.,0.5},{0.,0.,0.},{0.,-0.5,0.5}},
251  /*25*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{.5,-.5,0.}},
252  /*26*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,.5},{.5,-.5,.5}}},
253  /*S6*/{
254  /*00*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
255  /*01*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
256  /*02*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
257  /*03*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
258  /*04*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
259  /*05*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
260  /*06*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{1,1,1}},
261  /*07*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
262  /*08*/{{0.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.5,0.,0.}},
263  /*09*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
264  /*10*/{{-.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
265  /*11*/{{0.,-0.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.5,0.}},
266  /*12*/{{0.,0.,0.5},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.5}},
267  /*13*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,.5,0.}},
268  /*14*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
269  /*15*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,.5,0.}},
270  /*16*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
271  /*17*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
272  /*18*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
273  /*19*/{{0.,-.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,.5,0.}},
274  /*20*/{{0.5,0.,0.},{0.,0.5,0.},{0.,0.,0.},{0.5,0.5,0.}},
275  /*21*/{{0.5,0.,0.},{0.,0.,0.5},{0.,0.,0.},{0.5,0.,0.5}},
276  /*22*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{.5,.5,0.}},
277  /*23*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{.5,.5,0.}},
278  /*24*/{{0.,0.5,0.},{0.,0.,0.5},{0.,0.,0.},{0.,0.5,0.5}},
279  /*25*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{.5,.5,0.}},
280  /*26*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,.5},{.5,.5,.5}}},
281  /*S7*/{
282  /*00*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
283  /*01*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
284  /*02*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
285  /*03*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
286  /*04*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
287  /*05*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
288  /*06*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
289  /*07*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{-1,1,1}},
290  /*08*/{{0.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-0.5,0.,0.}},
291  /*09*/{{0.,0.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.5,0.}},
292  /*10*/{{-.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
293  /*11*/{{-.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
294  /*12*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,.5,0.}},
295  /*13*/{{0.,0.,0.5},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.5}},
296  /*14*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,.5,0.}},
297  /*15*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
298  /*16*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
299  /*17*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,.5,0.}},
300  /*18*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
301  /*19*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
302  /*20*/{{0.5,0.,0.},{0.,0.5,0.},{0.,0.,0.},{-0.5,0.5,0.}},
303  /*21*/{{0.5,0.,0.},{0.,0.,0.5},{0.,0.,0.},{-0.5,0.,0.5}},
304  /*22*/{{0.,0.5,0.},{0.,0.,0.5},{0.,0.,0.},{0.,0.5,0.5}},
305  /*23*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{-.5,.5,0.}},
306  /*24*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{.5,.5,0.}},
307  /*25*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{-.5,.5,0.}},
308  /*26*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,.5},{-.5,.5,.5}}}
309  };
310 
311  static int fatherside[8][27] = {
312  /*00*/{0,8,20,11,12,21,26,24,8,20,20,11,12,21,26,24,21,26,26,24,20,21,26,26,24,26,26},
313  /*01*/{8,1,9,20,21,13,22,26,8,9,20,20,21,13,22,26,21,22,26,26,20,21,22,26,26,26,26},
314  /*02*/{20,9,2,10,26,22,14,23,20,9,10,20,26,22,14,23,26,22,23,26,20,26,22,23,26,26,26},
315  /*03*/{11,20,10,3,24,26,23,15,20,20,10,11,24,26,23,15,26,26,23,24,20,26,26,23,24,26,26},
316  /*04*/{12,21,26,24,4,16,25,19,21,26,26,24,12,21,26,24,16,25,25,19,26,21,26,26,24,25,26},
317  /*05*/{21,13,22,26,16,5,17,25,21,22,26,26,21,13,22,26,16,17,25,25,26,21,22,26,26,25,26},
318  /*06*/{26,22,14,23,25,17,6,18,26,22,23,26,26,22,14,23,25,17,18,25,26,26,22,23,26,25,26},
319  /*07*/{24,26,23,15,19,25,18,7,26,26,23,24,24,26,23,15,25,25,18,19,26,26,26,23,24,25,26},
320  };
321 
322  //Into Divides is necesary to consider the connectivity with the all neighboards
323  void TPZRefCube::Divide(TPZGeoEl *geo,TPZVec<TPZGeoEl *> &SubElVec) {
324 
325  int i;
326  if(geo->HasSubElement()) {
327  SubElVec.Resize(NSubEl);
328  for(i=0;i<NSubEl;i++) SubElVec[i] = geo->SubElement(i);
329  return;//If exist fSubEl return this sons
330  }
331  int j,sub,matid=geo->MaterialId();
332  int64_t index;
333  int np[TPZShapeCube::NSides];//guarda conectividades dos 8 subelementos
334 
335  for(j=0;j<TPZShapeCube::NCornerNodes;j++) np[j] = geo->NodeIndex(j);
336  for(sub=TPZShapeCube::NCornerNodes;sub<TPZShapeCube::NSides;sub++) {
337  NewMidSideNode(geo,sub,index);
338  np[sub] = index;
339  }
340  // creating new subelements
341  for(i=0;i<TPZShapeCube::NCornerNodes;i++) {
342  TPZManVector<int64_t>cornerindexes(TPZShapeCube::NCornerNodes);
343  for(int j=0;j<TPZShapeCube::NCornerNodes;j++) cornerindexes[j] = np[CornerSons[i][j]];
344  int64_t index;
345  TPZGeoEl *subel = geo->CreateGeoElement(ECube,cornerindexes,matid,index);
346  geo->SetSubElement(i , subel);
347  }
348 
349  SubElVec.Resize(NSubEl);
350  for(sub=0;sub<NSubEl;sub++) {
351  SubElVec[sub] = geo->SubElement(sub);
352  SubElVec[sub]->SetFather(geo);
353  SubElVec[sub]->SetFatherIndex(geo->Index());
354  }
355  for(i=0;i<NSubEl;i++) {//conectividades entre os filhos : viz interna
356  for(j=0;j<NumInNeigh;j++) { //lado do subel numero do filho viz. lado do viz.
357  geo->SubElement(i)->SetNeighbour(InNeigh[i][j][0],TPZGeoElSide(geo->SubElement(InNeigh[i][j][1]),InNeigh[i][j][2]));
358  }
359  }
360 
362  }
363 
364  void TPZRefCube::NewMidSideNode(TPZGeoEl *gel,int side,int64_t &index) {
365 
366  MidSideNodeIndex(gel,side,index);
367  if(index < 0) {
368  TPZGeoElSide gelside = gel->Neighbour(side);
369  if(gelside.Element()) {
370  while(gelside.Element() != gel) {
371  gelside.Element()->MidSideNodeIndex(gelside.Side(),index);
372  if(index!=-1) return;
373  gelside = gelside.Neighbour();
374  }
375  }
376  TPZVec<REAL> par(3,0.);
377  TPZVec<REAL> coord(3,0.);
378  if(side < TPZShapeCube::NCornerNodes) {
379  index = gel->NodeIndex(side);
380  return;
381  }
382  //aqui side = 8 a 26
383  side-=TPZShapeCube::NCornerNodes;//0,1,..,18
384  par[0] = MidCoord[side][0];
385  par[1] = MidCoord[side][1];
386  par[2] = MidCoord[side][2];
387  gel->X(par,coord);
388  index = gel->Mesh()->NodeVec().AllocateNewElement();
389  gel->Mesh()->NodeVec()[index].Initialize(coord,*gel->Mesh());
390  }
391  }
392 
393  void TPZRefCube::MidSideNodeIndex(const TPZGeoEl *gel,int side,int64_t &index) {
394  index = -1;
395  if(side<0 || side>TPZShapeCube::NSides-1) {
396  PZError << "TPZRefCube::MidSideNodeIndex. Bad parameter side = " << side << endl;
397  return;
398  }
399  //sides 0 a 7
400  if(side<TPZShapeCube::NCornerNodes) {//o nó medio do lado 0 é o 0 etc.
401  index = (gel)->NodeIndex(side);
402  return;
403  }
404  //o nó medio da face é o centro e o nó medio do centro é o centro
405  //como nó de algum filho se este existir
406  //caso tenha filhos é o canto de algum filho, se não tiver filhos retorna -1
407  if(gel->HasSubElement()) {
409  index=(gel->SubElement(MidSideNodes[side][0]))->NodeIndex(MidSideNodes[side][1]);
410  }
411  }
412 
413  void TPZRefCube::GetSubElements(const TPZGeoEl *father,int side, TPZStack<TPZGeoElSide> &subel){
414 
415 // subel.Resize(0);
416  if(side<0 || side>TPZShapeCube::NSides || !father->HasSubElement()){
417  PZError << "TPZRefCube::GetSubelements2 called with error arguments\n";
418  return;
419  }
420  int nsub = NSideSubElements(side);//nsubeldata[side];
421  for(int i=0;i<nsub;i++)
422  subel.Push(TPZGeoElSide(father->SubElement(subeldata[side][i][0]),
423  subeldata[side][i][1]));
424  }
425 
426  int TPZRefCube::NSideSubElements(int side) {
427  if(side<0 || side>TPZShapeCube::NSides-1){
428  PZError << "TPZRefCube::NSideSubelements2 called with error arguments\n";
429  return -1;
430  }
431  return nsubeldata[side];
432  }
433 
434  //int TPZRefCube::NSideSubElements(int side) {
435  // if(side < 0 || side > 26) {
436  // PZError << "TPZRefCube::NSideSubElements called for side " << side << endl;
437  // return 0;
438  // }
439  // if(side==26) return 8;//centro
440  // if(side>19 && side<26) return 4;//faces
441  // if(side>7) return 2;//lados
442  // return 1;//cantos
443  //}
444 
445 
446  TPZTransform<> TPZRefCube::GetTransform(int side,int whichsubel){
447 
448  if(side<0 || side>TPZShapeCube::NSides-1){
449  PZError << "TPZRefCube::GetTransform side out of range or father null\n";
450  return TPZTransform<>(0,0);
451  }
452  int smalldim = TPZShapeCube::SideDimension(side);
453  int fatherside = FatherSide(side,whichsubel);
454  int largedim = TPZShapeCube::SideDimension(fatherside);
455  TPZTransform<> trans(largedim,smalldim);
456  int i,j;
457  for(i=0; i<largedim; i++) {
458  for(j=0; j<smalldim; j++) {
459  trans.Mult()(i,j) = buildt[whichsubel][side][j][i];
460  }
461  trans.Sum() (i,0) = buildt[whichsubel][side][3][i];
462  }
463  return trans;
464  }
465 
466  int TPZRefCube::FatherSide(int side,int whichsubel){
467 
468  if(side<0 || side>TPZShapeCube::NSides-1){
469  PZError << "TPZRefCube::Father2 called error" << endl;
470  return -1;
471  }
472  return fatherside[whichsubel][side];
473  }
474 
475  int TPZRefCube::ClassId() const{
476  return Hash("TPZRefCube");
477  }
478 };
int AllocateNewElement()
Makes more room for new elements.
Definition: pzadmchunk.h:184
static int MidSideNodes[19][2]
Definition: TPZRefCube.cpp:50
Contains declaration of TPZGeoElSide class which represents an element and its side, and TPZGeoElSideIndex class which represents an TPZGeoElSide index.
int MaterialId() const
Returns the material index of the element.
Definition: pzgeoel.h:250
virtual void SetNeighbour(int side, const TPZGeoElSide &neighbour)=0
Fill in the data structure for the neighbouring information.
clarg::argInt nsub("-nsub", "number of substructs", 4)
static int subeldata[27][27][2]
Definition: TPZRefCube.cpp:19
groups all classes dedicated to the computation of shape functions
Definition: pzshapeextend.h:16
const TPZFMatrix< T > & Mult() const
Definition: pztrnsform.h:64
static int fatherside[8][27]
Definition: TPZRefCube.cpp:311
static int InNeigh[8][NumInNeigh][3]
Definition: TPZRefCube.cpp:66
Utility class which represents an element with its side. The Geometric approximation classes Geometry...
Definition: pzgeoelside.h:83
This class implements a simple vector storage scheme for a templated class T. Utility.
Definition: pzgeopoint.h:19
TPZGeoElSide Neighbour() const
Definition: pzgeoel.h:754
TPZGeoMesh * Mesh() const
Returns the mesh to which the element belongs.
Definition: pzgeoel.h:220
virtual int64_t NodeIndex(int i) const =0
Returns the index of the ith node the index is the location of the node in the nodevector of the mesh...
Contains TPZShapeCube class which implements the shape functions of a hexaedral element.
virtual TPZGeoEl * SubElement(int is) const =0
Returns a pointer to the subelement is.
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object reallocating the necessary storage, copying the existing objects to the new...
Definition: pzvec.h:373
Contains declaration of TPZMesh class which defines a geometrical mesh and contains a corresponding l...
void Push(const T object)
Pushes a copy of the object on the stack.
Definition: pzstack.h:80
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
Definition: pzgeoel.h:43
static int nsubeldata[27]
Definition: TPZRefCube.cpp:17
int64_t Index() const
Returns the index of the element within the element vector of the mesh.
Definition: pzgeoel.h:730
static int SideDimension(int side)
Returns the dimension of the side.
Definition: tpzcube.cpp:588
TPZAdmChunkVector< TPZGeoNode > & NodeVec()
Definition: pzgmesh.h:140
static int CornerSons[8][8]
Definition: TPZRefCube.cpp:79
const TPZFMatrix< T > & Sum() const
Definition: pztrnsform.h:66
virtual TPZGeoEl * CreateGeoElement(MElementType type, TPZVec< int64_t > &nodeindexes, int matid, int64_t &index)=0
Creates a geometric element according to the type of the father element.
Groups all classes which model the h refinement These classes are used as template arguments of...
Definition: pzrefpoint.cpp:15
virtual TPZGeoElSide Neighbour(int side)=0
Returns a pointer to the neighbour and the neighbourside along side of the current element...
Contains the TPZGeoCube class which implements the geometry of hexahedra element. ...
int32_t Hash(std::string str)
Definition: TPZHash.cpp:10
virtual void SetSubElement(int i, TPZGeoEl *gel)=0
Sets the subelement of index i.
virtual int HasSubElement() const =0
Return 1 if the element has subelements.
static REAL buildt[8][27][4][3]
Definition: TPZRefCube.cpp:84
TPZGeoEl * Element() const
Definition: pzgeoelside.h:162
virtual void X(TPZVec< REAL > &qsi, TPZVec< REAL > &result) const =0
Return the coordinate in real space of the point coordinate in the master element space...
This class implements a stack object. Utility.
Definition: pzcheckmesh.h:14
Definition: pzeltype.h:61
int Side() const
Definition: pzgeoelside.h:169
Implements an affine transformation between points in parameter space. Topology Utility.
Definition: pzmganalysis.h:14
Contains declaration of TPZGeoElement class which implements a generic geometric element with a unifo...
const int NumInNeigh
Definition: pzrefprism.cpp:97
static REAL MidCoord[19][3]
Definition: TPZRefCube.cpp:56
virtual void SetSubElementConnectivities()
Initializes the external connectivities of the subelements.
Definition: pzgeoel.cpp:563
Contains the TPZRefCube class which implements the uniform refinement of a geometric hexahedral eleme...
#define PZError
Defines the output device to error messages and the DebugStop() function.
Definition: pzerror.h:15
virtual void MidSideNodeIndex(int side, int64_t &index) const =0
Returns the midside node index along a side of the element.