gmsh-TingyuanDoc
0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
|
Go to the documentation of this file.
22 return "Plugin(Divergence) computes the divergence of the "
23 "field in the view `View'.\n\n"
24 "If `View' < 0, the plugin is run on the current view.\n\n"
25 "Plugin(Divergence) creates one new list-based view.";
47 Msg::Error(
"Divergence plugin cannot be run on multi-mesh views");
55 for(
int ent = 0; ent < data1->
getNumEntities(firstNonEmptyStep); ent++) {
56 for(
int ele = 0; ele < data1->
getNumElements(firstNonEmptyStep, ent);
58 if(data1->
skipElement(firstNonEmptyStep, ent, ele))
continue;
60 if(numComp != 3)
continue;
61 int type = data1->
getType(firstNonEmptyStep, ent, ele);
62 int numNodes = data1->
getNumNodes(firstNonEmptyStep, ent, ele);
63 std::vector<double> *out = data2->
incrementList(1, type, numNodes);
65 double x[8], y[8],
z[8], val[8 * 3];
66 for(
int nod = 0; nod < numNodes; nod++)
67 data1->
getNode(firstNonEmptyStep, ent, ele, nod, x[nod], y[nod],
69 int dim = data1->
getDimension(firstNonEmptyStep, ent, ele);
73 for(
int nod = 0; nod < numNodes; nod++) out->push_back(x[nod]);
74 for(
int nod = 0; nod < numNodes; nod++) out->push_back(y[nod]);
75 for(
int nod = 0; nod < numNodes; nod++) out->push_back(
z[nod]);
78 for(
int nod = 0; nod < numNodes; nod++)
79 for(
int comp = 0; comp < numComp; comp++)
80 data1->
getValue(step, ent, ele, nod, comp,
81 val[numComp * nod + comp]);
82 for(
int nod = 0; nod < numNodes; nod++) {
95 double time = data1->
getTime(i);
96 data2->
Time.push_back(time);
StringXNumber DivergenceOptions_Number[]
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)
void f(int n, double u, double *val)
virtual void getValue(int step, int ent, int ele, int idx, double &val)
std::string getHelp() const
virtual bool hasMultipleMeshes()
virtual int getNumEntities(int step=-1)
GMSH_Plugin * GMSH_RegisterDivergencePlugin()
virtual void setFileName(const std::string &val)
double interpolateDiv(double val[], double u, double v, double w, int stride=3)
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)
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)
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()
StringXNumber * getOption(int iopt)
virtual PViewDataList * getDataList(PView *view, bool showError=true)
virtual int getFirstNonEmptyTimeStep(int start=0)