gmsh-TingyuanDoc
0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
|
Go to the documentation of this file.
26 return "Plugin(ExtractElements) extracts some elements "
27 "from the view `View'. If `MinVal' != `MaxVal', it extracts "
28 "the elements whose `TimeStep'-th values (averaged by element) "
29 "are comprised between `MinVal' and `MaxVal'. If `Visible' != 0, "
30 "it extracts visible elements. "
32 "If `View' < 0, the plugin is run on the current view.\n\n"
33 "Plugin(ExtractElements) creates one new list-based view.";
58 bool checkMinMax = MinVal != MaxVal;
60 int step = (thisStep < 0) ? 0 : thisStep;
62 Msg::Error(
"Invalid time step (%d) in View[%d]: using first step instead",
71 if(visible && data1->
skipEntity(step, ent))
continue;
73 if(data1->
skipElement(step, ent, ele, visible))
continue;
81 for(
int nod = 0; nod < numNodes; nod++) {
86 d /= (double)numNodes;
89 if(d < MinVal || d >= MaxVal)
continue;
92 int type = data1->
getType(step, ent, ele);
94 std::vector<double> *out = data2->
incrementList(numComp, type, numNodes);
95 std::vector<double> x(numNodes), y(numNodes),
z(numNodes);
96 std::vector<double> v(numNodes * numComp);
97 for(
int nod = 0; nod < numNodes; nod++)
98 data1->
getNode(step, ent, ele, nod, x[nod], y[nod],
z[nod]);
99 for(
int nod = 0; nod < numNodes; nod++) out->push_back(x[nod]);
100 for(
int nod = 0; nod < numNodes; nod++) out->push_back(y[nod]);
101 for(
int nod = 0; nod < numNodes; nod++) out->push_back(
z[nod]);
105 if((thisStep >= 0) && (thisStep != step))
continue;
107 for(
int nod = 0; nod < numNodes; nod++) {
108 for(
int comp = 0; comp < numComp; comp++) {
110 data1->
getValue(step, ent, ele, nod, comp, temp);
111 out->push_back(temp);
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)
virtual void getValue(int step, int ent, int ele, int idx, double &val)
virtual int getNumEntities(int step=-1)
virtual void setFileName(const std::string &val)
virtual int getDimension(int step, int ent, int ele)
virtual double getTime(int step)
virtual int getType(int step, int ent, int ele)
void getScalarValue(int step, int ent, int ele, int nod, double &val, int tensorRep=0, int forceNumComponents=0, int componentMap[9]=nullptr)
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)
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 int getNumElements(int step=-1, int ent=-1)
virtual std::string getName()
virtual PViewDataList * getDataList(PView *view, bool showError=true)
virtual bool skipEntity(int step, int ent)