NeoPZ
pzrefprism.cpp
Go to the documentation of this file.
1 
6 #include "pzrefprism.h"
7 #include "pzgeoprism.h"
8 #include "pzshapeprism.h"
9 #include "TPZGeoElement.h"
10 #include "pzgeoel.h"
11 #include "pzgmesh.h"
12 #include "pzgeoelside.h"
13 
14 using namespace pzshape;
15 using namespace std;
16 
17 namespace pzrefine {
18 
19 
20  static int nsubeldata[21] = {1,1,1,1,1,1,3,3,3,3,3,3,3,3,3,7,9,9,9,7,21};
21 
22  static int subeldata[21][21][2] = {
23  /*00*/{{0,0}},
24  /*01*/{{1,1}},
25  /*02*/{{2,2}},
26  /*03*/{{4,3}},
27  /*04*/{{5,4}},
28  /*05*/{{6,5}},
29  /*06*/ //{{0,6},{0,1},{1,6}},
30  {{0,1},{0,6},{1,6}},
31  /*07*/ //{{1,7},{1,2},{2,7}},
32  {{1,2},{1,7},{2,7}},
33  /*08*/ //{{0,8},{0,2},{2,8}},
34  {{0,2},{0,8},{2,8}},
35  /*09*/ //{{0,9},{0,3},{4,9}},
36  {{0,3},{0,9},{4,9}},
37  /*10*/ //{{1,10},{1,4},{5,10}},
38  {{1,4},{1,10},{5,10}},
39  /*11*/ //{{2,11},{2,5},{6,11}},
40  {{2,5},{2,11},{6,11}},
41  /*12*/ //{{4,12},{4,4},{5,12}},
42  {{4,4},{4,12},{5,12}},
43  /*13*/ //{{5,13},{5,5},{6,13}},
44  {{5,5},{5,13},{6,13}},
45  /*14*/ //{{4,14},{4,5},{6,14}},
46  {{4,5},{4,14},{6,14}},
47  /*15*/ //{{0,15},{1,15},{2,15},{3,19},{0,7},{1,8},{2,6}},
48  {{0,7},{1,8},{2,6},{0,15},{1,15},{2,15},{3,19}},
49  /*16*/ //{{0,16},{1,16},{4,16},{5,16},{0,10},{0,12},{5,6},{5,9},{0,4}},
50  {{0,10},{0,12},{5,6},{5,9},{0,4},{0,16},{1,16},{4,16},{5,16}},
51  /*17*/ //{{1,17},{2,17},{5,17},{6,17},{1,11},{1,13},{6,7},{6,10},{1,5}},
52  {{1,11},{1,13},{6,7},{6,10},{1,5},{1,17},{2,17},{5,17},{6,17}},
53  /*18*/ //{{0,18},{2,18},{4,18},{6,18},{0,11},{0,14},{6,8},{6,9},{2,3}},
54  {{0,11},{0,14},{6,8},{6,9},{2,3},{0,18},{2,18},{4,18},{6,18}},
55  /*19*/ //{{4,19},{5,19},{6,19},{7,15},{4,13},{5,14},{6,12}},
56  {{4,13},{5,14},{6,12},{4,19},{5,19},{6,19},{7,15}},
57  /*20*/ //{{0,20},{1,20},{2,20},{3,20},{4,20},{5,20},{6,20},{7,20},{0,17},
58  // {0,19},{4,17},{1,18},{1,19},{5,18},{2,16},{2,19},{6,16},{3,15},
59  // {0,13},{1,14},{2,12}}
60  {{0,13},{1,14},{2,12},{0,20},{1,20},{2,20},{3,20},{4,20},{5,20},{6,20},{7,20},{0,17},
61  {0,19},{4,17},{1,18},{1,19},{5,18},{2,16},{2,19},{6,16},{3,15}}
62  };
63 
64  //Esta estrutura define os novos nós introduzidos pela divisão
65  //nos medios dos lados do pai. Os nós locais são dados pela or-
66  //denação crescente dos lados do pai. O par {a,b} na K-ésima
67  //linha da matriz define o nó medio no K-ésimo lado do pai como
68  //o canto local b do filho a.
69  //os cantos e interior do pai não entram nesta definição,
70  //primeiros 6 lados mais o último (total de 21 lados).
71  static int MidSideNodes[15][2] = {
72  {0,1},{1,2},{0,2},
73  {0,3},{1,4},{2,5}, //CORRIGIDO
74  {4,4},{5,5},{4,5},
75  {0,-10},//a face triangular inferior não tem nó medio
76  {0,4},{1,5},{2,3},//faces quadrilaterais
77  {0,-20},//a face triangular superior não tem nó medio
78  {0,-30}//o interior não tem nó medio
79  };
80  //coordadas dos nós nos medios dos lados do pai,
81  //dadas em ordem crescente dos lados do pai
82  static REAL MidCoord[15][3] = {
83  {0.5,0.,-1.},{0.5,0.5,-1.},{0.,0.5,-1.},//arestas
84  {0.0,0., 0.},{1.0,0.0, 0.},{0.,1.0, 0.},//arestas
85  {0.5,0., 1.},{0.5,0.5, 1.},{0.,0.5, 1.},//arestas //CORRIGIDO
86  {-99,-99,-99},//face triangular inferior: não existe
87  {0.5,0., 0.},{0.5,0.5, 0.},{0.,0.5, 0.},//faces quadriláterais
88  {-99,-99,-99},//face triangular superior: não existe
89  {-99,-99,-99}//interior não existe
90  };
91 
97  const int NumInNeigh = 19;
98  static int InNeigh[8][NumInNeigh][3] = {
99  {{1,1,0},{2,2,0},{3,4,0},{4,4,1},{5,4,2},{7,3,14},{10,1,9},{11,2,9},{12,4,6},{13,4,7},{14,4,8},{17,3,18},{19,4,15},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1}},
100  {{0,3,5},{2,2,1},{3,7,5},{4,5,1},{5,2,4},{8,3,13},{9,3,11},{11,2,10},{12,5,6},{13,5,7},{14,3,7},{18,3,17},{19,5,15},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1}},
101  {{0,3,3},{1,3,4},{3,7,3},{4,3,1},{5,6,2},{6,3,12},{9,3,9},{10,3,10},{12,3,6},{13,6,7},{14,6,8},{16,3,16},{19,6,15},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1}},
102  {{0,0,5},{1,5,2},{2,0,4},{3,0,2},{4,1,2},{5,0,1},{6,6,6},{7,5,8},{8,0,13},{9,0,11},{10,1,11},{11,0,10},{12,2,6},{13,1,8},{14,0,7},{15,7,19},{16,2,16},{17,1,18},{18,0,17}},
103  {{0,0,3},{1,5,0},{2,6,0},{4,5,3},{5,6,3},{6,0,12},{7,7,14},{8,0,14},{10,5,9},{11,6,9},{13,7,8},{15,0,19},{17,7,18},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1}},
104  {{0,1,3},{1,1,4},{2,6,1},{3,7,2},{5,6,4},{6,1,12},{7,1,13},{8,7,13},{9,7,11},{11,6,10},{14,7,7},{15,1,19},{18,7,17},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1}},
105  {{0,2,3},{1,7,4},{2,2,5},{3,7,0},{4,7,1},{6,7,12},{7,2,13},{8,2,14},{9,7,9},{10,7,10},{12,7,6},{15,2,19},{16,7,16},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1}},
106  {{0,4,5},{1,5,5},{2,4,4},{3,3,0},{4,1,5},{5,3,2},{6,6,12},{7,5,14},{8,4,13},{9,4,11},{10,5,11},{11,4,10},{12,2,12},{13,1,14},{14,3,8},{16,6,16},{17,5,18},{18,4,17},{19,3,15}}
107  };
108 
112  static int CornerSons[8][6] = {
113  {0,6,8,9,16,18},
114  {6,1,7,16,10,17},
115  {8,7,2,18,17,11},
116  {18,17,16,8,7,6}, //CORRIGIDO
117  {9,16,18,3,12,14},
118  {16,10,17,12,4,13},
119  {18,17,11,14,13,5},
120  {14,13,12,18,17,16}
121  };
122 
123 
124  static REAL buildt[8][21][4][3] = {//por colunas
125  /*S0*/{
126  /*00*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,-1}},
127  /*01*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
128  /*02*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
129  /*03*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
130  /*04*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
131  /*05*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
132  /*06*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
133  /*07*/{{-0.25,0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.25,0.}},
134  /*08*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
135  /*09*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
136  /*10*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,-.5,0.}},
137  /*11*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,-.5,0.}},
138  /*12*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
139  /*13*/{{-0.25,0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.25,0.}},
140  /*14*/{{-.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
141  /*15*/{{0.5,0.,0.},{0.,0.5,0.},{0.,0.,0.},{0.,0.,0.}},
142  /*16*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{-.5,-.5,0.}},
143  /*17*/{{-0.25,0.25,0.},{0.,0.,0.5},{0.,0.,0.},{0.25,0.25,-0.5}},
144  /*18*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{-.5,-.5,0.}},
145  /*19*/{{0.5,0.,0.},{0.,0.5,0.},{0.,0.,0.},{0.,0.,0.}},
146  /*20*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,.5},{0.,0.,-.5}}},
147  /*S1*/{
148  /*00*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
149  /*01*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{1.,0.,-1.}},
150  /*02*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
151  /*03*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
152  /*04*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
153  /*05*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
154  /*06*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
155  /*07*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
156  /*08*/{{0.,-0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.5,0.25,0.}},
157  /*09*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,-.5,0.}},
158  /*10*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
159  /*11*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,-.5,0.}},
160  /*12*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
161  /*13*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
162  /*14*/{{0.,-0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.5,0.25,0.}},
163  /*15*/{{0.5,0.,0.},{0.,0.5,0.},{0.,0.,0.},{0.5,0.,0.}},
164  /*16*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{.5,-.5,0.}},
165  /*17*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{-.5,-.5,0.}},
166  /*18*/{{0.,0.25,0.},{0.,0.,0.5},{0.,0.,0.},{0.5,0.25,-0.5}},
167  /*19*/{{0.5,0.,0.},{0.,0.5,0.},{0.,0.,0.},{0.5,0.,0.}},
168  /*20*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,.5},{.5,0.,-.5}}},
169  /*S2*/{
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.,1.,-1.}},
173  /*03*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
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.25,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.5,0.}},
177  /*07*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,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*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,-.5,0.}},
181  /*11*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
182  /*12*/{{0.25,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.5,0.}},
183  /*13*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
184  /*14*/{{-.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
185  /*15*/{{0.5,0.,0.},{0.,0.5,0.},{0.,0.,0.},{0.,0.5,0.}},
186  /*16*/{{0.25,0.,0.},{0.,0.,0.5},{0.,0.,0.},{0.25,0.5,-0.5}},
187  /*17*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{.5,-.5,0.}},
188  /*18*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{.5,-.5,0.}},
189  /*19*/{{0.5,0.,0.},{0.,0.5,0.},{0.,0.,0.},{0.,0.5,0.}},
190  /*20*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,.5},{0.,.5,-.5}}},
191  /*S3*/{
192  /*00*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
193  /*01*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
194  /*02*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
195  /*03*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
196  /*04*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
197  /*05*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
198  /*06*/{{0.25,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.5,0.}},
199  /*07*/{{0.,-0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.5,0.25,0.}},
200  /*08*/{{-0.25,0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.25,0.}},
201  /*09*/{{0.,-.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,-.5,0.}},
202  /*10*/{{0.,-.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,-.5,0.}},
203  /*11*/{{0.,-.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,-.5,0.}},
204  /*12*/{{0.25,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.5,0.}},
205  /*13*/{{0.,-0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.5,0.25,0.}},
206  /*14*/{{-0.25,0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.25,0.}},
207  /*15*/{{0.5,0.,0.},{0.5,-0.5,0.},{0.,0.,0.},{0.,0.5,0.}},
208  /*16*/{{0.25,0.,0.},{0.,0.,-0.5},{0.,0.,0.},{0.25,0.5,-0.5}},
209  /*17*/{{0.,-0.25,0.},{0.,0.,-0.5},{0.,0.,0.},{0.5,0.25,-0.5}},
210  /*18*/{{0.25,-0.25,0},{0,0,-0.5},{0.,0.,0.},{0.25,0.25,-0.5}},
211  /*19*/{{0.5,0.,0.},{0.5,-0.5,0.},{0.,0.,0.},{0.,0.5,0.}},
212  /*20*/{{.5,0.,0.},{.5,-.5,0.},{0.,0.,-.5},{0.,.5,-.5}}},
213  /*S4*/{
214  /*00*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
215  /*01*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
216  /*02*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
217  /*03*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,1.}},
218  /*04*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
219  /*05*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
220  /*06*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
221  /*07*/{{-0.25,0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.25,0.}},
222  /*08*/{{-.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
223  /*09*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
224  /*10*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,.5,0.}},
225  /*11*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,.5,0.}},
226  /*12*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
227  /*13*/{{-0.25,0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.25,0.}},
228  /*14*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
229  /*15*/{{0.5,0.,0.},{0.,0.5,0.},{0.,0.,0.},{0.,0.,0.}},
230  /*16*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{-.5,.5,0.}},
231  /*17*/{{-0.25,0.25,0.},{0.,0.,0.5},{0.,0.,0.},{0.25,0.25,0.5}},
232  /*18*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{-.5,.5,0.}},
233  /*19*/{{0.5,0.,0.},{0.,0.5,0.},{0.,0.,0.},{0.,0.,0.}},
234  /*20*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,.5},{0.,0.,.5}}},
235  /*S5*/{
236  /*00*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
237  /*01*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
238  /*02*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
239  /*03*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
240  /*04*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{1.,0.,1.}},
241  /*05*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
242  /*06*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
243  /*07*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
244  /*08*/{{0.,-0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.5,0.25,0.}},
245  /*09*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,.5,0.}},
246  /*10*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
247  /*11*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,.5,0.}},
248  /*12*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
249  /*13*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
250  /*14*/{{0.,-0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.5,0.25,0.}},
251  /*15*/{{0.5,0.,0.},{0.,0.5,0.},{0.,0.,0.},{0.5,0.,0.}},
252  /*16*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{.5,.5,0.}},
253  /*17*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{-.5,.5,0.}},
254  /*18*/{{0.,0.25,0.},{0.,0.,0.5},{0.,0.,0.},{0.5,0.25,0.5}},
255  /*19*/{{0.5,0.,0.},{0.,0.5,0.},{0.,0.,0.},{0.5,0.,0.}},
256  /*20*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,.5},{.5,0.,.5}}},
257  /*S6*/{
258  /*00*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
259  /*01*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
260  /*02*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
261  /*03*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
262  /*04*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
263  /*05*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,1.,1.}},
264  /*06*/{{0.25,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.5,0.}},
265  /*07*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
266  /*08*/{{-.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
267  /*09*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,.5,0.}},
268  /*10*/{{0.,.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,.5,0.}},
269  /*11*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
270  /*12*/{{0.25,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.5,0.}},
271  /*13*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
272  /*14*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
273  /*15*/{{0.5,0.,0.},{0.,0.5,0.},{0.,0.,0.},{0.,0.5,0.}},
274  /*16*/{{0.25,0.,0.},{0.,0.,0.5},{0.,0.,0.},{0.25,0.5,0.5}},
275  /*17*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{.5,.5,0.}},
276  /*18*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,0.},{.5,.5,0.}},
277  /*19*/{{0.5,0.,0.},{0.,0.5,0.},{0.,0.,0.},{0.,0.5,0.}},
278  /*20*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,.5},{0.,.5,.5}}},
279  /*S7*/{
280  /*00*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
281  /*01*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
282  /*02*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
283  /*03*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
284  /*04*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
285  /*05*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
286  /*06*/{{0.25,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.5,0.}},
287  /*07*/{{0.,-0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.5,0.25,0.}},
288  /*08*/{{-0.25,0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.25,0.}},
289  /*09*/{{0.,-.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,.5,0.}},
290  /*10*/{{0.,-.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,.5,0.}},
291  /*11*/{{0.,-.5,0.},{0.,0.,0.},{0.,0.,0.},{0.,.5,0.}},
292  /*12*/{{0.25,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.5,0.}},
293  /*13*/{{0.,-0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.5,0.25,0.}},
294  /*14*/{{-0.25,0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.25,0.}},
295  /*15*/{{0.5,0.,0.},{0.5,-0.5,0.},{0.,0.,0.},{0.,0.5,0.}},
296  /*16*/{{0.25,0.,0.},{0.,0.,-0.5},{0.,0.,0.},{0.25,0.5,0.5}},
297  /*17*/{{0.,-0.25,0.},{0.,0.,-0.5},{0.,0.,0.},{0.5,0.25,0.5}},
298  /*18*/{{0.25,-0.25,0.},{0.,0.,-0.5},{0.,0.,0.},{0.25,0.25,0.5}},
299  /*19*/{{0.5,0.,0.},{0.5,-0.5,0.},{0.,0.,0.},{0.,0.5,0.}},
300  /*20*/{{.5,0.,0.},{.5,-.5,0.},{0.,0.,-.5},{0.,.5,.5}}}
301  };
302 
303  static int fatherside[8][21] = {
304  /*00*/{0,6,8,9,16,18,6,15,8,9,16,18,16,20,18,15,16,20,18,20,20},
305  /*01*/{6,1,7,16,10,17,6,7,15,16,10,17,16,17,20,15,16,17,20,20,20},
306  /*02*/{8,7,2,18,17,11,15,7,8,18,17,11,20,17,18,15,20,17,18,20,20},
307  /*03*/{18,17,16,8,7,6,20,20,20,18,17,16,15,15,15,20,20,20,20,15,20},
308  /*04*/{9,16,18,3,12,14,16,20,18,9,16,18,12,19,14,20,16,20,18,19,20},
309  /*05*/{16,10,17,12,4,13,16,17,20,16,10,17,12,13,19,20,16,17,20,19,20},
310  /*06*/{18,17,11,14,13,5,20,17,18,18,17,11,19,13,14,20,20,17,18,19,20},
311  /*07*/{14,13,12,18,17,16,19,19,19,18,17,16,20,20,20,19,20,20,20,20,20},
312  };
313 
314 
315  //Into Divides is necesary to consider the connectivity with the all neighboards
316  void TPZRefPrism::Divide(TPZGeoEl *geo,TPZVec<TPZGeoEl *> &SubElVec) {
317  int i;
318  SubElVec.Resize(NSubEl);
319  if(geo->HasSubElement()) {
320  for(i=0;i<NSubEl;i++) SubElVec[i] = geo->SubElement(i);
321  return;//If exist fSubEl return this sons
322  }
323  int j,sub,matid=geo->MaterialId();
324  int64_t index;
325  int np[TPZShapePrism::NSides];//guarda conectividades dos 8 subelementos
326 
327  for(j=0;j<TPZShapePrism::NCornerNodes;j++) np[j] = geo->NodeIndex(j);
328  for(j=TPZShapePrism::NCornerNodes;j<TPZShapePrism::NSides;j++) {
329  NewMidSideNode(geo,j,index);
330  np[j] = index;
331  }
332  // creating new subelements
333  for(i=0;i<TPZRefPrism::NSubEl;i++) {
334  TPZManVector<int64_t> cornerindexes(TPZShapePrism::NCornerNodes);
335  for(int j=0;j<TPZShapePrism::NCornerNodes;j++)
336  cornerindexes[j] = np[CornerSons[i][j]];
337  int64_t index;
338  TPZGeoEl *subel = geo->Mesh()->CreateGeoElement(EPrisma,cornerindexes,matid,index);
339  // TPZGeoElPr3d *subel = new TPZGeoElPr3d(cornerindexes,matid,*geo->Mesh());
340  //if(i == 0) sub0 = subel;//TESTE
341  geo->SetSubElement(i , subel);
342  SubElVec[i] = subel;
343  subel->SetFather(geo);
344  subel->SetFatherIndex(geo->Index());
345  }
346 
347  for(sub=0;sub<NSubEl;sub++) {
348  SubElVec[sub] = geo->SubElement(sub);
349  SubElVec[sub]->SetFather(geo);
350  SubElVec[sub]->SetFatherIndex(geo->Index());
351  }
352  for(i=0;i<NSubEl;i++) {//conectividades entre os filhos : viz interna
353  for(j=0;j<NumInNeigh;j++) { //lado do subel numero do filho viz. lado do viz.
354  if(InNeigh[i][j][0] == -1) continue;
355  geo->SubElement(i)->SetNeighbour(InNeigh[i][j][0],TPZGeoElSide(geo->SubElement(InNeigh[i][j][1]),InNeigh[i][j][2]));
356  }
357  }
359  }
360 
361  void TPZRefPrism::NewMidSideNode(TPZGeoEl *gel,int side,int64_t &index) {
362 
363  MidSideNodeIndex(gel,side,index);
364  if(side == 15 || side > 18){
365  return;//o nó geométrico não pode ser criado
366  }
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 < TPZShapePrism::NCornerNodes) {
379  index = gel->NodeIndex(side);
380  return;
381  }
382  //aqui side = 6 a 20
383  side-=TPZShapePrism::NCornerNodes;//0,1,..,13
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 TPZRefPrism::MidSideNodeIndex(const TPZGeoEl *gel,int side,int64_t &index) {
394  index = -1;
395  if(side == 15 || side > 18) return;
396  if(side<0 || side>TPZShapePrism::NSides-1) {
397  PZError << "TPZRefPrism::MidSideNodeIndex. Bad parameter side = " << side << endl;
398  return;
399  }
400  //sides 0 a 7
401  if(side<TPZShapePrism::NCornerNodes) {//o nó medio do lado 0 é o 0 etc.
402  index = (gel)->NodeIndex(side);
403  return;
404  }
405  //o nó medio da face é o centro e o nó medio do centro é o centro
406  //como nó de algum filho se este existir
407  //caso tenha filhos é o canto de algum filho, se não tiver filhos retorna -1
408  if(gel->HasSubElement()) {
410  index=(gel->SubElement(MidSideNodes[side][0]))->NodeIndex(MidSideNodes[side][1]);
411  }
412  }
413 
414  void TPZRefPrism::GetSubElements(const TPZGeoEl *father,int side, TPZStack<TPZGeoElSide> &subel){
415 
416 // subel.Resize(0);
417  if(side<0 || side>TPZShapePrism::NSides || !father->HasSubElement()){
418  PZError << "TPZRefPrism::GetSubelements2 called with error arguments\n";
419  return;
420  }
421  int nsub = NSideSubElements(side);//nsubeldata[side];
422  for(int i=0;i<nsub;i++)
423  subel.Push(TPZGeoElSide(father->SubElement(subeldata[side][i][0]),
424  subeldata[side][i][1]));
425  }
426 
427  int TPZRefPrism::NSideSubElements(int side) {
428  if(side<0 || side>TPZShapePrism::NSides-1){
429  PZError << "TPZRefPrism::NSideSubelements2 called with error arguments\n";
430  return -1;
431  }
432  return nsubeldata[side];
433  }
434 
435  TPZTransform<> TPZRefPrism::GetTransform(int side,int whichsubel) {
436 
437  if(side<0 || side>TPZShapePrism::NSides-1){
438  PZError << "TPZRefPrism::GetTransform side out of range or father null\n";
439  return TPZTransform<>(0,0);
440  }
441  int smalldim = TPZShapePrism::SideDimension(side);
442  int fatherside = FatherSide(side,whichsubel);
443  int largedim = TPZShapePrism::SideDimension(fatherside);
444  TPZTransform<> trans(largedim,smalldim);
445  int i,j;
446  for(i=0; i<largedim; i++) {
447  for(j=0; j<smalldim; j++) {
448  trans.Mult()(i,j) = buildt[whichsubel][side][j][i];
449  }
450  trans.Sum() (i,0) = buildt[whichsubel][side][3][i];
451  }
452  return trans;
453  }
454 
455  int TPZRefPrism::FatherSide(int side,int whichsubel){
456 
457  if(side<0 || side>TPZShapePrism::NSides-1){
458  PZError << "TPZRefPrism::Father2 called error" << endl;
459  return -1;
460  }
461  return fatherside[whichsubel][side];
462  }
463 
464  int TPZRefPrism::ClassId() const{
465  return Hash("TPZRefPrism");
466  }
467 };
static int nsubeldata[21]
Definition: pzrefprism.cpp:20
int AllocateNewElement()
Makes more room for new elements.
Definition: pzadmchunk.h:184
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 TPZGeoEl * CreateGeoElement(MElementType type, TPZVec< int64_t > &cornerindexes, int matid, int64_t &index, int reftype=1)
Generic method for creating a geometric element. Putting this method centrally facilitates the modifi...
Definition: pzgmesh.cpp:1296
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)
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 InNeigh[8][NumInNeigh][3]
Definition: pzrefprism.cpp:98
Utility class which represents an element with its side. The Geometric approximation classes Geometry...
Definition: pzgeoelside.h:83
static int fatherside[8][21]
Definition: pzrefprism.cpp:303
This class implements a simple vector storage scheme for a templated class T. Utility.
Definition: pzgeopoint.h:19
static int SideDimension(int side)
Returns the dimension of the side.
Definition: tpzprism.cpp:598
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...
static int CornerSons[8][6]
Definition: pzrefprism.cpp:112
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 the TPZRefPrism class which implements the uniform refinement of a geometric prism element...
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
virtual void SetFatherIndex(int64_t fatherindex)
Sets the father element index This method is not called SetFather in order to avoid implicit conversi...
Definition: pzgeoel.h:490
int64_t Index() const
Returns the index of the element within the element vector of the mesh.
Definition: pzgeoel.h:730
static REAL MidCoord[15][3]
Definition: pzrefprism.cpp:82
TPZAdmChunkVector< TPZGeoNode > & NodeVec()
Definition: pzgmesh.h:140
const TPZFMatrix< T > & Sum() const
Definition: pztrnsform.h:66
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...
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.
Contains TPZShapePrism class which implements the shape functions of a prism element.
TPZGeoEl * Element() const
Definition: pzgeoelside.h:162
static int subeldata[21][21][2]
Definition: pzrefprism.cpp:22
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...
static REAL buildt[8][21][4][3]
Definition: pzrefprism.cpp:124
This class implements a stack object. Utility.
Definition: pzcheckmesh.h:14
int Side() const
Definition: pzgeoelside.h:169
void SetFather(TPZGeoEl *father)
Sets the father element.
Definition: pzgeoel.h:481
Implements an affine transformation between points in parameter space. Topology Utility.
Definition: pzmganalysis.h:14
static int MidSideNodes[15][2]
Definition: pzrefprism.cpp:71
Contains the TPZGeoPrism class which implements the geometry of a prism element.
Contains declaration of TPZGeoElement class which implements a generic geometric element with a unifo...
const int NumInNeigh
Definition: pzrefprism.cpp:97
virtual void SetSubElementConnectivities()
Initializes the external connectivities of the subelements.
Definition: pzgeoel.cpp:563
#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.