valib
Vortex Analysis LIBrary
Loading...
Searching...
No Matches
swirling_strength.h
Go to the documentation of this file.
1
5#ifndef VA_SWIRLING_STRENGTH_H
6#define VA_SWIRLING_STRENGTH_H
7
8#include "common_defs.h"
9#include "linalg3.h"
10
11/***************************************************************************/
56VA_DEVICE_FUN void valib_swirling_strength(VA_REAL *A,
57 VA_REAL *lambda_ci,
58 VA_REAL *lambda_cr)
59{
60 VA_REAL Q, R, delta;
61
62 // determine the discriminant of the cubic characteristic equation
63 valib_delta(A, &delta);
64
65 // find the second invariant
67
68 // find the third invariant (determinant)
69 valib_determinant3(A, &R);
70
71 if (delta <= 0) {
72 // only real eigenvalues exist
73 *lambda_ci = 0.;
74 *lambda_cr = 0.;
75 }
76 else {
77 // one real eigenvalue and a pair of complex conjugate eigenvalues
78 VA_REAL aux = sqrt(delta);
79
80 VA_REAL aux2;
81 aux2 = 0.5*R + aux;
82 VA_REAL g1 = valib_sign(1., aux2) * pow(fabs( aux2 ), 1./3.);
83
84 aux2 = 0.5*R - aux;
85 VA_REAL g2 = valib_sign(1., aux2) * pow(fabs( aux2 ), 1./3.);
86
87 *lambda_ci = (g1 - g2) * sqrt(3.) / 2.;
88 *lambda_cr = -(g1 + g2) / 2.;
89 }
90}
91
92#endif // VA_SWIRLING_STRENGTH_H
VA_DEVICE_FUN void valib_delta(VA_REAL *A, VA_REAL *delta)
-criterion
Definition delta.h:49
VA_DEVICE_FUN void valib_swirling_strength(VA_REAL *A, VA_REAL *lambda_ci, VA_REAL *lambda_cr)
Swirling strength criterion (a.k.a. -criterion) .
VA_DEVICE_FUN void valib_second_invariant3(VA_REAL *A, VA_REAL *second_invariant)
Definition linalg3.h:379
VA_DEVICE_FUN VA_REAL valib_sign(VA_REAL a, VA_REAL b)
Definition linalg3.h:20
VA_DEVICE_FUN void valib_determinant3(VA_REAL *A, VA_REAL *det)
Definition linalg3.h:390