gmsh-TingyuanDoc
0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
|
Go to the documentation of this file.
24 return "Plugin(Eigenvectors) computes the three (right) "
25 "eigenvectors of each tensor in the view `View' "
26 "and sorts them according to the value of the "
27 "associated eigenvalues.\n\n"
28 "If `ScaleByEigenvalues' is set, each eigenvector is "
29 "scaled by its associated eigenvalue. The plugin "
30 "gives an error if the eigenvectors are complex.\n\n"
31 "If `View' < 0, the plugin is run on the current view.\n\n"
32 "Plugin(Eigenvectors) creates three new list-based vector view.";
55 Msg::Error(
"Eigenvectors plugin cannot be run on multi-mesh views");
74 if(numComp != 9)
continue;
75 int type = data1->
getType(0, ent, ele);
77 std::vector<double> *outmin = dmin->
incrementList(3, type, numNodes);
78 std::vector<double> *outmid = dmid->
incrementList(3, type, numNodes);
79 std::vector<double> *outmax = dmax->
incrementList(3, type, numNodes);
80 if(!outmin || !outmid || !outmax)
continue;
82 for(
int nod = 0; nod < numNodes; nod++)
83 data1->
getNode(0, ent, ele, nod, xyz[0][nod], xyz[1][nod], xyz[2][nod]);
84 for(
int i = 0; i < 3; i++) {
85 for(
int nod = 0; nod < numNodes; nod++) {
86 outmin->push_back(xyz[i][nod]);
87 outmid->push_back(xyz[i][nod]);
88 outmax->push_back(xyz[i][nod]);
92 for(
int nod = 0; nod < numNodes; nod++) {
93 for(
int i = 0; i < 3; i++)
94 for(
int j = 0; j < 3; j++)
95 data1->
getValue(step, ent, ele, nod, 3 * i + j, mat(i, j));
96 if(mat.eig(dr, di, vl, vr,
true)) {
97 if(!
scale) dr(0) = dr(1) = dr(2) = 1.;
98 for(
int i = 0; i < 3; i++) {
100 res = dr(0) * vr(i, 0);
101 outmin->push_back(res);
102 res = dr(1) * vr(i, 1);
103 outmid->push_back(res);
104 res = dr(2) * vr(i, 2);
105 outmax->push_back(res);
107 if(di(0) || di(1) || di(2)) nbcomplex++;
110 Msg::Error(
"Could not compute eigenvalues/vectors");
117 if(nbcomplex)
Msg::Error(
"%d tensors have complex eigenvalues", nbcomplex);
120 double time = data1->
getTime(i);
121 dmin->
Time.push_back(time);
122 dmid->
Time.push_back(time);
123 dmax->
Time.push_back(time);
StringXNumber EigenvectorsOptions_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)
virtual void getValue(int step, int ent, int ele, int idx, double &val)
StringXNumber * getOption(int iopt)
virtual bool hasMultipleMeshes()
virtual int getNumEntities(int step=-1)
virtual void setFileName(const std::string &val)
virtual double getTime(int step)
virtual int getType(int step, int ent, int ele)
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)
std::string getHelp() const
virtual PViewData * getPossiblyAdaptiveData(PView *view)
std::vector< double > Time
virtual int getNumElements(int step=-1, int ent=-1)
virtual std::string getName()
GMSH_Plugin * GMSH_RegisterEigenvectorsPlugin()
virtual PViewDataList * getDataList(PView *view, bool showError=true)
static void scale(std::vector< double > &x, double s)