NeoPZ
pzgraphnode.cpp
Go to the documentation of this file.
1 
6 #include "pzgraphnode.h"
7 #include "pzgraphel.h"
8 #include "pzgraphmesh.h"
9 
10 using namespace std;
11 
13 {
14  fConnect = cn;
15  fGraphMesh = gm;
16  fGraphEl = NULL;
17  if(cn) fSequenceNumber = cn->SequenceNumber();
18  else fSequenceNumber = -1;
19 }
20 
22 {
23  fConnect = 0;
24  fGraphMesh = 0;
25  fGraphEl = NULL;
26  fSequenceNumber = -1;
27 }
28 
29 
31 {
32 }
33 
34 int TPZGraphNode::ClassId() const {
35  return Hash("TPZGraphNode");
36 }
37 
38 void TPZGraphNode::Read(TPZStream& buf, void* context) {
39  fConnect = dynamic_cast<TPZConnect *>(TPZPersistenceManager::GetInstance(&buf));
40  fGraphMesh = dynamic_cast<TPZGraphMesh *>(TPZPersistenceManager::GetInstance(&buf));
41  fGraphEl = dynamic_cast<TPZGraphEl *>(TPZPersistenceManager::GetInstance(&buf));
42  buf.Read(&fPointNum);
43  buf.Read(&fSequenceNumber);
44 }
45 
46 void TPZGraphNode::Write(TPZStream& buf, int withclassid) const {
48  TPZPersistenceManager::WritePointer(fGraphMesh, &buf);
50  buf.Write(&fPointNum);
51  buf.Write(&fSequenceNumber);
52 }
53 
54 
56 {
57  return(fPointNum);
58 }
59 
61 {
62  fGraphEl = gel;
63 }
64 
66 {
67  fPointNum = num;
68 }
69 
71  fConnect = connect;
72 }
73 
75  fGraphMesh = mesh;
76 }
77 
79 {
80  if(fGraphEl) return(fGraphEl->NPoints(this));
81  return 0;
82 }
83 
85 {
86  if(fGraphEl) fGraphEl->DrawCo(this,st);
87 }
88 
90  if(fGraphEl) fGraphEl->DrawSolution(this,solind,st);
91 }
92 
94  if(fGraphEl) fGraphEl->DrawSolution(this,solind,st);
95 }
96 
98  if(fGraphEl) fGraphEl->DrawSolution(this,bl,st);
99 }
100 
101 void TPZGraphNode::Print(ostream &out) {
102  out << "Connect Sequence number = " << fSequenceNumber <<
103  " First Point = " << fPointNum << endl;
104 }
Represents a graphical mesh used for post processing purposes. Post processing.
Definition: pzgraphmesh.h:34
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
Definition: pzgraphnode.cpp:46
void Print(std::ostream &out)
Represents a set of shape functions associated with a computational element/side. Computational Eleme...
Definition: pzconnect.h:30
void SetGraphMesh(TPZGraphMesh *mesh)
Definition: pzgraphnode.cpp:74
TPZGraphNode()
Default constructor.
Definition: pzgraphnode.cpp:21
void DrawSolution(int solutionid, TPZDrawStyle st=EDXStyle)
Draw solution on the current connect for solutionid variable.
Definition: pzgraphnode.cpp:89
void SetConnect(TPZConnect *connect)
Definition: pzgraphnode.cpp:70
Contains the TPZGraphEl class which implements the graphical one-, two- and three-dimensional element...
Contains the TPZGraphNode class which implements the graphical node.
int64_t FirstPoint()
Definition: pzgraphnode.cpp:55
static TPZSavable * GetInstance(const int64_t &objId)
int ClassId() const override
Define the class id associated with the class.
Definition: pzgraphnode.cpp:34
int64_t SequenceNumber() const
Returns the Sequence number of the connect object.
Definition: pzconnect.h:158
void SetPointNumber(int64_t num)
Definition: pzgraphnode.cpp:65
void Read(TPZStream &buf, void *context) override
read objects from the stream
Definition: pzgraphnode.cpp:38
virtual void Write(const bool val)
Definition: TPZStream.cpp:8
void SetElement(TPZGraphEl *gel)
Definition: pzgraphnode.cpp:60
Contains the TPZGraphMesh class which represents a graphical mesh used for post processing purposes...
int32_t Hash(std::string str)
Definition: TPZHash.cpp:10
void DrawCo(TPZDrawStyle st=EDXStyle)
Draw coordinates of the graphical node.
Definition: pzgraphnode.cpp:84
Implements block matrices. Matrix utility.
Abstract class to graphical one-, two- and three-dimensional element. Post processing.
Definition: pzgraphel.h:23
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
~TPZGraphNode(void)
Simple destructor.
Definition: pzgraphnode.cpp:30
static void WritePointer(const TPZSavable *obj, TPZStream *stream)
TPZDrawStyle
Definition: TPZDrawStyle.h:12
virtual void Read(bool &val)
Definition: TPZStream.cpp:91