NeoPZ
pzgraphelq3dd.cpp
Go to the documentation of this file.
1 
6 #include "pzgraphelq3dd.h"
7 #include "pzgraphmesh.h"
8 
9 using namespace std;
10 
11 
13 }
14 
16  return fConnect;
17 }
18 
20 {
21 
22 }
23 
25 {
26  int res = fGraphMesh->Res();
27  int imax = (1<<res)+1;
28  return imax*imax*imax;
29 }
30 
32  int res = fGraphMesh->Res();
33  int imax = (1<<res);
34  return imax*imax*imax;
35 }
36 
38  int res = fGraphMesh->Res();
39  int imax = (1<<res)+1;
40 
41  return fConnect->FirstPoint()+imax*imax*co[2]+co[1]*imax+co[0];
42 }
43 
44 void TPZGraphElQ3dd::FirstIJ(int connect, TPZVec<int> &co, int &incr) {
45  int i;
46  for (i=0; i<3; i++) co[i]=0;
47  incr = 1;
48 }
49 
50 void TPZGraphElQ3dd::NextIJ(int connect, TPZVec<int> &co, int /*incr*/) {
51 
52  int res = fGraphMesh->Res();
53  int imax;
54  imax = 1 << res;
55  co[0]++;
56  if(co[0]> imax) {
57  co[0] = 0;
58  co[1]++;
59  if(co[1] > imax) {
60  co[2]++;
61  co[1] = 0;
62  }
63  }
64 }
65 
67  int res = fGraphMesh->Res();
68  int imax = 1 << res;
69  ostream &out = fGraphMesh->Out();
70  int64_t ip = fId;
71  TPZVec<int> co0(3,0), co1(3,0), co2(3,0), co3(3,0),
72  co4(3,0),co5(3,0),co6(3,0),co7(3,0);
73  if(st == EV3DStyle) ip++;
74  for(int i=0;i<imax;i++) {
75  for(int j=0;j<imax;j++) {
76  for (int k=0;k<imax;k++){
77  if(st == EV3DStyle) out << ip << " 8 ";
78  if(st == EVTKStyle) out << "8 ";
79  if(st == EMVStyle) out << ip << " 1 1 1 ";
80  ip++;
81  if(st == EDXStyle) {
82  co0[0] = i; co0[1] = j; co0[2]= k;
83  co1[0] = i+1; co1[1] = j; co1[2]= k;
84  co2[0] = i; co2[1] = j+1; co2[2]= k;
85  co3[0] = i+1; co3[1] = j+1; co3[2]= k;
86  co4[0] = i; co4[1] = j; co4[2]= k+1;
87  co5[0] = i+1; co5[1] = j; co5[2]= k+1;
88  co6[0] = i; co6[1] = j+1; co6[2]= k+1;
89  co7[0] = i+1; co7[1] = j+1; co7[2]= k+1;
90  }
91  else {
92  co0[0] = i; co0[1] = j; co0[2]= k;
93  co1[0] = i+1; co1[1] = j; co1[2]= k;
94  co2[0] = i+1; co2[1] = j+1; co2[2]= k;
95  co3[0] = i; co3[1] = j+1; co3[2]= k;
96  co4[0] = i; co4[1] = j; co4[2]= k+1;
97  co5[0] = i+1; co5[1] = j; co5[2]= k+1;
98  co6[0] = i+1; co6[1] = j+1; co6[2]= k+1;
99  co7[0] = i; co7[1] = j+1; co7[2]= k+1;
100  }
101  out << EqNum(co0) << " "
102  << EqNum(co1) << " "
103  << EqNum(co2) << " "
104  << EqNum(co3) << " "
105  << EqNum(co4) << " "
106  << EqNum(co5) << " "
107  << EqNum(co6) << " "
108  << EqNum(co7) << endl;
109  }
110  }
111  }
112 }
113 
114 void TPZGraphElQ3dd::SetNode(int64_t i,TPZGraphNode *gno) {
115  fConnect = gno;
116 }
117 
119  switch(st)
120  {
121  case(EVTKStyle):
122  return 12;//vtk_hexahedron
123  // break;
124  default:
125  return -1;
126  }
127  // return -1;
128 }
129 
131 {
132  return 8;
133 }
Represents a graphical mesh used for post processing purposes. Post processing.
Definition: pzgraphmesh.h:34
std::ostream & Out()
Definition: pzgraphmesh.h:80
virtual void Connectivity(TPZDrawStyle st=EDXStyle)
Set dx style for connectivity information.
virtual int NNodes()
Number of corner nodes (geometric information)
int64_t FirstPoint()
Definition: pzgraphnode.cpp:55
int64_t fId
Id of the graphical element.
Definition: pzgraphel.h:98
virtual TPZGraphNode * Connect(int64_t i)
Return the graphical connect.
Definition: TPZDrawStyle.h:12
Definition: TPZDrawStyle.h:12
int Res()
Get the resolution of the draw.
Definition: pzgraphmesh.h:64
TPZGraphElQ3dd(TPZCompEl *cel, TPZGraphMesh *gmesh)
Constructor for graphical element to computational hexahedra discontinuous element.
virtual void FirstIJ(int connect, TPZVec< int > &co, int &incr)
Definition: TPZDrawStyle.h:12
TPZGraphMesh * fGraphMesh
Graphical mesh associated with graphical element.
Definition: pzgraphel.h:87
string res
Definition: test.py:151
Definition: TPZDrawStyle.h:12
virtual ~TPZGraphElQ3dd(void)
Contains the TPZGraphMesh class which represents a graphical mesh used for post processing purposes...
REAL co[8][3]
Coordinates of the eight nodes.
virtual void NextIJ(int connect, TPZVec< int > &co, int incr)
Abstract class to graphical one-, two- and three-dimensional element. Post processing.
Definition: pzgraphel.h:23
virtual int NElements()
TPZGraphNode * fConnect
Graphical node (connect) to discontinuous graphical element.
Definition: pzgraphelq3dd.h:65
virtual int ExportType(TPZDrawStyle st)
Sets the style to export (format)
virtual int64_t EqNum(TPZVec< int > &co)
Number of equations.
virtual int NPoints(TPZGraphNode *n)
Number of points to graphical resolution.
Defines the interface of a computational element. Computational Element.
Definition: pzcompel.h:59
Contains the TPZGraphElQ3dd class which implements the graphical three dimensional discontinuous elem...
To export a graphical node. Post processing.
Definition: pzgraphnode.h:24
TPZDrawStyle
Definition: TPZDrawStyle.h:12
virtual void SetNode(int64_t i, TPZGraphNode *n)
Sets a ith graphical node.