NeoPZ
pzreftetrahedra.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 "pzgeoelside.h"
13 #include "pzgeoel.h"
14 #include "pzgmesh.h"
15 
16 using namespace pzshape;
17 using namespace std;
18 
19 namespace pzrefine {
20 
21 
22  static int nsubeldata[15] = {1,1,1,1,3,3,3,3,3,3,7,7,7,7,11};
23 
24  static int subeldata[15][11][2] = {//TAMANHO DISTINTO
25  //lados do pai:{{conectividades dos filhos}}
26  /*00*/{{0,0}},//os lados dos filhos formam
27  /*01*/{{1,1}},//uma particao do lado do pai
28  /*02*/{{2,2}},
29  /*03*/{{3,3}},
30  /*04*/{{0,4},{0,1},{1,4}},
31  /*05*/{{1,5},{1,2},{2,5}},
32  /*06*/{{2,6},{2,0},{0,6}},
33  /*07*/{{0,7},{0,3},{3,7}},
34  /*08*/{{1,8},{1,3},{3,8}},
35  /*09*/{{2,9},{2,3},{3,9}},
36  /*10*/{{0,5},{1,6},{2,4},{0,10},{1,10},{2,10},{5,15}},
37  /*11*/{{0,8},{1,7},{3,4},{0,11},{1,11},{3,11},{4,14}},
38  /*12*/{{1,9},{2,8},{3,5},{1,12},{2,12},{3,12},{5,17}},
39  /*13*/{{0,9},{2,7},{3,6},{0,13},{2,13},{3,13},{4,16}},
40  /*14*/{{0,14},{1,14},{2,14},{3,14},{4,18},{5,18},{4,13},{0,12},{1,13},{2,11},{3,10}}
41  };
42 
43 
44  static int MidSideNodes[6][2] = {
45  {0,1},
46  {1,2},
47  {2,0},
48  {3,0},
49  {3,1},
50  {3,2}
51  };
52 
53  static REAL MidCoord[6][3] = {
54  {.5,0.,0.},
55  {.5,.5,0.},
56  {0.,.5,0.},
57  {0.,0.,.5},
58  {.5,0.,.5},
59  {0.,.5,.5} };
60 
66  const int NumInNeigh = 16;
67  static int InNeigh[6][NumInNeigh][3] = {
68  {{1,1,0},{2,4,3},{3,4,4},{5,5,6},{8,4,9},{9,4,12},{12,4,17},{-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}},
69  {{0,5,1},{2,2,1},{3,3,1},{6,5,10},{7,5,5},{9,5,9},{13,5,14},{-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}},
70  {{0,0,2},{1,5,4},{3,3,2},{4,5,11},{7,4,7},{8,5,12},{11,5,16},{-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}},
71  {{0,0,3},{1,4,1},{2,4,2},{4,4,10},{5,4,6},{6,4,11},{10,4,15},{-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}},
72  {{0,0,1},{1,5,0},{2,5,3},{3,5,2},{4,3,0},{5,1,7},{6,5,8},{7,5,7},{8,0,5},{9,0,8},{10,3,4},{11,3,6},{12,0,9},{13,5,13},{15,3,10},{17,0,12}},
73  {{0,1,3},{1,4,0},{2,2,0},{3,2,3},{4,1,2},{5,4,5},{6,4,8},{7,2,7},{8,3,5},{9,1,9},{10,1,6},{11,2,4},{12,2,8},{13,4,13},{14,1,13},{16,2,11}}
74  };
75 
79  static int CornerSons[6][5] = {
80  {0,4,6,7,-1},
81  {4,1,5,8,-1},
82  {6,5,2,9,-1},
83  {7,8,9,3,-1},
84  {4,8,9,6,7},
85  {8,4,6,9,5}
86  };
87 
88  static REAL buildt[6][19][4][3] = {//por colunas
89  /*S0*/{
90  /*00*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
91  /*01*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
92  /*02*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
93  /*03*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
94  /*04*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
95  /*05*/{{-0.25,0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.25,0.}},
96  /*06*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
97  /*07*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
98  /*08*/{{-0.25,0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.25,0.}},
99  /*09*/{{-0.25,0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.25,0.}},
100  /*10*/{{0.5,0.,0.},{0.,0.5,0.},{0.,0.,0.},{0.,0.,0.}},
101  /*11*/{{0.5,0.,0.},{0.,0.5,0.},{0.,0.,0.},{0.,0.,0.}},
102  /*12*/{{-0.5,0.5,0},{-0.5,0,0.5},{0.,0.,0.},{0.5,0,0}},
103  /*13*/{{0.5,0,0.},{0,0.5,0.},{0.,0.,0.},{0,0,0.}},
104  /*14*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,.5},{0.,0.,0.}},
105  /*15*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
106  /*16*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
107  /*17*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
108  /*18*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}}},
109  /*S1*/{
110  /*00*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
111  /*01*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{1,0.,0.}},
112  /*02*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
113  /*03*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
114  /*04*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
115  /*05*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
116  /*06*/{{0.,-0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.5,0.25,0.}},
117  /*07*/{{0.,0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.5,0.25,0.}},
118  /*08*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
119  /*09*/{{-0.25,0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.25,0.}},
120  /*10*/{{0.5,0.,0.},{0.,0.5,0.},{0.,0.,0.},{0.5,0.,0.}},
121  /*11*/{{0.5,0.,0.},{0.,0.5,0.},{0.,0.,0.},{0.5,0.,0.}},
122  /*12*/{{0.5,0,0.},{0,0.5,0.},{0.,0.,0.},{0,0,0.}},
123  /*13*/{{0,0.5,0},{0,0,0.5},{0.,0.,0.},{0.5,0,0}},
124  /*14*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,.5},{.5,0.,0.}},
125  /*15*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
126  /*16*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
127  /*17*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
128  /*18*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}}},
129  /*S2*/{
130  /*00*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
131  /*01*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
132  /*02*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,1,0.}},
133  /*03*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
134  /*04*/{{0.25,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.5,0.}},
135  /*05*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
136  /*06*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
137  /*07*/{{0,0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.5,0.25,0.}},
138  /*08*/{{0,0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.5,0.25,0.}},
139  /*09*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{-.5,0.,0.}},
140  /*10*/{{0.5,0.,0.},{0.,0.5,0.},{0.,0.,0.},{0.,0.5,0.}},
141  /*11*/{{0.5,0.,0.},{0.,0.,0.5},{0.,0.,0.},{0.,0.5,0.}},
142  /*12*/{{0.5,0,0.},{0,0.5,0.},{0.,0.,0.},{0.5,0,0.}},
143  /*13*/{{0.5,0,0.},{0,0.5,0.},{0.,0.,0.},{0.5,0,0.}},
144  /*14*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,.5},{0.,.5,0.}},
145  /*15*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
146  /*16*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
147  /*17*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
148  /*18*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}}},
149  /*S3*/{
150  /*00*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
151  /*01*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
152  /*02*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
153  /*03*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,1}},
154  /*04*/{{0.25,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.5,0.}},
155  /*05*/{{0.25,0,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.5,0.}},
156  /*06*/{{-0.25,0,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.5,0.}},
157  /*07*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
158  /*08*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
159  /*09*/{{.5,0.,0.},{0.,0.,0.},{0.,0.,0.},{.5,0.,0.}},
160  /*10*/{{0.5,0.,0.},{0.,0.5,0.},{0.,0.,0.},{0.,0.,0.5}},
161  /*11*/{{0.5,0.,0.},{0.,0.5,0.},{0.,0.,0.},{0.,0.5,0.}},
162  /*12*/{{0.5,0,0.},{0,0.5,0.},{0.,0.,0.},{0,0.5,0.}},
163  /*13*/{{0.5,0,0.},{0,0.5,0.},{0.,0.,0.},{0,0.5,0.}},
164  /*14*/{{.5,0.,0.},{0.,.5,0.},{0.,0.,.5},{0.,0.,.5}},
165  /*15*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
166  /*16*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
167  /*17*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
168  /*18*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}}},
169  /*S4*/{
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.},{0.,0.,0.}},
174  /*04*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
175  /*05*/{{0.,0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.5,0.25,0.}},
176  /*06*/{{0.25,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.5,0.}},
177  /*07*/{{0.,-0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.5,0.25,0.}},
178  /*08*/{{0.25,-0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.25,0.}},
179  /*09*/{{-0.25,0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.25,0.}},
180  /*10*/{{-0.25,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.5,0.}},
181  /*11*/{{-0.25,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.5,0.}},
182  /*12*/{{-0.25,0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.25,0.}},
183  /*13*/{{0.,0.,0.25},{-0.25,0.25,0.},{0.,0.,0.},{0.25,0.25,0.25}},
184  /*14*/{{0.,0.5,0.},{-0.5,0.5,0.},{0.,0.,0.},{0.5,0.,0.}},
185  /*15*/{{-0.5,0.5,0.},{-0.5,0.,0.},{0.,0.,0.},{0.5,0.,0.5}},
186  /*16*/{{0.,0.5,0.},{-0.5,0.5,0.},{0.,0.,0.},{0.5,0.,0.}},
187  /*17*/{{-0.5,0.5,0.},{-0.5,0.,0.5},{0.,0.,0.},{0.5,0.,0.}},
188  /*18*/{{0.,0.,.25},{-.25,.25,0.},{-.25,-.25,.25},{.25,.25,.25}}},
189  /*S5*/{
190  /*00*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
191  /*01*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
192  /*02*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
193  /*03*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
194  /*04*/{{0.,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}},
195  /*05*/{{0.,-0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.5,0.25,0.}},
196  /*06*/{{-0.25,0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.25,0.}},
197  /*07*/{{0.,0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.5,0.25,0.}},
198  /*08*/{{-0.25,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.5,0.}},
199  /*09*/{{0.25,-0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.25,0.}},
200  /*10*/{{0.,0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.5,0.25,0.}},
201  /*11*/{{0.25,0.,0.},{0.,0.,0.},{0.,0.,0.},{0.25,0.5,0.}},
202  /*12*/{{0.,-0.25,0.},{0.,0.,0.},{0.,0.,0.},{0.5,0.25,0.}},
203  /*13*/{{0.,0.,-0.25},{-0.25,0.25,0.},{0.,0.,0.},{0.25,0.25,0.25}},
204  /*14*/{{0.,0.,-0.5},{0.,0.5,-0.5},{0.,0.,0.},{0.5,0.,0.5}},
205  /*15*/{{-0.5,0.5,0.},{0.,0.5,0.},{0.,0.,0.},{0.5,0.,0.}},
206  /*16*/{{0.,0.,-0.5},{0.5,0.,-0.5},{0.,0.,0.},{0.,0.5,0.5}},
207  /*17*/{{0.5,0.,0.},{0.5,-0.5,0.},{0.,0.,0.},{0.,0.5,0.}},
208  /*18*/{{0.,0.,-.25},{-.25,.25,0.},{.25,.25,-.25},{.25,.25,.25}}}
209  };
210 
211  //Into Divides is necesary to consider the connectivity with the all neighboards
212  void TPZRefTetrahedra::Divide(TPZGeoEl *geo,TPZVec<TPZGeoEl *> &SubElVec) {
213  int i;
214  SubElVec.Resize(NSubEl);
215  if(geo->HasSubElement()) {
216  for(i=0;i<NSubEl;i++) SubElVec[i] = geo->SubElement(i);
217  return;//If exist fSubEl return this sons
218  }
219  int j,sub,matid=geo->MaterialId();
220  int64_t index;
221  int np[TPZShapeTetra::NSides];//guarda conectividades dos 8 subelementos
222  for(j=0;j<TPZShapeTetra::NCornerNodes;j++) np[j] = geo->NodeIndex(j);
223  for(sub=TPZShapeTetra::NCornerNodes;sub<10;sub++) {
224  NewMidSideNode(geo,sub,index);
225  np[sub] = index;
226  }
227  // creating new subelements
228  for (i=0;i<4;i++){
229  TPZManVector<int64_t> cornerindexes(TPZShapeTetra::NCornerNodes);
230  for(int j=0;j<TPZShapeTetra::NCornerNodes;j++) cornerindexes[j] = np[CornerSons[i][j]];
231  TPZGeoEl *t3sub = geo->CreateGeoElement(ETetraedro,cornerindexes,matid,index);
232  geo->SetSubElement(i,t3sub);
233  t3sub->SetFather(geo);
234  t3sub->SetFatherIndex(geo->Index());
235  SubElVec[i] = t3sub;
236  }
237  for (;i<6;i++){
239  for(int j=0;j<TPZShapePiram::NCornerNodes;j++)
240  cornerindexes[j] = np[CornerSons[i][j]];
241  TPZGeoEl *pi3sub = geo->CreateGeoElement(EPiramide,cornerindexes,matid,index);
242  geo->SetSubElement(i,pi3sub);
243  pi3sub->SetFather(geo);
244  pi3sub->SetFatherIndex(geo->Index());
245  SubElVec[i] = pi3sub;
246  }
247  for(i=0;i<NSubEl;i++) {//conectividades entre os filhos : viz interna
248  for(j=0;j<NumInNeigh;j++) { //lado do subel numero do filho viz. lado do viz.
249  int elside = InNeigh[i][j][0];//lado do subel
250  if(elside == -1) break;
251  geo->SubElement(i)->SetNeighbour(elside,TPZGeoElSide(geo->SubElement(InNeigh[i][j][1]),InNeigh[i][j][2]));
252  }
253  }
255  }
256 
257  void TPZRefTetrahedra::NewMidSideNode(TPZGeoEl *gel,int side,int64_t &index) {
258 
259  MidSideNodeIndex(gel,side,index);
260  if(index < 0) {
261  TPZGeoElSide gelside = gel->Neighbour(side);
262  if(gelside.Element()) {
263  while(gelside.Element() != gel) {
264  gelside.Element()->MidSideNodeIndex(gelside.Side(),index);
265  if(index!=-1) return;
266  gelside = gelside.Neighbour();
267  }
268  }
269  TPZVec<REAL> par(3,0.);
270  TPZVec<REAL> coord(3,0.);
271  if(side < TPZShapeTetra::NCornerNodes) {
272  index = gel->NodeIndex(side);
273  return;
274  }
275  //aqui side = 8 a 26
276  side-=TPZShapeTetra::NCornerNodes;//0,1,..,18
277  par[0] = MidCoord[side][0];
278  par[1] = MidCoord[side][1];
279  par[2] = MidCoord[side][2];
280  gel->X(par,coord);
281  index = gel->Mesh()->NodeVec().AllocateNewElement();
282  gel->Mesh()->NodeVec()[index].Initialize(coord,*gel->Mesh());
283  }
284  }
285 
286  void TPZRefTetrahedra::MidSideNodeIndex(const TPZGeoEl *gel,int side,int64_t &index) {
287  index = -1;
288  if(side<0 || side>TPZShapeTetra::NSides-1) {
289  PZError << "TPZRefTetrahedra::MidSideNodeIndex. Bad parameter side = " << side << endl;
290  return;
291  }
292  //sides 0 a 7
293  if(side<TPZShapeTetra::NCornerNodes) {//o nó medio do lado 0 é o 0 etc.
294  index = (gel)->NodeIndex(side);
295  return;
296  }
297  //o nó medio da face é o centro e o nó medio do centro é o centro
298  //como nó de algum filho se este existir
299  //caso tenha filhos é o canto de algum filho, se não tiver filhos retorna -1
300  if(gel->HasSubElement()) {
302  index=(gel->SubElement(MidSideNodes[side][0]))->NodeIndex(MidSideNodes[side][1]);
303  }
304  }
305 
306  void TPZRefTetrahedra::GetSubElements(const TPZGeoEl *father,int side, TPZStack<TPZGeoElSide> &subel){
307 
308 // subel.Resize(0);
309  if(side<0 || side>TPZShapeTetra::NSides || !father->HasSubElement()){
310  PZError << "TPZRefTetrahedra::GetSubelements2 called with error arguments\n";
311  return;
312  }
313  int nsub = NSideSubElements(side);//nsubeldata[side];
314  for(int i=0;i<nsub;i++)
315  subel.Push(TPZGeoElSide(father->SubElement(subeldata[side][i][0]),
316  subeldata[side][i][1]));
317  }
318 
319  int TPZRefTetrahedra::NSideSubElements(int side) {
320  if(side<0 || side>TPZShapeTetra::NSides-1){
321  PZError << "TPZRefTetrahedra::NSideSubelements2 called with error arguments\n";
322  return -1;
323  }
324  return nsubeldata[side];
325  }
326 
327  TPZTransform<> TPZRefTetrahedra::GetTransform(int side,int whichsubel){
328  if(side<0 || (whichsubel < 4 && side>TPZShapeTetra::NSides-1) ||
329  (side >TPZShapePiram::NSides-1)){
330  PZError << "TPZRefTetrahedra::GetTransform side out of range or father null\n";
331  return TPZTransform<>(0,0);
332  }
333  int smalldim;
334  if(whichsubel <4) smalldim = TPZShapeTetra::SideDimension(side);
335  else smalldim = TPZShapePiram::SideDimension(side);
336  int fatherside = FatherSide(side,whichsubel);
337  int largedim = TPZShapeTetra::SideDimension(fatherside);
338  TPZTransform<> trans(largedim,smalldim);
339  int i,j;
340  for(i=0; i<largedim; i++) {
341  for(j=0; j<smalldim; j++) {
342  trans.Mult()(i,j) = buildt[whichsubel][side][j][i];
343  }
344  trans.Sum() (i,0) = buildt[whichsubel][side][3][i];
345  }
346  return trans;
347  }
348 
349  static int fatherside[6][19] = {
350  /*00*/{0,4,6,7,4,10,6,7,11,13,10,11,14,13,14,-1,-1,-1,-1},
351  /*01*/{4,1,5,8,4,5,10,11,8,12,10,11,12,14,14,-1,-1,-1,-1},
352  /*02*/{6,5,2,9,10,5,6,13,12,9,10,14,12,13,14,-1,-1,-1,-1},
353  /*03*/{7,8,9,3,11,12,13,7,8,9,14,11,12,13,14,-1,-1,-1,-1},
354  /*04*/{4,8,9,6,7,11,12,13,10,11,11,13,13,14,11,14,13,14,14},
355  /*05*/{8,4,6,9,5,11,10,13,12,12,10,10,12,14,14,10,14,12,14},
356  };
357 
358  int TPZRefTetrahedra::FatherSide(int side,int whichsubel){
359 
360  return fatherside[whichsubel][side];
361  }
362 
363  int TPZRefTetrahedra::ClassId() const{
364  return Hash("TPZRefTetrahedra");
365  }
366 };
Contains TPZShapeTetra class which implements the shape functions of a tetrahedral element...
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 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
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 the TPZRefPyramid class which implements the uniform refinement of a geometric hexahedral el...
static int InNeigh[6][NumInNeigh][3]
static int MidSideNodes[6][2]
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[15]
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
Contains the TPZGeoTetrahedra class which implements the geometry of a tetrahedral element...
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
static int subeldata[15][11][2]
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...
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
static REAL MidCoord[6][3]
static int CornerSons[6][5]
static REAL buildt[6][19][4][3]
Contains the TPZRefTetrahedra class which implements the uniform refinement of a geometric tetrahedra...
static int fatherside[6][19]
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
void SetFather(TPZGeoEl *father)
Sets the father element.
Definition: pzgeoel.h:481
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
#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.