gmsh-TingyuanDoc
0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
|
Go to the documentation of this file.
16 : _dirty(true), _fileIndex(0), _octree(nullptr), _pc2kdtree(_pc),
17 _kdtree(nullptr), _adaptive(nullptr)
25 for(std::size_t i = 0; i < it->second.size(); i++)
delete it->second[i];
31 const std::string &interpolationScheme)
40 Msg::Debug(
"Initializing adaptive data %p interp size=%d",
this,
50 Msg::Debug(
"Initializing adaptive data %p interp size=%d",
this,
56 bool outDataInit =
false;
62 int useDefaultName,
int step,
int level,
63 double tol,
int npart,
bool isBinary)
69 guifileName, useDefaultName);
74 guifileName, useDefaultName);
93 if(samplingRate <= 1)
return false;
94 return ele % samplingRate;
98 int tensorRep,
int forceNumComponents,
102 if(forceNumComponents && componentMap) {
103 std::vector<double> d(forceNumComponents);
104 for(
int i = 0; i < forceNumComponents; i++) {
105 int comp = componentMap[i];
106 if(comp >= 0 && comp < numComp)
107 getValue(step, ent, ele, nod, comp, d[i]);
113 else if(numComp == 1) {
114 getValue(step, ent, ele, nod, 0, val);
117 std::vector<double> d(numComp);
118 for(
int comp = 0; comp < numComp; comp++)
119 getValue(step, ent, ele, nod, comp, d[comp]);
127 Msg::Error(
"Cannot change node coordinates in this view");
133 Msg::Error(
"Cannot change field value in this view");
138 Msg::Error(
"Cannot get model from this view");
144 Msg::Error(
"Cannot get entity from this view");
150 Msg::Error(
"Cannot get element from this view");
203 for(
auto it2 = it->second.begin(); it2 != it->second.end(); it2++)
204 for(std::size_t i = 0; i < it2->second.size(); i++)
delete it2->second[i];
213 for(
auto it2 = it->second.begin(); it2 != it->second.end(); it2++)
214 for(std::size_t i = 0; i < it2->second.size(); i++)
delete it2->second[i];
233 Msg::Error(
"Smoothing is not implemented for this type of data");
238 Msg::Error(
"Combine time is not implemented for this type of data");
244 Msg::Error(
"Combine space is not implemented for this type of data");
250 double x = xn, y = yn,
z = zn;
256 double dist2 = 1e200;
263 for(
int nod = 0; nod < numNodes; nod++) {
265 getNode(step, ent, ele, nod, xx, yy, zz);
267 (x - xx) * (x - xx) + (y - yy) * (y - yy) + (
z - zz) * (
z - zz);
291 for(
int nod = 0; nod < numNodes; nod++) {
293 getNode(step, ent, ele, nod, xx, yy, zz);
303 double query_pt[3] = {x, y,
z};
305 double squ_dist = 0.;
307 resultSet.
init(&idx, &squ_dist);
309 if(idx <
_pc.
pts.size()) {
313 return sqrt(squ_dist);
323 int step,
double *size,
int qn,
double *qx,
324 double *qy,
double *qz,
bool grad,
int dim)
334 return _octree->
searchScalar(x, y,
z, values, step, size, qn, qx, qy, qz,
340 int step,
double *size,
341 int qn,
double *qx,
double *qy,
342 double *qz,
bool grad,
int dim)
344 bool ret =
searchScalar(x, y,
z, values, step, size, qn, qx, qy, qz, grad,
350 double xn = x, yn = y, zn =
z, distanceMax =
distance;
352 if(distanceMax < 0. ||
distance <= distanceMax)
353 ret =
searchScalar(xn, yn, zn, values, step, size, qn, qx, qy, qz, grad,
363 int step,
double *size,
int qn,
double *qx,
364 double *qy,
double *qz,
bool grad,
int dim)
374 return _octree->
searchVector(x, y,
z, values, step, size, qn, qx, qy, qz,
380 int step,
double *size,
381 int qn,
double *qx,
double *qy,
382 double *qz,
bool grad,
int dim)
384 bool ret =
searchVector(x, y,
z, values, step, size, qn, qx, qy, qz, grad,
390 double xn = x, yn = y, zn =
z, distanceMax =
distance;
392 if(distanceMax < 0. ||
distance <= distanceMax)
393 ret =
searchVector(xn, yn, zn, values, step, size, qn, qx, qy, qz, grad,
403 int step,
double *size,
int qn,
double *qx,
404 double *qy,
double *qz,
bool grad,
int dim)
414 return _octree->
searchTensor(x, y,
z, values, step, size, qn, qx, qy, qz,
420 int step,
double *size,
421 int qn,
double *qx,
double *qy,
422 double *qz,
bool grad,
int dim)
424 bool ret =
searchTensor(x, y,
z, values, step, size, qn, qx, qy, qz, grad,
430 double xn = x, yn = y, zn =
z, distanceMax =
distance;
432 if(distanceMax < 0 ||
distance <= distanceMax)
433 ret =
searchTensor(xn, yn, zn, values, step, size, qn, qx, qy, qz, grad,
bool findNeighbors(RESULTSET &result, const ElementType *vec, const SearchParams &searchParams) const
bool searchVector(double x, double y, double z, double *values, int step=-1, double *size=nullptr, int qn=0, double *qx=nullptr, double *qy=nullptr, double *qz=nullptr, bool grad=false, int dim=-1)
bool searchScalar(double x, double y, double z, double *values, int step=-1, double *size=nullptr, int qn=0, double *qx=nullptr, double *qy=nullptr, double *qz=nullptr, bool grad=false, int dim=-1)
virtual bool skipElement(int step, int ent, int ele, bool checkVisibility=false, int samplingRate=1)
double distance(MVertex *v1, MVertex *v2)
virtual int getNumStrings3D()
virtual bool combineSpace(nameData &nd)
virtual int getNumStrings2D()
virtual void setValue(int step, int ent, int ele, int nod, int comp, double val)
static void Debug(const char *fmt,...)
virtual int getNode(int step, int ent, int ele, int nod, double &x, double &y, double &z)
static void Error(const char *fmt,...)
int getInterpolationMatrices(int type, std::vector< fullMatrix< double > * > &p)
virtual void getValue(int step, int ent, int ele, int idx, double &val)
bool searchVectorClosest(double x, double y, double z, double &distance, double *values, int step=-1, double *size=nullptr, int qn=0, double *qx=nullptr, double *qy=nullptr, double *qz=nullptr, bool grad=false, int dim=-1)
interpolationMatrices _interpolation
void changeResolution(int step, int level, double tol, GMSH_PostPlugin *plug=nullptr)
virtual void setNode(int step, int ent, int ele, int nod, double x, double y, double z)
virtual int getNumEntities(int step=-1)
bool haveInterpolationMatrices(int type=0)
bool searchScalarClosest(double x, double y, double z, double &distance, double *values, int step=-1, double *size=nullptr, int qn=0, double *qx=nullptr, double *qy=nullptr, double *qz=nullptr, bool grad=false, int dim=-1)
void changeResolutionForVTK(int step, int level, double tol, int npart=1, bool isBinary=true, const std::string &guifileName="unknown", int useDefaultName=1)
void initAdaptiveData(int step, int level, double tol)
nanoflann::KDTreeSingleIndexAdaptor< nanoflann::L2_Simple_Adaptor< double, SPoint3CloudAdaptor< SPoint3Cloud > >, SPoint3CloudAdaptor< SPoint3Cloud >, 3 > SPoint3KDTree
void setInterpolationMatrices(int type, const fullMatrix< double > &coefVal, const fullMatrix< double > &expVal)
SPoint3CloudAdaptor< SPoint3Cloud > _pc2kdtree
void getScalarValue(int step, int ent, int ele, int nod, double &val, int tensorRep=0, int forceNumComponents=0, int componentMap[9]=nullptr)
std::vector< SPoint3 > pts
void initAdaptiveDataLight(int step, int level, double tol)
static void removeAllInterpolationSchemes()
static void addMatrixToInterpolationScheme(const std::string &name, int type, fullMatrix< double > &mat)
void init(IndexType *indices_, DistanceType *dists_)
void destroyAdaptiveData()
virtual GModel * getModel(int step)
virtual int getNumNodes(int step, int ent, int ele)
void deleteInterpolationMatrices(int type=0)
bool searchScalar(double x, double y, double z, double *values, int step=-1, double *size=nullptr, int qn=0, double *qx=nullptr, double *qy=nullptr, double *qz=nullptr, bool grad=false, int dim=-1)
virtual bool combineTime(nameData &nd)
static void removeInterpolationScheme(const std::string &name)
virtual MElement * getElement(int step, int entity, int element)
static std::map< std::string, interpolationMatrices > _interpolationSchemes
virtual int getNumComponents(int step, int ent, int ele)
bool searchVector(double x, double y, double z, double *values, int step=-1, double *size=nullptr, int qn=0, double *qx=nullptr, double *qy=nullptr, double *qz=nullptr, bool grad=false, int dim=-1)
static int getSizeInterpolationScheme()
virtual int getNumElements(int step=-1, int ent=-1)
bool searchTensorClosest(double x, double y, double z, double &distance, double *values, int step=-1, double *size=nullptr, int qn=0, double *qx=nullptr, double *qy=nullptr, double *qz=nullptr, bool grad=false, int dim=-1)
void saveAdaptedViewForVTK(const std::string &guifileName, int useDefaultName, int step, int level, double tol, int npart, bool isBinary)
bool searchTensor(double x, double y, double z, double *values, int step=-1, double *size=nullptr, int qn=0, double *qx=nullptr, double *qy=nullptr, double *qz=nullptr, bool grad=false, int dim=-1)
virtual bool finalize(bool computeMinMax=true, const std::string &interpolationScheme="")
double findClosestNode(double &xn, double &yn, double &zn, int step)
double ComputeScalarRep(int numComp, double *val, int tensorRep)
bool searchTensor(double x, double y, double z, double *values, int step=-1, double *size=nullptr, int qn=0, double *qx=nullptr, double *qy=nullptr, double *qz=nullptr, bool grad=false, int dim=-1)
virtual GEntity * getEntity(int step, int entity)
virtual int getFirstNonEmptyTimeStep(int start=0)