NeoPZ
pzshapepiramHdiv.cpp
Go to the documentation of this file.
1 
6 #include "pzshapepiramHdiv.h"
7 
8 
9 using namespace std;
10 
11 namespace pzshape {
12 
14 
15  REAL temp = 0.;
16  if (IsZero(pt[2] - 1.)){
17  temp = pt[2];
18  pt[2] -= 1.e-8;
19  }
20 
21  TPZFNMatrix<20,REAL> phicp(phi);
22  TPZFNMatrix<60,REAL> dphicp(dphi);
23 
24  TPZShapePiram::Shape(pt, id, order, phicp, dphicp);
25 
26  REAL zst = 1./(1.-pt[2]);
27  int count = 0;
28  int countorig = 0;
29  for (int is=0; is<NSides; is++) {
30  if (is == 4) {
31  countorig++;
32  continue;
33  }
34  int norig = 1;
35  int nshape = 2;
36  if (is>4)
37  {
38  norig = TPZShapePiram::NConnectShapeF(is, order[is-5]);
39  nshape = NConnectShapeF(is, order[is-5]);
40  }
41  for (int shape = 0; shape<norig; shape++)
42  {
43  phi(shape+count,0) = phicp(shape+countorig,0);
44  for (int d=0; d<3; d++) {
45  dphi(d,shape+count) = dphicp(d,shape+countorig);
46  }
47  }
48  if(norig*2 == nshape)
49  {
50  for (int shape = 0; shape<norig; shape++)
51  {
52  phi(shape+norig+count,0) = phicp(shape+countorig,0)*zst;
53  for (int d=0; d<3; d++) {
54  dphi(d,shape+norig+count) = dphicp(d,shape+countorig)*zst;
55  }
56  dphi(2,shape+norig+count) += phicp(shape+countorig,0)*zst*zst;
57  }
58  }
59  countorig+= norig;
60  count += nshape;
61  }
62  if (IsZero(temp - 1.))
63  {
64  pt[2] = temp;
65  }
66  }
67 
68  int TPZShapePiramHdiv::NConnectShapeF(int side, int order) {
69  switch (side) {
70  case 0:
71  case 1:
72  case 2:
73  case 3:
74  case 5:
75  case 6:
76  case 7:
77  case 8:
78  case 13:
79 
80  return TPZShapePiram::NConnectShapeF(side, order)*2;
81  break;
82  case 4:
83  return 0;
84  break;
85  default:
86  return TPZShapePiram::NConnectShapeF(side, order);
87  break;
88  }
89  }
90 
91  int TPZShapePiramHdiv::ClassId() const{
92  return Hash("TPZShapePiramHdiv") ^ TPZShapePiram::ClassId() << 1;
93  }
94 
95 
96 };
bool IsZero(long double a)
Returns if the value a is close Zero as the allowable tolerance.
Definition: pzreal.h:668
groups all classes dedicated to the computation of shape functions
Definition: pzshapeextend.h:16
void Shape(TPZVec< REAL > &pt, TPZVec< int > orders, TPZVec< TPZTransform< REAL > > &transvec, TPZFMatrix< REAL > &phi, TPZFMatrix< REAL > &dphi)
Contains TPZShapePiram class which implements the shape functions of a pyramid element. author: Nathan Shauer date: 01/04/2015.
int32_t Hash(std::string str)
Definition: TPZHash.cpp:10
Non abstract class which implements full matrices with preallocated storage with (N+1) entries...
Definition: pzfmatrix.h:716