gmsh-TingyuanDoc
0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
|
Go to the documentation of this file.
6 #ifndef PVIEW_DATA_GMODEL_H
7 #define PVIEW_DATA_GMODEL_H
53 int fileIndex = -1,
double time = 0.,
double min =
VAL_INF,
72 _data =
new std::vector<Real *>(n, (Real *)0);
73 for(std::size_t i = 0; i < n; i++) {
77 (*_data)[i] =
new Real[m];
78 for(
int j = 0; j < m; j++) (*
_data)[i][j] = d[j];
96 if(index < 0 || index >= (
int)
_mult.size())
return 1;
112 return _data->size();
116 if(!
_data)
_data =
new std::vector<Real *>(n, (Real *)0);
117 if(n > (
int)
_data->size())
_data->resize(n, (Real *)0);
119 Real *
getData(
int index,
bool allocIfNeeded =
false,
int mult = 1)
121 if(index < 0)
return 0;
124 if(!(*
_data)[index]) {
129 if(index >= (
int)
_mult.size())
130 _mult.resize(index + 100, 1);
137 return (*
_data)[index];
142 for(
unsigned int i = 0; i <
_data->size(); i++)
143 if((*
_data)[i])
delete[](*_data)[i];
151 int imax = 0, imin = 0;
152 for(
auto m : mapping) {
153 imax = std::max(imax, m.second);
154 imin = std::min(imin, m.second);
157 Msg::Warning(
"Wrong destination index %d in step data renumbering", imin);
160 std::vector<Real *> data2(imax + 1,
nullptr);
161 std::vector<int> mult2(imax + 1, 1);
162 for(
auto m : mapping) {
163 if(m.first >= 0 && m.first < (
int)
_data->size()) {
164 data2[m.second] = (*_data)[m.first];
167 Msg::Warning(
"Wrong source index %d in step data renumbering", m.first);
170 if(m.first >= 0 && m.first < (
int)
_mult.size())
171 mult2[m.second] =
_mult[m.first];
215 bool finalize(
bool computeMinMax =
true,
216 const std::string &interpolationScheme =
"");
221 double getMin(
int step = -1,
bool onlyVisible =
false,
int tensorRep = 0,
222 int forceNumComponents = 0,
int componentMap[9] =
nullptr);
223 double getMax(
int step = -1,
bool onlyVisible =
false,
int tensorRep = 0,
224 int forceNumComponents = 0,
int componentMap[9] =
nullptr);
247 int getNode(
int step,
int ent,
int ele,
int nod,
double &x,
double &y,
249 void setNode(
int step,
int ent,
int ele,
int nod,
double x,
double y,
251 void tagNode(
int step,
int ent,
int ele,
int nod,
int tag);
254 void getValue(
int step,
int ent,
int ele,
int idx,
double &val);
255 void getValue(
int step,
int ent,
int ele,
int node,
int comp,
double &val);
256 void setValue(
int step,
int ent,
int ele,
int node,
int comp,
double val);
258 int getType(
int step,
int ent,
int ele);
264 bool skipElement(
int step,
int ent,
int ele,
bool checkVisibility =
false,
265 int samplingRate = 1);
284 bool addData(
GModel *model,
const std::map<
int, std::vector<double> > &data,
285 int step,
double time,
int partition,
int numComp);
289 const std::vector<std::vector<double> > &data,
int step,
290 double time,
int partition,
int numComp);
294 const std::vector<double> &data,
int step,
double time,
295 int partition,
int numComp);
301 bool readMSH(
const std::string &viewName,
const std::string &fileName,
302 int fileIndex, FILE *fp,
bool binary,
bool swap,
int step,
303 double time,
int partition,
int numComp,
int numNodes,
304 const std::string &interpolationScheme);
305 virtual bool writeMSH(
const std::string &fileName,
double version = 2.2,
306 bool binary =
false,
bool savemesh =
true,
307 bool multipleView =
false,
int partitionNum = -1,
308 bool saveInterpolationMatrices =
true,
309 bool forceNodeData =
false,
310 bool forceElementData =
false);
311 bool readCGNS(
const std::pair<std::string, std::string> &solFieldName,
312 const std::string &fileName,
int index,
int fileIndex,
314 const std::vector<std::vector<MVertex *> > &vertPerZone,
315 const std::vector<std::vector<MElement *> > &eltPerZone);
316 bool readMED(
const std::string &fileName,
int fileIndex);
317 bool writeMED(
const std::string &fileName);
318 bool readPCH(
const std::string &fileName,
int fileIndex);
320 void importLists(
int N[24], std::vector<double> *V[24]);
323 if(step >= 0 && step < (
int)
_steps.size())
return _steps[step];
bool writeMED(const std::string &fileName)
std::set< int > & getPartitions()
static std::map< SPoint2, unsigned int > tags
double getMax(int step=-1, bool onlyVisible=false, int tensorRep=0, int forceNumComponents=0, int componentMap[9]=nullptr)
std::vector< stepData< double > * > _steps
int getNumPolyhedra(int step=-1)
int getNumValues(int step, int ent, int ele)
void setFileIndex(int index)
int getNumEdges(int step, int ent, int ele)
void setTime(double time)
int getNumQuadrangles(int step=-1)
bool readPCH(const std::string &fileName, int fileIndex)
int getNode(int step, int ent, int ele, int nod, double &x, double &y, double &z)
int getNumEntities(int step=-1)
std::vector< std::vector< double > > _gaussPoints
static void Warning(const char *fmt,...)
int getNumComponents(int step, int ent, int ele)
Real * getData(int index, bool allocIfNeeded=false, int mult=1)
GEntity * getEntity(int ent)
int getNumTrihedra(int step=-1)
MElement * getElement(int step, int entity, int element)
GEntity * getEntity(int step, int ent)
int getNumTetrahedra(int step=-1)
void setValue(int step, int ent, int ele, int node, int comp, double val)
int getNumVectors(int step=-1)
bool skipEntity(int step, int ent)
int getNumHexahedra(int step=-1)
bool finalize(bool computeMinMax=true, const std::string &interpolationScheme="")
MVertex * _getNode(MElement *e, int nod)
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)
int getNumTensors(int step=-1)
SBoundingBox3d bounds(bool aroundVisible=false)
int getFirstNonEmptyTimeStep(int start=0)
int getNumPyramids(int step=-1)
int getNumScalars(int step=-1)
void computeBoundingBox()
bool skipElement(int step, int ent, int ele, bool checkVisibility=false, int samplingRate=1)
bool readCGNS(const std::pair< std::string, std::string > &solFieldName, const std::string &fileName, int index, int fileIndex, int baseIndex, const std::vector< std::vector< MVertex * > > &vertPerZone, const std::vector< std::vector< MElement * > > &eltPerZone)
void setFileName(const std::string &name)
void importLists(int N[24], std::vector< double > *V[24])
void swap(double &a, double &b)
void getValue(int step, int ent, int ele, int idx, double &val)
int getNumElements(int step=-1, int ent=-1)
std::string getFileName()
std::vector< double > & getGaussPoints(int msh)
PViewDataGModel(DataType type=NodeData)
void sendToServer(const std::string &name)
bool hasModel(GModel *model, int step=-1)
SBoundingBox3d getBoundingBox()
Quaternion mult(const Quaternion &A, const Quaternion &B)
bool hasTimeStep(int step)
SBoundingBox3d getBoundingBox(int step=-1)
void getEntities(std::vector< GEntity * > &entities, int dim=-1) const
void tagNode(int step, int ent, int ele, int nod, int tag)
bool hasPartition(int step, int part)
void setNode(int step, int ent, int ele, int nod, double x, double y, double z)
std::string getFileName(int step=-1)
int getNumPoints(int step=-1)
int getNumPrisms(int step=-1)
bool readMED(const std::string &fileName, int fileIndex)
MElement * _getElement(int step, int ent, int ele)
bool combineTime(nameData &nd)
int getNumTriangles(int step=-1)
std::vector< GEntity * > _entities
int getNumLines(int step=-1)
int getDimension(int step, int ent, int ele)
double getMin(int step=-1, bool onlyVisible=false, int tensorRep=0, int forceNumComponents=0, int componentMap[9]=nullptr)
stepData(stepData< Real > &other)
void renumberData(const std::map< int, int > &mapping)
int getNumPolygons(int step=-1)
void reverseElement(int step, int ent, int ele)
int getNumNodes(int step, int ent, int ele)
stepData< double > * getStepData(int step)
void setBoundingBox(SBoundingBox3d &box)
std::set< int > _partitions
GModel * getModel(int step)
bool getValueByIndex(int step, int dataIndex, int node, int comp, double &val)
stepData(GModel *model, int numComp, const std::string &fileName="", int fileIndex=-1, double time=0., double min=VAL_INF, double max=-VAL_INF)
bool readMSH(const std::string &viewName, const std::string &fileName, int fileIndex, FILE *fp, bool binary, bool swap, int step, double time, int partition, int numComp, int numNodes, const std::string &interpolationScheme)
std::vector< Real * > * _data
bool addData(GModel *model, const std::map< int, std::vector< double > > &data, int step, double time, int partition, int numComp)