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