gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
PViewDataList.h
Go to the documentation of this file.
1 
2 // Gmsh - Copyright (C) 1997-2022 C. Geuzaine, J.-F. Remacle
3 //
4 // See the LICENSE.txt file in the Gmsh root directory for license information.
5 // Please report all issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
6 
7 #ifndef PVIEW_DATA_LIST_H
8 #define PVIEW_DATA_LIST_H
9 
10 #include <vector>
11 #include <string>
12 #include "PViewData.h"
13 #include "SBoundingBox3d.h"
14 
15 // The container for list-based datasets (for which all elements are
16 // discontinuous).
17 class PViewDataList : public PViewData {
18 public:
19  // FIXME: all these members will be made private once the plugins
20  // have been rewritten
22  double Min, Max;
23  std::vector<double> TimeStepMin, TimeStepMax;
25  std::vector<double> Time;
26  int NbSP, NbVP, NbTP;
27  std::vector<double> SP, VP, TP; // points
28  int NbSL, NbVL, NbTL;
29  std::vector<double> SL, VL, TL; // lines
30  int NbST, NbVT, NbTT;
31  std::vector<double> ST, VT, TT; // triangles
32  int NbSQ, NbVQ, NbTQ;
33  std::vector<double> SQ, VQ, TQ; // quadrangles
34  int NbSG, NbVG, NbTG;
35  std::vector<double> SG, VG, TG; // polygons
36  int NbSS, NbVS, NbTS;
37  std::vector<double> SS, VS, TS; // tetrahedra
38  int NbSH, NbVH, NbTH;
39  std::vector<double> SH, VH, TH; // hexahedra
40  int NbSI, NbVI, NbTI;
41  std::vector<double> SI, VI, TI; // prisms
42  int NbSY, NbVY, NbTY;
43  std::vector<double> SY, VY, TY; // pyramids
44  int NbSR, NbVR, NbTR;
45  std::vector<double> SR, VR, TR; // trihedra
46  int NbSD, NbVD, NbTD;
47  std::vector<double> SD, VD, TD; // polyhedra
48  int NbT2, NbT3;
49  std::vector<double> T2D, T3D; // 2D and 3D text strings
50  std::vector<char> T2C, T3C;
51  std::vector<int> polyNumNodes[2];
52  std::vector<int> polyAgNumNodes[2];
54 
55 private:
56  int _index[33];
60  double *_lastXYZ, *_lastVal;
61  bool _isAdapted;
62  void _stat(std::vector<double> &D, std::vector<char> &C, int nb);
63  void _stat(std::vector<double> &list, int nbcomp, int nbelm, int nbnod,
64  int type);
65  void _setLast(int ele);
66  void _setLast(int ele, int dim, int nbnod, int nbcomp, int nbedg, int type,
67  std::vector<double> &list, int nblist);
68  void _getString(int dim, int i, int timestep, std::string &str, double &x,
69  double &y, double &z, double &style);
70  int _getRawData(int idxtype, std::vector<double> **l, int **ne, int *nc,
71  int *nn);
72 
73 public:
74  PViewDataList(bool isAdapted = false);
76  bool isAdapted() { return _isAdapted; }
77  bool finalize(bool computeMinMax = true,
78  const std::string &interpolationScheme = "");
79  int getNumTimeSteps() { return NbTimeStep; }
80  double getTime(int step);
81  double getMin(int step = -1, bool onlyVisible = false, int tensorRep = 0,
82  int forceNumComponents = 0, int componentMap[9] = nullptr);
83  double getMax(int step = -1, bool onlyVisible = false, int tensorRep = 0,
84  int forceNumComponents = 0, int componentMap[9] = nullptr);
85  void setMin(double min) { Min = min; }
86  void setMax(double max) { Max = max; }
87  SBoundingBox3d getBoundingBox(int step = -1) { return BBox; }
89  int getNumScalars(int step = -1);
90  int getNumVectors(int step = -1);
91  int getNumTensors(int step = -1);
92  int getNumPoints(int step = -1) { return NbSP + NbVP + NbTP; }
93  int getNumLines(int step = -1) { return NbSL + NbVL + NbTL; }
94  int getNumTriangles(int step = -1) { return NbST + NbVT + NbTT; }
95  int getNumQuadrangles(int step = -1) { return NbSQ + NbVQ + NbTQ; }
96  int getNumPolygons(int step = -1) { return NbSG + NbVG + NbTG; }
97  int getNumTetrahedra(int step = -1) { return NbSS + NbVS + NbTS; }
98  int getNumHexahedra(int step = -1) { return NbSH + NbVH + NbTH; }
99  int getNumPrisms(int step = -1) { return NbSI + NbVI + NbTI; }
100  int getNumPyramids(int step = -1) { return NbSY + NbVY + NbTY; }
101  int getNumTrihedra(int step = -1) { return NbSR + NbVR + NbTR; }
102  int getNumPolyhedra(int step = -1) { return NbSD + NbVD + NbTD; }
103  int getNumEntities(int step = -1) { return 1; }
104  int getNumElements(int step = -1, int ent = -1);
105  int getDimension(int step, int ent, int ele);
106  int getNumNodes(int step, int ent, int ele);
107  int getNode(int step, int ent, int ele, int nod, double &x, double &y,
108  double &z);
109  void setNode(int step, int ent, int ele, int nod, double x, double y,
110  double z);
111  int getNumComponents(int step, int ent, int ele);
112  int getNumValues(int step, int ent, int ele);
113  void getValue(int step, int ent, int ele, int idx, double &val);
114  void getValue(int step, int ent, int ele, int nod, int comp, double &val);
115  void setValue(int step, int ent, int ele, int nod, int comp, double val);
116  int getNumEdges(int step, int ent, int ele);
117  int getType(int step, int ent, int ele);
118  int getNumStrings2D() { return NbT2; }
119  int getNumStrings3D() { return NbT3; }
120  void getString2D(int i, int step, std::string &str, double &x, double &y,
121  double &style);
122  void getString3D(int i, int step, std::string &str, double &x, double &y,
123  double &z, double &style);
124  void reverseElement(int step, int ent, int ele);
125  void smooth();
126  bool combineTime(nameData &nd);
127  bool combineSpace(nameData &nd);
128  void setXY(std::vector<double> &x, std::vector<double> &y);
129  void setXYZV(std::vector<double> &x, std::vector<double> &y,
130  std::vector<double> &z, std::vector<double> &v);
131  void addStep(std::vector<double> &y);
132  bool isListBased() { return true; }
133  double getMemoryInMb();
134 
135  // specific to list-based data sets
136  void setOrder2(int type);
137  std::vector<double> *incrementList(int numComp, int type, int numNodes = 0);
138 
139  // I/O routines
140  bool readPOS(FILE *fp, double version, bool binary);
141  bool writePOS(const std::string &fileName, bool binary = false,
142  bool parsed = true, bool append = false);
143  virtual bool writeMSH(const std::string &fileName, double version = 2.2,
144  bool binary = false, bool savemesh = true,
145  bool multipleView = false, int partitionNum = -1,
146  bool saveInterpolationMatrices = true,
147  bool forceNodeData = false,
148  bool forceElementData = false);
149  virtual void importLists(int N[24], std::vector<double> *V[24]);
150  virtual void getListPointers(int N[24], std::vector<double> *V[24]);
151  void importList(int index, int n, const std::vector<double> &v,
152  bool finalize);
153 };
154 
155 #endif
PViewDataList::getNumEntities
int getNumEntities(int step=-1)
Definition: PViewDataList.h:103
PViewDataList::_lastType
int _lastType
Definition: PViewDataList.h:59
PViewDataList::getMemoryInMb
double getMemoryInMb()
Definition: PViewDataList.cpp:674
PViewDataList::getListPointers
virtual void getListPointers(int N[24], std::vector< double > *V[24])
Definition: PViewDataListIO.cpp:827
PViewDataList::importList
void importList(int index, int n, const std::vector< double > &v, bool finalize)
Definition: PViewDataListIO.cpp:812
PViewDataList::_lastNumNodes
int _lastNumNodes
Definition: PViewDataList.h:58
D
#define D
Definition: DefaultOptions.h:24
PViewDataList::VQ
std::vector< double > VQ
Definition: PViewDataList.h:33
PViewDataList::TS
std::vector< double > TS
Definition: PViewDataList.h:37
PViewDataList::setMin
void setMin(double min)
Definition: PViewDataList.h:85
PViewDataList::BBox
SBoundingBox3d BBox
Definition: PViewDataList.h:24
PViewDataList::NbVY
int NbVY
Definition: PViewDataList.h:42
PViewDataList::NbVR
int NbVR
Definition: PViewDataList.h:44
PViewDataList::TQ
std::vector< double > TQ
Definition: PViewDataList.h:33
PViewDataList::getNumPolyhedra
int getNumPolyhedra(int step=-1)
Definition: PViewDataList.h:102
PViewDataList::NbT3
int NbT3
Definition: PViewDataList.h:48
PViewDataList::reverseElement
void reverseElement(int step, int ent, int ele)
Definition: PViewDataList.cpp:582
PViewDataList::Min
double Min
Definition: PViewDataList.h:22
PViewDataList::smooth
void smooth()
Definition: PViewDataList.cpp:654
PViewDataList::T2C
std::vector< char > T2C
Definition: PViewDataList.h:50
PViewDataList::getNumTensors
int getNumTensors(int step=-1)
Definition: PViewDataList.cpp:164
PViewDataList::getNumQuadrangles
int getNumQuadrangles(int step=-1)
Definition: PViewDataList.h:95
PViewDataList::NbTL
int NbTL
Definition: PViewDataList.h:28
PViewDataList::getNumNodes
int getNumNodes(int step, int ent, int ele)
Definition: PViewDataList.cpp:442
PViewDataList::SS
std::vector< double > SS
Definition: PViewDataList.h:37
PViewDataList::polyNumNodes
std::vector< int > polyNumNodes[2]
Definition: PViewDataList.h:51
PViewDataList::NbSG
int NbSG
Definition: PViewDataList.h:34
PViewDataList::T3D
std::vector< double > T3D
Definition: PViewDataList.h:49
PViewDataList::TL
std::vector< double > TL
Definition: PViewDataList.h:29
PViewDataList::NbTP
int NbTP
Definition: PViewDataList.h:26
PViewDataList::NbTT
int NbTT
Definition: PViewDataList.h:30
PViewDataList::Max
double Max
Definition: PViewDataList.h:22
PViewDataList
Definition: PViewDataList.h:17
PViewDataList::_getRawData
int _getRawData(int idxtype, std::vector< double > **l, int **ne, int *nc, int *nn)
Definition: PViewDataList.cpp:970
PViewDataList::TimeStepMin
std::vector< double > TimeStepMin
Definition: PViewDataList.h:23
PViewDataList::NbSP
int NbSP
Definition: PViewDataList.h:26
PViewDataList::incrementList
std::vector< double > * incrementList(int numComp, int type, int numNodes=0)
Definition: PViewDataList.cpp:1243
PViewDataList::isListBased
bool isListBased()
Definition: PViewDataList.h:132
box
Definition: gl2gif.cpp:311
PViewDataList::_index
int _index[33]
Definition: PViewDataList.h:56
PViewDataList::NbTimeStep
int NbTimeStep
Definition: PViewDataList.h:21
PViewDataList::getNumPoints
int getNumPoints(int step=-1)
Definition: PViewDataList.h:92
PViewDataList::getDimension
int getDimension(int step, int ent, int ele)
Definition: PViewDataList.cpp:436
PViewDataList::TI
std::vector< double > TI
Definition: PViewDataList.h:41
PViewDataList::NbSQ
int NbSQ
Definition: PViewDataList.h:32
nameData
Definition: PView.h:169
PViewDataList::SY
std::vector< double > SY
Definition: PViewDataList.h:43
PViewDataList::NbSH
int NbSH
Definition: PViewDataList.h:38
PViewDataList::VL
std::vector< double > VL
Definition: PViewDataList.h:29
PViewDataList::SD
std::vector< double > SD
Definition: PViewDataList.h:47
PViewDataList::VR
std::vector< double > VR
Definition: PViewDataList.h:45
PViewDataList::getNumLines
int getNumLines(int step=-1)
Definition: PViewDataList.h:93
PViewDataList::SR
std::vector< double > SR
Definition: PViewDataList.h:45
PViewDataList::getNumTetrahedra
int getNumTetrahedra(int step=-1)
Definition: PViewDataList.h:97
PViewDataList::VY
std::vector< double > VY
Definition: PViewDataList.h:43
PViewDataList::setBoundingBox
void setBoundingBox(SBoundingBox3d &box)
Definition: PViewDataList.h:88
PViewDataList::getType
int getType(int step, int ent, int ele)
Definition: PViewDataList.cpp:511
PViewData.h
PViewDataList::getNumPolygons
int getNumPolygons(int step=-1)
Definition: PViewDataList.h:96
PViewDataList::NbVH
int NbVH
Definition: PViewDataList.h:38
PViewDataList::TimeStepMax
std::vector< double > TimeStepMax
Definition: PViewDataList.h:23
PViewDataList::importLists
virtual void importLists(int N[24], std::vector< double > *V[24])
Definition: PViewDataListIO.cpp:800
PViewDataList::VH
std::vector< double > VH
Definition: PViewDataList.h:39
PViewDataList::NbVG
int NbVG
Definition: PViewDataList.h:34
PViewDataList::getMax
double getMax(int step=-1, bool onlyVisible=false, int tensorRep=0, int forceNumComponents=0, int componentMap[9]=nullptr)
Definition: PViewDataList.cpp:205
PViewDataList::getString2D
void getString2D(int i, int step, std::string &str, double &x, double &y, double &style)
Definition: PViewDataList.cpp:569
PViewDataList::polyAgNumNodes
std::vector< int > polyAgNumNodes[2]
Definition: PViewDataList.h:52
PViewDataList::getNumStrings3D
int getNumStrings3D()
Definition: PViewDataList.h:119
PViewDataList::addStep
void addStep(std::vector< double > &y)
Definition: PViewDataList.cpp:64
PViewDataList::TY
std::vector< double > TY
Definition: PViewDataList.h:43
PViewDataList::readPOS
bool readPOS(FILE *fp, double version, bool binary)
Definition: PViewDataListIO.cpp:90
PViewDataList::TP
std::vector< double > TP
Definition: PViewDataList.h:27
PViewDataList::getNumTimeSteps
int getNumTimeSteps()
Definition: PViewDataList.h:79
PViewDataList::_setLast
void _setLast(int ele)
Definition: PViewDataList.cpp:341
PViewDataList::SG
std::vector< double > SG
Definition: PViewDataList.h:35
PViewDataList::_lastDimension
int _lastDimension
Definition: PViewDataList.h:57
PViewDataList::getMin
double getMin(int step=-1, bool onlyVisible=false, int tensorRep=0, int forceNumComponents=0, int componentMap[9]=nullptr)
Definition: PViewDataList.cpp:181
PViewDataList::TR
std::vector< double > TR
Definition: PViewDataList.h:45
PViewDataList::_lastNumEdges
int _lastNumEdges
Definition: PViewDataList.h:58
PViewDataList::VP
std::vector< double > VP
Definition: PViewDataList.h:27
PViewDataList::NbTH
int NbTH
Definition: PViewDataList.h:38
PViewDataList::SP
std::vector< double > SP
Definition: PViewDataList.h:27
SBoundingBox3d.h
PViewDataList::T3C
std::vector< char > T3C
Definition: PViewDataList.h:50
PViewDataList::getTime
double getTime(int step)
Definition: PViewDataList.cpp:175
PViewDataList::getNumHexahedra
int getNumHexahedra(int step=-1)
Definition: PViewDataList.h:98
PViewDataList::SL
std::vector< double > SL
Definition: PViewDataList.h:29
PViewDataList::polyTotNumNodes
int polyTotNumNodes[2]
Definition: PViewDataList.h:53
PViewDataList::setValue
void setValue(int step, int ent, int ele, int nod, int comp, double val)
Definition: PViewDataList.cpp:496
PViewDataList::getBoundingBox
SBoundingBox3d getBoundingBox(int step=-1)
Definition: PViewDataList.h:87
PViewDataList::getNumScalars
int getNumScalars(int step=-1)
Definition: PViewDataList.cpp:152
PViewDataList::NbVS
int NbVS
Definition: PViewDataList.h:36
PViewDataList::_lastVal
double * _lastVal
Definition: PViewDataList.h:60
PViewDataList::_lastNumComponents
int _lastNumComponents
Definition: PViewDataList.h:58
PViewDataList::getNumPyramids
int getNumPyramids(int step=-1)
Definition: PViewDataList.h:100
PViewDataList::getString3D
void getString3D(int i, int step, std::string &str, double &x, double &y, double &z, double &style)
Definition: PViewDataList.cpp:576
PViewDataList::getNumVectors
int getNumVectors(int step=-1)
Definition: PViewDataList.cpp:158
PViewDataList::_stat
void _stat(std::vector< double > &D, std::vector< char > &C, int nb)
Definition: PViewDataList.cpp:229
PViewDataList::finalize
bool finalize(bool computeMinMax=true, const std::string &interpolationScheme="")
Definition: PViewDataList.cpp:81
PViewDataList::NbVD
int NbVD
Definition: PViewDataList.h:46
PViewDataList::isAdapted
bool isAdapted()
Definition: PViewDataList.h:76
PViewDataList::getNumComponents
int getNumComponents(int step, int ent, int ele)
Definition: PViewDataList.cpp:468
PViewDataList::setOrder2
void setOrder2(int type)
Definition: PViewDataList.cpp:1220
PViewDataList::getNumStrings2D
int getNumStrings2D()
Definition: PViewDataList.h:118
PViewDataList::ST
std::vector< double > ST
Definition: PViewDataList.h:31
PViewDataList::getNumPrisms
int getNumPrisms(int step=-1)
Definition: PViewDataList.h:99
PViewDataList::TT
std::vector< double > TT
Definition: PViewDataList.h:31
PViewDataList::NbVP
int NbVP
Definition: PViewDataList.h:26
PViewDataList::NbTS
int NbTS
Definition: PViewDataList.h:36
PViewDataList::VD
std::vector< double > VD
Definition: PViewDataList.h:47
PViewData
Definition: PViewData.h:29
PViewDataList::_getString
void _getString(int dim, int i, int timestep, std::string &str, double &x, double &y, double &z, double &style)
Definition: PViewDataList.cpp:517
PViewDataList::TG
std::vector< double > TG
Definition: PViewDataList.h:35
PViewDataList::NbT2
int NbT2
Definition: PViewDataList.h:48
PViewDataList::NbSL
int NbSL
Definition: PViewDataList.h:28
PViewDataList::getNumElements
int getNumElements(int step=-1, int ent=-1)
Definition: PViewDataList.cpp:170
PViewDataList::setXY
void setXY(std::vector< double > &x, std::vector< double > &y)
Definition: PViewDataList.cpp:34
PViewDataList::TH
std::vector< double > TH
Definition: PViewDataList.h:39
PViewDataList::SH
std::vector< double > SH
Definition: PViewDataList.h:39
PViewDataList::NbTI
int NbTI
Definition: PViewDataList.h:40
PViewDataList::getNumTrihedra
int getNumTrihedra(int step=-1)
Definition: PViewDataList.h:101
PViewDataList::NbSS
int NbSS
Definition: PViewDataList.h:36
PViewDataList::setNode
void setNode(int step, int ent, int ele, int nod, double x, double y, double z)
Definition: PViewDataList.cpp:458
PViewDataList::NbTY
int NbTY
Definition: PViewDataList.h:42
PViewDataList::T2D
std::vector< double > T2D
Definition: PViewDataList.h:49
PViewDataList::NbVL
int NbVL
Definition: PViewDataList.h:28
PViewDataList::PViewDataList
PViewDataList(bool isAdapted=false)
Definition: PViewDataList.cpp:17
z
const double z
Definition: GaussQuadratureQuad.cpp:56
PViewDataList::NbSD
int NbSD
Definition: PViewDataList.h:46
PViewDataList::_isAdapted
bool _isAdapted
Definition: PViewDataList.h:61
PViewDataList::getNumValues
int getNumValues(int step, int ent, int ele)
Definition: PViewDataList.cpp:474
PViewDataList::VG
std::vector< double > VG
Definition: PViewDataList.h:35
PViewDataList::TD
std::vector< double > TD
Definition: PViewDataList.h:47
PViewDataList::NbTR
int NbTR
Definition: PViewDataList.h:44
PViewDataList::NbSI
int NbSI
Definition: PViewDataList.h:40
PViewDataList::Time
std::vector< double > Time
Definition: PViewDataList.h:25
PViewDataList::getValue
void getValue(int step, int ent, int ele, int idx, double &val)
Definition: PViewDataList.cpp:480
PViewDataList::VS
std::vector< double > VS
Definition: PViewDataList.h:37
PViewDataList::setXYZV
void setXYZV(std::vector< double > &x, std::vector< double > &y, std::vector< double > &z, std::vector< double > &v)
Definition: PViewDataList.cpp:48
PViewDataList::NbSR
int NbSR
Definition: PViewDataList.h:44
PViewDataList::~PViewDataList
~PViewDataList()
Definition: PViewDataList.h:75
PViewDataList::_lastNumValues
int _lastNumValues
Definition: PViewDataList.h:58
PViewDataList::NbTQ
int NbTQ
Definition: PViewDataList.h:32
PViewDataList::NbVI
int NbVI
Definition: PViewDataList.h:40
PViewDataList::SI
std::vector< double > SI
Definition: PViewDataList.h:41
PViewDataList::getNumTriangles
int getNumTriangles(int step=-1)
Definition: PViewDataList.h:94
PViewDataList::_lastXYZ
double * _lastXYZ
Definition: PViewDataList.h:60
PViewDataList::NbVT
int NbVT
Definition: PViewDataList.h:30
PViewDataList::_lastElement
int _lastElement
Definition: PViewDataList.h:57
PViewDataList::getNode
int getNode(int step, int ent, int ele, int nod, double &x, double &y, double &z)
Definition: PViewDataList.cpp:448
PViewDataList::getNumEdges
int getNumEdges(int step, int ent, int ele)
Definition: PViewDataList.cpp:505
PViewDataList::combineTime
bool combineTime(nameData &nd)
Definition: PViewDataList.cpp:832
PViewDataList::NbVQ
int NbVQ
Definition: PViewDataList.h:32
PViewDataList::writePOS
bool writePOS(const std::string &fileName, bool binary=false, bool parsed=true, bool append=false)
Definition: PViewDataListIO.cpp:403
PViewDataList::VI
std::vector< double > VI
Definition: PViewDataList.h:41
PViewDataList::VT
std::vector< double > VT
Definition: PViewDataList.h:31
PViewDataList::SQ
std::vector< double > SQ
Definition: PViewDataList.h:33
PViewDataList::combineSpace
bool combineSpace(nameData &nd)
Definition: PViewDataList.cpp:698
PViewDataList::NbTD
int NbTD
Definition: PViewDataList.h:46
SBoundingBox3d
Definition: SBoundingBox3d.h:21
PViewDataList::setMax
void setMax(double max)
Definition: PViewDataList.h:86
PViewDataList::NbST
int NbST
Definition: PViewDataList.h:30
PViewDataList::writeMSH
virtual bool writeMSH(const std::string &fileName, double version=2.2, bool binary=false, bool savemesh=true, bool multipleView=false, int partitionNum=-1, bool saveInterpolationMatrices=true, bool forceNodeData=false, bool forceElementData=false)
Definition: PViewDataListIO.cpp:632
PViewDataList::NbSY
int NbSY
Definition: PViewDataList.h:42
PViewDataList::NbTG
int NbTG
Definition: PViewDataList.h:34