gmsh-TingyuanDoc
0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
|
Go to the documentation of this file.
23 return "Plugin(Scal2Vec) converts the scalar fields into a vectorial field. "
24 "The new view 'NameNewView' contains it. "
25 "If the number of a view is -1, the value of the corresponding "
26 "component of the vector field is 0.";
53 for(
int comp = 0; comp < 3; comp++)
57 PView *vRef =
nullptr, *vComp[3];
58 for(
int comp = 0; comp < 3; comp++) {
60 vComp[comp] =
nullptr;
62 vComp[comp] =
getView(iView[comp], v);
64 Msg::Error(
"Scal2Vec plugin could not find View '%i'", iView[comp]);
67 if(!vRef) vRef = vComp[comp];
71 Msg::Error(
"Scal2Vec plugin could not find any view.");
82 for(
int ele = 0; ele < dataRef->
getNumElements(step0, ent); ele++) {
84 int type = dataRef->
getType(step0, ent, ele);
85 int numNodes = dataRef->
getNumNodes(step0, ent, ele);
89 double x[8], y[8],
z[8];
90 for(
int nod = 0; nod < numNodes; nod++)
91 dataRef->
getNode(step0, ent, ele, nod, x[nod], y[nod],
z[nod]);
96 for(
int nod = 0; nod < numNodes; nod++)
97 out->push_back(x[nod]);
98 for(
int nod = 0; nod < numNodes; nod++) out->push_back(y[nod]);
99 for(
int nod = 0; nod < numNodes; nod++) out->push_back(
z[nod]);
102 for(
int nod = 0; nod < numNodes; nod++) {
103 for(
int comp = 0; comp < 3; comp++) {
106 vComp[comp]->getData()->getValue(step, ent, ele, nod, 0, val);
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 int getNumEntities(int step=-1)
virtual void setFileName(const std::string &val)
StringXNumber * getOption(int iopt)
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)
PViewData * getData(bool useAdaptiveIfAvailable=false)
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)
StringXNumber Scal2VecOptions_Number[]
GMSH_Plugin * GMSH_RegisterScal2VecPlugin()
StringXString Scal2VecOptions_String[]
virtual PView * getView(int index, PView *view)
std::vector< double > Time
StringXString * getOptionStr(int iopt)
virtual int getNumElements(int step=-1, int ent=-1)
std::string getHelp() const
int getNbOptionsStr() const
virtual PViewDataList * getDataList(PView *view, bool showError=true)
virtual int getFirstNonEmptyTimeStep(int start=0)