gmsh-TingyuanDoc
0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
|
Go to the documentation of this file.
23 return "Plugin(Warp) transforms the elements in the "
24 "view `View' by adding to their node coordinates "
25 "the vector field stored in the `TimeStep'-th time "
26 "step of the view `OtherView', scaled by `Factor'.\n\n"
27 "If `View' < 0, the plugin is run on the current view.\n\n"
28 "If `OtherView' < 0, the vector field is taken as the "
29 "field of surface normals multiplied by the `TimeStep' "
30 "value in `View'. (The smoothing of the surface "
31 "normals is controlled by the `SmoothingAngle' "
33 "Plugin(Warp) is executed in-place.";
56 if(otherView < 0) otherView = iView;
82 if(numEdges == 3 || numEdges == 4) {
83 double x[4], y[4],
z[4], n[4];
84 for(
int nod = 0; nod < numEdges; nod++)
85 data1->
getNode(0, ent, ele, nod, x[nod], y[nod],
z[nod]);
88 for(
int nod = 0; nod < numEdges; nod++)
89 normals->
add(x[nod], y[nod],
z[nod], n[0], n[1], n[2]);
101 for(
int nod = 0; nod < data1->
getNumNodes(step, ent, ele); nod++)
102 data1->
tagNode(step, ent, ele, nod, 0);
114 if(numNodes < 2)
continue;
115 double x[8], y[8],
z[8], n[3] = {0., 0., 0.};
117 for(
int nod = 0; nod < numNodes; nod++)
119 data1->
getNode(step, ent, ele, nod, x[nod], y[nod],
z[nod]);
121 if(normals && dim == 2)
124 for(
int nod = 0; nod < numNodes; nod++) {
126 double mult = 1., val[3] = {n[0], n[1], n[2]};
129 normals->
get(x[nod], y[nod],
z[nod], val[0], val[1], val[2]);
134 data2->
getNumNodes(TimeStep, ent, ele) == numNodes) {
135 for(
int comp = 0; comp < 3; comp++)
136 data2->
getValue(TimeStep, ent, ele, nod, comp, val[comp]);
138 x[nod] += factor *
mult * val[0];
139 y[nod] += factor *
mult * val[1];
140 z[nod] += factor *
mult * val[2];
141 data1->
setNode(step, ent, ele, nod, x[nod], y[nod],
z[nod]);
148 if(normals)
delete normals;
virtual int getNumEdges(int step, int ent, int ele)
StringXNumber * getOption(int iopt)
virtual bool skipElement(int step, int ent, int ele, bool checkVisibility=false, int samplingRate=1)
StringXNumber WarpOptions_Number[]
virtual int getNumTimeSteps()=0
virtual bool isNodeData()
virtual int getNode(int step, int ent, int ele, int nod, double &x, double &y, double &z)
static void Error(const char *fmt,...)
virtual void getValue(int step, int ent, int ele, int idx, double &val)
GMSH_Plugin * GMSH_RegisterWarpPlugin()
virtual void setNode(int step, int ent, int ele, int nod, double x, double y, double z)
virtual int getNumEntities(int step=-1)
void add(double x, double y, double z, double nx, double ny, double nz)
void setChanged(bool val)
virtual int getDimension(int step, int ent, int ele)
virtual void tagNode(int step, int ent, int ele, int nod, int tag)
void getScalarValue(int step, int ent, int ele, int nod, double &val, int tensorRep=0, int forceNumComponents=0, int componentMap[9]=nullptr)
std::string getHelp() const
virtual int getNumNodes(int step, int ent, int ele)
Quaternion mult(const Quaternion &A, const Quaternion &B)
virtual int getNumComponents(int step, int ent, int ele)
bool get(double x, double y, double z, double &nx, double &ny, double &nz) const
virtual PView * getView(int index, PView *view)
virtual PViewData * getPossiblyAdaptiveData(PView *view)
void normal3points(double x0, double y0, double z0, double x1, double y1, double z1, double x2, double y2, double z2, double n[3])
virtual int getNumElements(int step=-1, int ent=-1)
virtual bool finalize(bool computeMinMax=true, const std::string &interpolationScheme="")