gmsh-TingyuanDoc
0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
|
Go to the documentation of this file.
18 return "Plugin(Gradient) computes the gradient of the "
19 "field in the view `View'.\n\n"
20 "If `View' < 0, the plugin is run on the current view.\n\n"
21 "Plugin(Gradient) creates one new list-based view.";
43 Msg::Error(
"Gradient plugin cannot be run on multi-mesh views");
51 for(
int ent = 0; ent < data1->
getNumEntities(firstNonEmptyStep); ent++) {
52 for(
int ele = 0; ele < data1->
getNumElements(firstNonEmptyStep, ent);
54 if(data1->
skipElement(firstNonEmptyStep, ent, ele))
continue;
56 if(numComp != 1 && numComp != 3)
continue;
57 int type = data1->
getType(firstNonEmptyStep, ent, ele);
58 int numNodes = data1->
getNumNodes(firstNonEmptyStep, ent, ele);
59 std::vector<double> *out =
62 double x[8], y[8],
z[8], val[8 * 3];
63 for(
int nod = 0; nod < numNodes; nod++)
64 data1->
getNode(firstNonEmptyStep, ent, ele, nod, x[nod], y[nod],
66 int dim = data1->
getDimension(firstNonEmptyStep, ent, ele);
70 for(
int nod = 0; nod < numNodes; nod++) out->push_back(x[nod]);
71 for(
int nod = 0; nod < numNodes; nod++) out->push_back(y[nod]);
72 for(
int nod = 0; nod < numNodes; nod++) out->push_back(
z[nod]);
75 for(
int nod = 0; nod < numNodes; nod++)
76 for(
int comp = 0; comp < numComp; comp++)
77 data1->
getValue(step, ent, ele, nod, comp,
78 val[numComp * nod + comp]);
79 for(
int nod = 0; nod < numNodes; nod++) {
82 for(
int comp = 0; comp < numComp; comp++) {
96 double time = data1->
getTime(i);
97 data2->
Time.push_back(time);
virtual bool skipElement(int step, int ent, int ele, bool checkVisibility=false, int samplingRate=1)
virtual int getNumTimeSteps()=0
virtual int getNode(int step, int ent, int ele, int nod, double &x, double &y, double &z)
static void Error(const char *fmt,...)
std::vector< double > * incrementList(int numComp, int type, int numNodes=0)
std::string getHelp() const
void f(int n, double u, double *val)
virtual void getValue(int step, int ent, int ele, int idx, double &val)
virtual bool hasMultipleMeshes()
virtual int getNumEntities(int step=-1)
virtual void setFileName(const std::string &val)
StringXNumber GradientOptions_Number[]
virtual int getDimension(int step, int ent, int ele)
virtual double getTime(int step)
virtual int getType(int step, int ent, int ele)
virtual bool hasTimeStep(int step)
virtual int getNumNodes(int step, int ent, int ele)
GMSH_Plugin * GMSH_RegisterGradientPlugin()
bool finalize(bool computeMinMax=true, const std::string &interpolationScheme="")
virtual void setName(const std::string &val)
element * create(int numNodes, int dimension, double *x, double *y, double *z, bool copy=false)
void interpolateGrad(double val[], double u, double v, double w, double f[3], int stride=1, double invjac[3][3]=nullptr)
StringXNumber * getOption(int iopt)
virtual int getNumComponents(int step, int ent, int ele)
virtual PView * getView(int index, PView *view)
virtual PViewData * getPossiblyAdaptiveData(PView *view)
std::vector< double > Time
virtual void getNode(int num, double &u, double &v, double &w)=0
virtual int getNumElements(int step=-1, int ent=-1)
virtual std::string getName()
virtual PViewDataList * getDataList(PView *view, bool showError=true)
virtual int getFirstNonEmptyTimeStep(int start=0)