8 #include "common_defs.h"
59 vorticity[0] = A[2+1*3] - A[1+2*3];
60 vorticity[1] = A[0+2*3] - A[2+0*3];
61 vorticity[2] = A[1+0*3] - A[0+1*3];
65 printf(
"the vorticity vector is: [ %lf, %lf, %lf ]\n",
66 vorticity[0], vorticity[1], vorticity[2]);
87 VA_REAL complex x1, x2, x3;
90 VA_REAL lambda_r, lambda_ci;
100 else if (info == 0) {
102 lambda_r = creal(x1);
103 lambda_ci = cimag(x2);
107 printf(
"The solve of the cubic equation has failed with info: %d \n", info);
119 for (
int i = 0; i < 9; i++)
121 for (
int i = 0; i < 3; i++)
122 B[i+i*3] -= lambda_r;
126 printf(
"Something is wrong, find_nullspace returned with info %d.\n", info);
135 printf(
"the real eigenvector is: [ %lf, %lf, %lf ]\n",
136 rortex[0], rortex[1], rortex[2]);
142 for (
int i = 0; i < 3; i++)
143 rortex[i] = -rortex[i];
148 printf(
"Something is wrong, the scalar product of vorticity and rortex should be positive, %lf.\n", vr);
156 VA_REAL R = vr - sqrt(vr*vr - 4.*lambda_ci*lambda_ci);
158 for (
int i = 0; i < 3; i++)
162 #endif // VA_RORTEX_H