NeoPZ
pzgraphmesh.h
Go to the documentation of this file.
1 
6 #ifndef GRAFGRIDH
7 #define GRAFGRIDH
8 
9 #include "pzcompel.h"
10 #include "pzadmchunk.h"
11 #include "pzvec.h"
12 #include "tpzautopointer.h"
13 #include "TPZMaterial.h"
14 #include "pzfmatrix.h"
15 #include "pzgraphnode.h"
16 #include "TPZDrawStyle.h"
17 #include "pzgraphel.h"
18 
19 #include <iostream>
20 class TPZCompMesh;
21 template<class TVar>
22 class TPZBlock;
23 
34 class TPZGraphMesh : public TPZSavable {
35 
36 public:
37 
39  TPZGraphMesh(TPZCompMesh *cm, int dimension, const std::set<int> & matids, const TPZVec<std::string> &scalarnames,const TPZVec<std::string> &vecnames);
40 
42  TPZGraphMesh(TPZCompMesh *cm, int dimension, const std::set<int> & matids, const TPZVec<std::string> &scalarnames, const TPZVec<std::string> &vecnames, const TPZVec<std::string> &tensornames);
43 
45  virtual ~TPZGraphMesh(void);
46 
47  int ClassId() const override;
48 
49  void Read(TPZStream &buf, void *context) override;
50 
51  void Write(TPZStream &buf, int withclassid) const override;
52 
54  TPZGraphNode &FindNode(int64_t side);
55  TPZGraphEl *FindElement(int64_t sid);
61  int64_t NPoints();
62  int64_t NElements(MElementType type);
64  int Res() {return fResolution;}
66  virtual void SetCompMesh(TPZCompMesh *mesh, const std::set<int> & matids);
68  virtual void DrawNodes();
70  virtual void DrawMesh(int numcases);
72  virtual void DrawConnectivity(MElementType type);
74  virtual void DrawSolution(int step, REAL time);
78  virtual void SetFileName(const std::string &filename);
79 
80  std::ostream &Out()
81  {
82  return fOutFile;
83  }
84 
87 
89  void Print(std::ostream &out);
90 
92  void SetNames(const TPZVec<std::string>&scalarnames, const TPZVec<std::string>&vecnames);
93 
95  void SetNames(const TPZVec<std::string>&scalarnames, const TPZVec<std::string>&vecnames, const TPZVec<std::string>& tensornames);
96 
98  void SetMaterialIds(const std::set<int> & matids);
99 
101  std::set<int> MaterialIds();
102 
104  bool Material_Is_PostProcessed(int matid);
105 
106 protected:
107 
113  std::set<int> fMaterialIds;
124  std::ofstream fOutFile;
125  std::string fFileName;
128  virtual void SequenceNodes();
129 
130  TPZCompEl *FindFirstInterpolatedElement(TPZCompMesh *mesh,int dimension);
131 
132 public:
133 
134 // /** @brief Return of the material for graphical mesh */
135 // virtual TPZMaterial * Material();
137  virtual TPZCompMesh *Mesh() { return fCompMesh;}
138 
141  {
142  return fScalarNames;
143  }
144 
147  {
148  return fVecNames;
149  }
150 
153  {
154  return fTensorNames;
155  }
156 };
157 
159  return fStyle;
160 }
161 
162 #endif
TPZGraphMesh(TPZCompMesh *cm, int dimension, const std::set< int > &matids, const TPZVec< std::string > &scalarnames, const TPZVec< std::string > &vecnames)
Constructor for graphical mesh.
Definition: pzgraphmesh.cpp:25
bool Material_Is_PostProcessed(int matid)
Return a directive if the material id is being postprocessed.
Represents a graphical mesh used for post processing purposes. Post processing.
Definition: pzgraphmesh.h:34
filename
Definition: stats.py:82
std::ostream & Out()
Definition: pzgraphmesh.h:80
int ClassId() const override
Define the class id associated with the class.
TPZVec< std::string > fScalarNames
Vectors of the variables names (scalar, vectorial, and tensorial)
Definition: pzgraphmesh.h:127
clarg::argInt dimension("-d", "Matrices dimension M x M", 1000)
virtual void DrawConnectivity(MElementType type)
Draw the connectivity information.
Contains declaration of TPZCompEl class which defines the interface of a computational element...
Templated vector implementation.
std::string fFileName
Definition: pzgraphmesh.h:125
TPZVec< std::string > VecNames()
Return vectorial variable names.
Definition: pzgraphmesh.h:146
Contains the TPZGraphEl class which implements the graphical one-, two- and three-dimensional element...
Declarates the TPZBlock<REAL>class which implements block matrices.
Contains the TPZGraphNode class which implements the graphical node.
clarg::argInt cm("-cm", "clean memory before execution", 512)
Implements a chunk vector with free store administration. Utility.
Definition: TPZStream.h:39
TPZGeoMesh * fGeoMesh
Geometric mesh related.
Definition: pzgraphmesh.h:111
TPZGraphEl * FindElement(int64_t sid)
Definition: pzgraphmesh.cpp:89
void Print(std::ostream &out)
Print object attributes.
TPZCompEl * FindFirstInterpolatedElement(TPZCompMesh *mesh, int dimension)
TPZVec< std::string > TensorNames()
Return tensorial variable names.
Definition: pzgraphmesh.h:152
std::set< int > MaterialIds()
Get material ids.
void SetResolution(int res)
Sets resolution.
Definition: pzgraphmesh.h:86
virtual void DrawNodes()
Draw the graphical nodes information.
void SetMaterialIds(const std::set< int > &matids)
Set material ids.
TPZAdmChunkVector< TPZGraphEl * > & ElementList()
Vector of the graphical elements.
virtual void SequenceNodes()
void Read(TPZStream &buf, void *context) override
read objects from the stream
int fDimension
Dimension of the graphical mesh.
Definition: pzgraphmesh.h:115
int Res()
Get the resolution of the draw.
Definition: pzgraphmesh.h:64
TPZDrawStyle fStyle
Style of the graphical file.
Definition: pzgraphmesh.h:123
Contains TPZMatrixclass which implements full matrix (using column major representation).
virtual void SetCompMesh(TPZCompMesh *mesh, const std::set< int > &matids)
Sets the computational mesh to associate.
virtual TPZCompMesh * Mesh()
Return of the material for graphical mesh.
Definition: pzgraphmesh.h:137
virtual void DrawMesh(int numcases)
Draw the graphical mesh.
TPZAdmChunkVector< TPZGraphNode > & NodeMap()
Vector of the graphical nodes.
string res
Definition: test.py:151
Contains declaration of the TPZAutoPointer class which has Increment and Decrement actions are mutexe...
TPZVec< std::string > fVecNames
Definition: pzgraphmesh.h:127
std::ofstream fOutFile
Definition: pzgraphmesh.h:124
int fResolution
Resolution of the graphical object.
Definition: pzgraphmesh.h:121
virtual void SetFileName(const std::string &filename)
Sets the filename to output of graph.
void SetNames(const TPZVec< std::string > &scalarnames, const TPZVec< std::string > &vecnames)
Set names with scalar and vector variable names.
TPZAdmChunkVector< TPZGraphNode > fNodeMap
Vector of graphical nodes (connects)
Definition: pzgraphmesh.h:119
virtual void DrawSolution(int step, REAL time)
Draw solution depending on the resolution.
Implements block matrices. Matrix utility.
This class implements a geometric mesh for the pz environment. Geometry.
Definition: pzgmesh.h:48
MElementType
Define the element types.
Definition: pzeltype.h:52
TPZVec< std::string > ScalarNames()
Return scalar variable names.
Definition: pzgraphmesh.h:140
Implements computational mesh. Computational Mesh.
Definition: pzcmesh.h:47
TPZVec< std::string > fTensorNames
Definition: pzgraphmesh.h:127
Abstract class to graphical one-, two- and three-dimensional element. Post processing.
Definition: pzgraphel.h:23
int64_t NElements(MElementType type)
TPZDrawStyle Style()
Gets the style of the graphical mesh.
Definition: pzgraphmesh.h:158
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
TPZCompMesh * fCompMesh
Computational mesh associated.
Definition: pzgraphmesh.h:109
std::set< int > fMaterialIds
Set of material ids being post-processed.
Definition: pzgraphmesh.h:113
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
This class defines the interface to save and restore objects from TPZStream objects. Persistency.
Definition: TPZSavable.h:67
virtual ~TPZGraphMesh(void)
Default destructor.
Definition: pzgraphmesh.cpp:65
int64_t NPoints()
Number of points to drawing, depending on the resolution.
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
TPZGraphNode & FindNode(int64_t side)
Find graphical node (connect)
Definition: pzgraphmesh.cpp:78
TPZAdmChunkVector< TPZGraphEl * > fElementList
Vector of graphical elements.
Definition: pzgraphmesh.h:117