NeoPZ
pzgraphelq2dd.cpp
Go to the documentation of this file.
1 
6 #include "pzgraphelq2dd.h"
7 #include "pzgraphmesh.h"
8 #include "pzcompel.h"
9 #include "pzgeoel.h"
10 
11 using namespace std;
12 
14 {
15 }
16 
18  return fConnect;
19 }
20 
22 {
23 }
24 
26 {
27  int res = fGraphMesh->Res();
28  int imax = (1<<res)+1;
29  return imax*imax;
30 }
31 
33  int res = fGraphMesh->Res();
34  int imax = (1<<res);
35  return imax*imax;
36 }
37 
39  int res = fGraphMesh->Res();
40  int imax = (1<<res)+1;
41  return fConnect->FirstPoint()+co[0]*imax+co[1];
42 }
43 
44 void TPZGraphElQ2dd::FirstIJ(int connect,TPZVec<int> &co, int &incr) {
45  co[0]=0;
46  co[1]=0;
47  incr = 1;
48 }
49 
50 void TPZGraphElQ2dd::NextIJ(int connect, TPZVec<int> &co, int /*incr*/) {
51 
52  int res = fGraphMesh->Res();
53  int imax;
54  imax = 1 << res;
55  co[1]++;
56  if(co[1]> imax) {
57  co[1] = 0;
58  co[0]++;
59  }
60 }
61 
63  int res = fGraphMesh->Res();
64  int imax = 1 << res;
65  ostream &out = fGraphMesh->Out();
66  int64_t ip = fId;
67  if(st == EV3DStyle) ip++;
68  TPZVec<int> co0(3,0), co1(3,0), co2(3,0), co3(3,0);
69  for(int i=0;i<imax;i++) {
70  for(int j=0;j<imax;j++) {
71  if(st == EV3DStyle) out << ip << " 4 ";
72  if(st == EVTKStyle) out << "4 ";
73  if(st == EMVStyle) out << ip << " 1 1 1 ";
74  ip++;
75  if(st == EDXStyle) {
76  co0[0] = i; co0[1] = j;
77  co1[0] = i+1; co1[1] = j;
78  co2[0] = i; co2[1] = j+1;
79  co3[0] = i+1; co3[1] = j+1;
80  }
81  else {
82  co0[0] = i; co0[1] = j;
83  co1[0] = i+1; co1[1] = j;
84  co2[0] = i+1; co2[1] = j+1;
85  co3[0] = i; co3[1] = j+1;
86  }
87  out << EqNum(co0) << " " << EqNum(co1) << " " <<
88  EqNum(co2) << " " << EqNum(co3) << endl;
89  }
90  }
91 }
92 
93 void TPZGraphElQ2dd::SetNode(int64_t i,TPZGraphNode *gno) {
94  fConnect = gno;
95 }
96 
98  switch(st)
99  {
100  case(EVTKStyle):
101  return 9;//vtk_quad
102  default:
103  return -1;
104  }
105 }
106 
108 {
109  return 4;
110 }
Represents a graphical mesh used for post processing purposes. Post processing.
Definition: pzgraphmesh.h:34
virtual void NextIJ(int connect, TPZVec< int > &co, int incr)
std::ostream & Out()
Definition: pzgraphmesh.h:80
TPZGraphElQ2dd(TPZCompEl *cel, TPZGraphMesh *gmesh)
Constructor for graphical element to computational quadrilateral discontinuous element.
virtual int ExportType(TPZDrawStyle st)
Sets the style to export (format)
Contains declaration of TPZCompEl class which defines the interface of a computational element...
int64_t FirstPoint()
Definition: pzgraphnode.cpp:55
int64_t fId
Id of the graphical element.
Definition: pzgraphel.h:98
virtual ~TPZGraphElQ2dd(void)
Definition: TPZDrawStyle.h:12
Definition: TPZDrawStyle.h:12
int Res()
Get the resolution of the draw.
Definition: pzgraphmesh.h:64
Contains the TPZGraphElQ2dd class which implements the graphical two-dimensional discontinuous elemen...
virtual TPZGraphNode * Connect(int64_t i)
Return the graphical connect.
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 void FirstIJ(int connect, TPZVec< int > &co, int &incr)
Contains the TPZGraphMesh class which represents a graphical mesh used for post processing purposes...
REAL co[8][3]
Coordinates of the eight nodes.
virtual int64_t EqNum(TPZVec< int > &co)
Number of equations.
virtual int NNodes()
Number of corner nodes (geometric information)
virtual int NPoints(TPZGraphNode *n)
Number of points to graphical resolution.
TPZGraphNode * fConnect
Graphical node (connect) to discontinuous graphical element.
Definition: pzgraphelq2dd.h:60
Abstract class to graphical one-, two- and three-dimensional element. Post processing.
Definition: pzgraphel.h:23
virtual int NElements()
virtual void SetNode(int64_t i, TPZGraphNode *n)
Sets a ith graphical node.
virtual void Connectivity(TPZDrawStyle st=EDXStyle)
Set dx style for connectivity information.
Defines the interface of a computational element. Computational Element.
Definition: pzcompel.h:59
To export a graphical node. Post processing.
Definition: pzgraphnode.h:24
TPZDrawStyle
Definition: TPZDrawStyle.h:12