gmsh-TingyuanDoc
0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
|
Go to the documentation of this file.
34 return "Plugin(Scal2Tens) converts some scalar fields into a tensor field. "
35 "The number of components must be given (max. 9). "
36 "The new view 'NameNewView' contains the new tensor field. If the "
38 "of a view is -1, the value of the corresponding component is 0.";
65 if((numComp < 1) || (numComp > 9)) {
67 "Scal2Tens plugin: NumberOfComponents must be between 1 and 9 (not '%i')",
72 for(
int comp = 0; comp < numComp; comp++)
76 PView *vRef =
nullptr, *vComp[9];
77 for(
int comp = 0; comp < numComp; comp++) {
79 vComp[comp] =
nullptr;
81 vComp[comp] =
getView(iView[comp], v);
83 Msg::Error(
"Scal2Tens plugin could not find View '%i'", iView[comp]);
86 if(!vRef) vRef = vComp[comp];
90 Msg::Error(
"Scal2Tens plugin could not find any view.");
101 for(
int ele = 0; ele < dataRef->
getNumElements(step0, ent); ele++) {
102 if(dataRef->
skipElement(step0, ent, ele))
continue;
103 int type = dataRef->
getType(step0, ent, ele);
104 int numNodes = dataRef->
getNumNodes(step0, ent, ele);
106 numComp, type, numNodes);
108 double x[8], y[8],
z[8];
109 for(
int nod = 0; nod < numNodes; nod++)
110 dataRef->
getNode(step0, ent, ele, nod, x[nod], y[nod],
z[nod]);
115 for(
int nod = 0; nod < numNodes; nod++)
116 out->push_back(x[nod]);
117 for(
int nod = 0; nod < numNodes; nod++) out->push_back(y[nod]);
118 for(
int nod = 0; nod < numNodes; nod++) out->push_back(
z[nod]);
121 for(
int nod = 0; nod < numNodes; nod++) {
122 for(
int comp = 0; comp < numComp; comp++) {
125 vComp[comp]->getData()->getValue(step, ent, ele, nod, 0, val);
int getNbOptionsStr() const
virtual bool skipElement(int step, int ent, int ele, bool checkVisibility=false, int samplingRate=1)
std::string getHelp() const
virtual int getNumTimeSteps()=0
StringXString Scal2TensOptions_String[]
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 Scal2TensOptions_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)
PViewData * getData(bool useAdaptiveIfAvailable=false)
StringXString * getOptionStr(int iopt)
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 PView * getView(int index, PView *view)
StringXNumber * getOption(int iopt)
std::vector< double > Time
GMSH_Plugin * GMSH_RegisterScal2TensPlugin()
virtual int getNumElements(int step=-1, int ent=-1)
virtual PViewDataList * getDataList(PView *view, bool showError=true)
virtual int getFirstNonEmptyTimeStep(int start=0)