NeoPZ
pztrigraphd.cpp
Go to the documentation of this file.
1 
6 #include "pztrigraphd.h"
7 #include "pzgraphmesh.h"
8 
9 using namespace std;
10 
12 
13 }
14 
16  return 1;
17 }
18 
20  int res = fGraphMesh->Res();
21  int imax = (1<<res);
22  return imax*imax;
23 }
24 
26  int res = fGraphMesh->Res();
27  int imax = (1<<res)+1;
28  return ((imax+1)*imax)/2;
29 }
30 
32  int res = fGraphMesh->Res();
33  int imax = 1 << res;
34  ostream &out = fGraphMesh->Out();
35  int64_t ip = fId;
36  if(st == EV3DStyle) ip++;
37  TPZVec<int> co0(3,0), co1(3,0), co2(3,0);
38  for(int j=0;j<imax;j++) {
39  for(int i=0;i<imax-j;i++) {
40  if(st == EV3DStyle) out << ip++ << " 3 ";
41  if(st == EMVStyle) out << ip++ << " 1 1 1 ";
42  co0[0] = i; co0[1] = j;
43  co1[0] = i+1; co1[1] = j;
44  co2[0] = i; co2[1]=j+1;
45  out << EqNum(co0) << " " << EqNum(co1) << " " <<
46  EqNum(co2) << endl;
47 
48  if(i <imax-j-1) {
49  if(st == EV3DStyle) out << ip++ << " 3 ";
50  if(st == EMVStyle) out << ip++ << " 1 1 1 ";
51  co0[0] = i+1; co0[1] = j;
52  co1[0] = i+1; co1[1] = j+1;
53  co2[0] = i; co2[1]=j+1;
54  out << EqNum(co0) << " " << EqNum(co1) << " " <<
55  EqNum(co2) << endl;
56  }
57 
58  }
59  }
60 }
61 
63  int res = fGraphMesh->Res();
64  int imax = (1<<res)+1;
65  int neq = fConnect->FirstPoint() + co[1];
66  for(int run=0;run<co[0];run++) neq += imax-run;
67  return neq;
68 }
69 
70 void TPZGraphElTd::QsiEta(TPZVec<int> &co, int imax, TPZVec<REAL> &qsieta){
71  int i,ni = co.NElements();
72  for(i=0; i<ni; i++) qsieta[i] = (1.*co[i])/imax;
73 }
74 
75 
76 void TPZGraphElTd::FirstIJ(int no, TPZVec<int> &co, int &incr){
77  int i;
78  for(i=0;i<3;i++) co[i]=0;
79  incr = 1;
80 }
81 
82 
83 void TPZGraphElTd::NextIJ(int no,TPZVec<int> &co, int /*incr*/){
84  int res = fGraphMesh->Res();
85  int imax;
86  imax = (1 << res)+1;
87  co[1]++;
88  if(co[0]+co[1]>= imax) {
89  co[1] = 0;
90  co[0]++;
91  }
92 }
93 
95  switch(st)
96  {
97  case(EVTKStyle):
98  return 5;//vtk_triangle
99  default:
100  return -1;
101  }
102 }
103 
105 {
106  return 3;
107 }
TPZGraphNode * fConnect
Graphical node (connect) to discontinuous graphical element.
Definition: pztrigraphd.h:61
virtual void Connectivity(TPZDrawStyle st=EDXStyle)
Set dx style for connectivity information.
Definition: pztrigraphd.cpp:31
Represents a graphical mesh used for post processing purposes. Post processing.
Definition: pzgraphmesh.h:34
virtual int NConnects()
Number of connects for the element.
Definition: pztrigraphd.cpp:15
Contains the TPZGraphElTd class which implements the graphical discontinuous triangular element...
virtual int ExportType(TPZDrawStyle st)
Sets the style to export (format)
Definition: pztrigraphd.cpp:94
std::ostream & Out()
Definition: pzgraphmesh.h:80
virtual void QsiEta(TPZVec< int > &i, int imax, TPZVec< REAL > &qsieta)
This method maps the index of a point to parameter space as a function of the number of divisions...
Definition: pztrigraphd.cpp:70
int64_t FirstPoint()
Definition: pzgraphnode.cpp:55
int64_t fId
Id of the graphical element.
Definition: pzgraphel.h:98
Definition: TPZDrawStyle.h:12
int Res()
Get the resolution of the draw.
Definition: pzgraphmesh.h:64
Definition: TPZDrawStyle.h:12
virtual int64_t EqNum(TPZVec< int > &co)
Number of equations.
Definition: pztrigraphd.cpp:62
TPZGraphMesh * fGraphMesh
Graphical mesh associated with graphical element.
Definition: pzgraphel.h:87
string res
Definition: test.py:151
Definition: TPZDrawStyle.h:12
Contains the TPZGraphMesh class which represents a graphical mesh used for post processing purposes...
virtual int NElements()
Definition: pztrigraphd.cpp:19
REAL co[8][3]
Coordinates of the eight nodes.
virtual int NPoints(TPZGraphNode *n)
Number of points to graphical resolution.
Definition: pztrigraphd.cpp:25
Abstract class to graphical one-, two- and three-dimensional element. Post processing.
Definition: pzgraphel.h:23
int64_t NElements() const
Returns the number of elements of the vector.
Definition: pzvec.h:190
virtual void FirstIJ(int no, TPZVec< int > &co, int &incr)
Definition: pztrigraphd.cpp:76
TPZGraphElTd(TPZCompEl *c, TPZGraphMesh *g)
Constructor for graphical element to computational triangular discontinuous element.
Definition: pztrigraphd.cpp:11
virtual void NextIJ(int no, TPZVec< int > &co, int incr)
Definition: pztrigraphd.cpp:83
virtual int NNodes()
Number of corner nodes (geometric 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