valib
Vortex Analysis LIBrary
lambda2.h
1
5
#ifndef VA_LAMBDA2_H
6
#define VA_LAMBDA2_H
7
8
#include "common_defs.h"
9
#include "linalg3.h"
10
11
/***************************************************************************/
59
VA_DEVICE_FUN
void
valib_lambda2
(VA_REAL *A, VA_REAL *lambda_2)
60
{
61
VA_REAL SO[9];
// velocity gradient
62
VA_REAL O[9];
// Omega
63
VA_REAL SSOO[9];
// S*S + Omega*Omega
64
VA_REAL eigSSOO[3];
// eigenvalues of SSOO
65
66
// make a local copy of the velocity gradient
67
valib_mat_copy3
(A, SO);
68
69
// find symmetric and antisymmetric parts
70
valib_sym_antisym3
(SO);
71
72
// create full antisymmetric part and mirror
73
// the lower part with the oposite sign
74
O[1] = SO[1];
// (2,1)
75
O[2] = SO[2];
// (3,1)
76
O[5] = SO[5];
// (3,2)
77
78
// antisymmetrize
79
O[0] = 0.;
// (1,1)
80
O[3] = -O[1];
// (1,2)
81
O[4] = 0.;
// (2,2)
82
O[6] = -O[2];
// (1,3)
83
O[7] = -O[5];
// (2,3)
84
O[8] = 0.;
// (3,3)
85
86
// create the full symmetric part
87
SO[1] = SO[3];
// (2,1)
88
SO[2] = SO[6];
// (3,1)
89
SO[5] = SO[7];
// (3,2)
90
91
// zero resulting values together
92
valib_mat_zero3
(SSOO);
93
// SSOO = S*S
94
valib_matmat3_prod
(0, 0, SO, SO, SSOO);
95
// SSOO = SSOO + O*O
96
valib_matmat3_prod
(0, 0, O, O, SSOO);
97
98
// find sorted eigenvalues
99
valib_eigenvalues_sym3
(SSOO, eigSSOO);
100
101
// extract the second eigenvalue
102
*lambda_2 = eigSSOO[1];
103
//printf("eigenvalues: %lf, %lf, %lf \n", eigSSOO[0], eigSSOO[1], eigSSOO[2]);
104
}
105
106
#endif // VA_LAMBDA2_H
valib_mat_copy3
VA_DEVICE_FUN void valib_mat_copy3(VA_REAL *A, VA_REAL *B)
Definition:
linalg3.h:243
valib_eigenvalues_sym3
VA_DEVICE_FUN void valib_eigenvalues_sym3(VA_REAL *A, VA_REAL *eigval)
Definition:
linalg3.h:486
valib_sym_antisym3
VA_DEVICE_FUN void valib_sym_antisym3(VA_REAL *A)
Definition:
linalg3.h:320
valib_matmat3_prod
VA_DEVICE_FUN void valib_matmat3_prod(int trans_a, int trans_b, VA_REAL *A, VA_REAL *B, VA_REAL *C)
Definition:
linalg3.h:429
valib_mat_zero3
VA_DEVICE_FUN void valib_mat_zero3(VA_REAL *A)
Definition:
linalg3.h:229
valib_lambda2
VA_DEVICE_FUN void valib_lambda2(VA_REAL *A, VA_REAL *lambda_2)
-criterion
Definition:
lambda2.h:59
include
lambda2.h
Generated by
1.8.17