gmsh-TingyuanDoc
0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
|
Go to the documentation of this file.
6 #ifndef ADAPTIVE_DATA_H
7 #define ADAPTIVE_DATA_H
23 typedef unsigned __int8 uint8_t;
24 typedef unsigned __int64 uint64_t;
28 #define __STDC_FORMAT_MACROS
39 template <
class T> std::string
ToString(
const T &val)
41 std::stringstream stream;
56 std::set<adaptiveVertex> &allVertice);
59 if(other.
x <
x)
return true;
60 if(other.
x >
x)
return false;
61 if(other.
y <
y)
return true;
62 if(other.
y >
y)
return false;
63 if(other.
z <
z)
return true;
83 static std::list<adaptivePoint *>
all;
93 inline double V()
const {
return p[0]->
val; }
98 static void create(
int maxlevel);
100 static void error(
double AVG,
double tol);
109 static std::list<adaptiveLine *>
all;
118 e[0] =
e[1] =
nullptr;
120 inline double V()
const {
return (
p[0]->val +
p[1]->val) / 2.; }
123 sf(0) = (1 - u) / 2.;
124 sf(1) = (1 + u) / 2.;
126 static void create(
int maxlevel);
128 static void error(
double AVG,
double tol);
137 static std::list<adaptiveTriangle *>
all;
148 e[0] =
e[1] =
e[2] =
e[3] =
nullptr;
150 inline double V()
const {
return (
p[0]->val +
p[1]->val +
p[2]->val) / 3.; }
157 static void create(
int maxlevel);
159 static void error(
double AVG,
double tol);
168 static std::list<adaptiveQuadrangle *>
all;
181 e[0] =
e[1] =
e[2] =
e[3] =
nullptr;
183 inline double V()
const
185 return (
p[0]->val +
p[1]->val +
p[2]->val +
p[3]->val) / 4.;
189 sf(0) = 0.25 * (1. - u) * (1. - v);
190 sf(1) = 0.25 * (1. + u) * (1. - v);
191 sf(2) = 0.25 * (1. + u) * (1. + v);
192 sf(3) = 0.25 * (1. - u) * (1. + v);
194 static void create(
int maxlevel);
196 static void error(
double AVG,
double tol);
205 static std::list<adaptivePrism *>
all;
220 e[0] =
e[1] =
e[2] =
e[3] =
nullptr;
221 e[4] =
e[5] =
e[6] =
e[7] =
nullptr;
223 inline double V()
const
225 return (
p[0]->val +
p[1]->val +
p[2]->val +
p[3]->val +
p[4]->val +
231 sf(0) = (1. - u - v) * (1 - w) / 2;
232 sf(1) = u * (1 - w) / 2;
233 sf(2) = v * (1 - w) / 2;
234 sf(3) = (1. - u - v) * (1 + w) / 2;
235 sf(4) = u * (1 + w) / 2;
236 sf(5) = v * (1 + w) / 2;
238 static void create(
int maxlevel);
240 static void error(
double AVG,
double tol);
249 static std::list<adaptiveTetrahedron *>
all;
262 e[0] =
e[1] =
e[2] =
e[3] =
nullptr;
263 e[4] =
e[5] =
e[6] =
e[7] =
nullptr;
265 inline double V()
const
267 return (
p[0]->val +
p[1]->val +
p[2]->val +
p[3]->val) / 4.;
271 sf(0) = 1. - u - v - w;
276 static void create(
int maxlevel);
278 static void error(
double AVG,
double tol);
287 static std::list<adaptiveHexahedron *>
all;
305 e[0] =
e[1] =
e[2] =
e[3] =
nullptr;
306 e[4] =
e[5] =
e[6] =
e[7] =
nullptr;
308 inline double V()
const
310 return (
p[0]->val +
p[1]->val +
p[2]->val +
p[3]->val +
p[4]->val +
311 p[5]->val +
p[6]->val +
p[7]->val) /
316 sf(0) = 0.125 * (1 - u) * (1 - v) * (1 - w);
317 sf(1) = 0.125 * (1 + u) * (1 - v) * (1 - w);
318 sf(2) = 0.125 * (1 + u) * (1 + v) * (1 - w);
319 sf(3) = 0.125 * (1 - u) * (1 + v) * (1 - w);
320 sf(4) = 0.125 * (1 - u) * (1 - v) * (1 + w);
321 sf(5) = 0.125 * (1 + u) * (1 - v) * (1 + w);
322 sf(6) = 0.125 * (1 + u) * (1 + v) * (1 + w);
323 sf(7) = 0.125 * (1 - u) * (1 + v) * (1 + w);
325 static void create(
int maxlevel);
327 static void error(
double AVG,
double tol);
338 static std::list<adaptivePyramid *>
all;
352 for(
int i = 0; i < 10; i++)
e[i] =
nullptr;
354 inline double V()
const
356 return (
p[0]->val +
p[1]->val +
p[2]->val +
p[3]->val +
p[4]->val) / 5.;
361 double ww = 0.25 / std::max(1
e-14, 1. - w);
362 sf(0) = (1 - u - w) * (1 - v - w) * ww;
363 sf(1) = (1 + u - w) * (1 - v - w) * ww;
364 sf(2) = (1 + u - w) * (1 + v - w) * ww;
365 sf(3) = (1 - u - w) * (1 + v - w) * ww;
368 static void create(
int maxlevel);
370 static void error(
double AVG,
double tol);
393 for(
int i = 0; i <
sizev; i++) {
v[i] = obj.
v[i]; }
399 for(
int i = 0; i <
sizev; i++) {
v[i] = 0.0; }
415 PValues(
double vxx,
double vxy,
double vxz,
double vyx,
double vyy,
416 double vyz,
double vzx,
double vzy,
double vzz)
436 Msg::Error(
"In PValues overlodaing operator: size mistmatch %d %d",
438 for(
int i = 0; i <
sizev; i++) {
v[i] = obj.
v[i]; }
444 static std::vector<vectInt>
448 static std::vector<PValues>
529 VTKData(std::string fieldName =
"unknown",
int numComp = -1,
int step = -1,
530 int level = -1,
double tol = 0.0, std::string filename =
"unknown",
531 int useDefaultName = 1,
int npart = -1,
bool isBinary =
true)
606 void init(
int level);
609 bool adapt(
double tol,
int numComp, std::vector<PCoords> &coords,
610 std::vector<PValues> &values,
double &minVal,
double &maxVal,
624 void adaptForVTK(
double tol,
int numComp, std::vector<PCoords> &coords,
625 std::vector<PValues> &values,
double &minVal,
630 bool writeVtk =
true,
bool buildStaticData =
false);
679 bool isBinary =
true,
680 const std::string &guifileName =
"unknown",
681 int useDefaultName = 1);
adaptiveElements< adaptiveTriangle > * _triangles
static void GSF(double u, double v, double w, fullVector< double > &sf)
static std::list< adaptiveLine * > all
fullMatrix< double > * _coeffsVal
static void create(int maxlevel)
static std::set< adaptiveVertex > allVertices
adaptiveLine(adaptiveVertex *p1, adaptiveVertex *p2)
PCoords(double x, double y, double z)
int countTotElmLev0(int step, PViewData *in)
static void GSF(double u, double v, double w, fullVector< double > &sf)
static std::set< adaptiveVertex > allVertices
static void recurCreate(adaptiveHexahedron *h, int maxlevel, int level)
int countElmLev0(int step, PViewData *in)
int getPVCellType(int numEdges)
void setFileDistribution()
static std::set< adaptiveVertex > allVertices
bool operator<(const adaptiveVertex &other) const
adaptivePoint(adaptiveVertex *p1)
PValues(double vxx, double vxy, double vxz, double vyx, double vyy, double vyz, double vzx, double vzy, double vzz)
static void create(int maxlevel)
static std::list< adaptivePyramid * > all
adaptiveElements(std::vector< fullMatrix< double > * > &interpolationMatrices)
adaptiveHexahedron(adaptiveVertex *p1, adaptiveVertex *p2, adaptiveVertex *p3, adaptiveVertex *p4, adaptiveVertex *p5, adaptiveVertex *p6, adaptiveVertex *p7, adaptiveVertex *p8)
adaptiveHexahedron * e[8]
static std::list< adaptiveTriangle * > all
static void Error(const char *fmt,...)
fullMatrix< double > * _eexpsGeom
static std::set< adaptiveVertex > allVertices
static void recurCreate(adaptivePoint *e, int maxlevel, int level)
void buildMapping(nodMap< T > &myNodMap, double tol, int &numNodInsert)
static std::vector< PValues > vtkGlobalValues
std::string ToString(const T &val)
static std::vector< int > vtkGlobalCellType
static void error(double AVG, double tol)
static std::list< adaptivePoint * > all
static void create(int maxlevel)
static void GSF(double u, double v, double w, fullVector< double > &sf)
static void recurError(adaptiveQuadrangle *q, double AVG, double tol)
void changeResolution(int step, int level, double tol, GMSH_PostPlugin *plug=nullptr)
static void error(double AVG, double tol)
static void create(int maxlevel)
static void create(int maxlevel)
static void create(int maxlevel)
static std::set< adaptiveVertex > allVertices
void changeResolutionForVTK(int step, int level, double tol, int npart=1, bool isBinary=true, const std::string &guifileName="unknown", int useDefaultName=1)
adaptiveTriangle(adaptiveVertex *p1, adaptiveVertex *p2, adaptiveVertex *p3)
static void create(int maxlevel)
static void recurError(adaptiveHexahedron *h, double AVG, double tol)
static void clearGlobalData()
bool adapt(double tol, int numComp, std::vector< PCoords > &coords, std::vector< PValues > &values, double &minVal, double &maxVal, GMSH_PostPlugin *plug=nullptr, bool onlyComputeMinMax=false)
PValues(const PValues &obj)
static void GSF(double u, double v, double w, fullVector< double > &sf)
static std::set< adaptiveVertex > allVertices
int vtkCountTotNodConnect
static void error(double AVG, double tol)
double valz
maximal three values
static void error(double AVG, double tol)
adaptivePrism(adaptiveVertex *p1, adaptiveVertex *p2, adaptiveVertex *p3, adaptiveVertex *p4, adaptiveVertex *p5, adaptiveVertex *p6)
static void recurCreate(adaptiveTriangle *t, int maxlevel, int level)
static void GSF(double u, double v, double w, fullVector< double > &sf)
adaptiveElements< adaptiveLine > * _lines
static void recurCreate(adaptiveQuadrangle *q, int maxlevel, int level)
std::vector< vectInt > vtkLocalConnectivity
adaptiveElements< adaptiveTetrahedron > * _tetrahedra
static void recurError(adaptiveTriangle *t, double AVG, double tol)
static std::list< adaptiveQuadrangle * > all
fullMatrix< double > * _eexpsVal
static void error(double AVG, double tol)
float z
parametric coordinates
static std::set< adaptiveVertex > allVertices
fullMatrix< double > * _interpolVal
static void recurError(adaptivePyramid *h, double AVG, double tol)
void operator=(const PValues &obj)
void SwapArrayByteOrder(void *array, int nbytes, int nItems)
static void clearGlobalConnectivity()
static std::list< adaptiveTetrahedron * > all
double Z
cartesian coordinates
static void recurError(adaptiveLine *e, double AVG, double tol)
std::vector< PCoords > vtkLocalCoords
static void error(double AVG, double tol)
static void recurCreate(adaptivePrism *p, int maxlevel, int level)
static void recurError(adaptivePrism *p, double AVG, double tol)
std::vector< int > mapping
adaptiveElements< adaptivePoint > * _points
adaptiveElements< adaptivePyramid > * _pyramids
std::map< int, std::vector< fullMatrix< double > * > > interpolationMatrices
static void recurCreate(adaptiveLine *e, int maxlevel, int level)
static adaptiveVertex * add(double x, double y, double z, std::set< adaptiveVertex > &allVertice)
adaptiveQuadrangle(adaptiveVertex *p1, adaptiveVertex *p2, adaptiveVertex *p3, adaptiveVertex *p4)
void incrementTotElmLev0(int increment)
static std::set< adaptiveVertex > allVertices
adaptiveElements< adaptiveHexahedron > * _hexahedra
void upBuildStaticData(bool newValue)
void adaptForVTK(double tol, int numComp, std::vector< PCoords > &coords, std::vector< PValues > &values, double &minVal, double &maxVal)
static void recurCreate(adaptiveTetrahedron *t, int maxlevel, int level)
static void create(int maxlevel)
adaptiveTetrahedron(adaptiveVertex *p1, adaptiveVertex *p2, adaptiveVertex *p3, adaptiveVertex *p4)
adaptiveElements< adaptivePrism > * _prisms
adaptiveTetrahedron * e[8]
void addInViewForVTK(int step, PViewData *in, VTKData &myVTKData, bool writeVtk=true, bool buildStaticData=false)
adaptiveData(PViewData *data, bool outDataInit=true)
adaptiveElements< adaptiveQuadrangle > * _quadrangles
adaptivePyramid(adaptiveVertex *p1, adaptiveVertex *p2, adaptiveVertex *p3, adaptiveVertex *p4, adaptiveVertex *p5)
void incrementTotElm(int increment)
static std::list< adaptivePrism * > all
static void recurCreate(adaptivePyramid *h, int maxlevel, int level)
static void error(double AVG, double tol)
static void recurError(adaptivePoint *e, double AVG, double tol)
VTKData(std::string fieldName="unknown", int numComp=-1, int step=-1, int level=-1, double tol=0.0, std::string filename="unknown", int useDefaultName=1, int npart=-1, bool isBinary=true)
std::vector< int > vtkLocalCellType
static std::vector< PCoords > vtkGlobalCoords
static void GSF(double u, double v, double w, fullVector< double > &sf)
static void error(double AVG, double tol)
PValues(double vx, double vy, double vz)
static void GSF(double u, double v, double w, fullVector< double > &sf)
static void GSF(double u, double v, double w, fullVector< double > &sf)
static void clearGlobalValues()
void upWriteVTK(bool newValue)
fullMatrix< double > * _interpolGeom
static void recurError(adaptiveTetrahedron *t, double AVG, double tol)
static std::list< adaptiveHexahedron * > all
static std::vector< vectInt > vtkGlobalConnectivity
void addInView(double tol, int step, PViewData *in, PViewDataList *out, GMSH_PostPlugin *plug=nullptr)
std::vector< int > vectInt
adaptiveQuadrangle * e[4]
static void clearGlobalCoords()
std::vector< PValues > vtkLocalValues
void incrementTotNod(int increment)
static void clearGlobalCellType()
fullMatrix< double > * _coeffsGeom