98 for (
int ii = 0; ii < 3; ii++)
99 mv[ii] = m[ii][0] * v[0] + m[ii][1] * v[1] + m[ii][2] * v[2];
120 mv[0] = m[0] * v[0] + m[3] * v[1] + m[5] * v[2];
121 mv[1] = m[3] * v[0] + m[1] * v[1] + m[4] * v[2];
122 mv[2] = m[5] * v[0] + m[4] * v[1] + m[2] * v[2];
140 cs_real_t uv = u[0]*v[0] + u[1]*v[1] + u[2]*v[2];
158 cs_real_t v2 = v[0]*v[0] + v[1]*v[1] + v[2]*v[2];
179 sout[0] = s[1]*s[2] - s[4]*s[4];
180 sout[1] = s[0]*s[2] - s[5]*s[5];
181 sout[2] = s[0]*s[1] - s[3]*s[3];
182 sout[3] = s[4]*s[5] - s[3]*s[2];
183 sout[4] = s[3]*s[5] - s[0]*s[4];
184 sout[5] = s[3]*s[4] - s[1]*s[5];
186 detinv = 1. / (s[0]*sout[0] + s[3]*sout[3] + s[5]*sout[5]);
188 sout[0] = sout[0] * detinv;
189 sout[1] = sout[1] * detinv;
190 sout[2] = sout[2] * detinv;
191 sout[3] = sout[3] * detinv;
192 sout[4] = sout[4] * detinv;
193 sout[5] = sout[5] * detinv;
213 sout[0] = s1[0]*s2[0] + s1[3]*s2[3] + s1[5]*s2[5];
215 sout[1] = s1[3]*s2[3] + s1[1]*s2[1] + s1[4]*s2[4];
217 sout[2] = s1[5]*s2[5] + s1[4]*s2[4] + s1[2]*s2[2];
219 sout[3] = s1[0]*s2[3] + s1[3]*s2[1] + s1[5]*s2[4];
221 sout[4] = s1[3]*s2[5] + s1[1]*s2[4] + s1[4]*s2[2];
223 sout[5] = s1[0]*s2[5] + s1[3]*s2[4] + s1[5]*s2[2];
void symmetric_matrix_inverse(const cs_real_6_t s, cs_real_6_t sout)
Definition: cs_math.c:92
cs_real_t cs_real_6_t[6]
vector of 6 floating-point values
Definition: cs_defs.h:309
void symmetric_matrix_product(const cs_real_6_t s1, const cs_real_6_t s2, cs_real_6_t sout)
Definition: cs_math.c:106
#define BEGIN_C_DECLS
Definition: cs_defs.h:419
double precision, dimension(:,:,:), allocatable v
Definition: atimbr.f90:108
Definition: cs_field_pointer.h:67
static cs_real_t cs_math_3_square_norm(const cs_real_3_t v)
Compute the square norm of a vector of 3 real values.
Definition: cs_math.h:156
static cs_real_t cs_math_3_dot_product(const cs_real_3_t u, const cs_real_3_t v)
Compute the dot product of two vectors of 3 real values.
Definition: cs_math.h:137
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:307
static void cs_math_sym_33_inv_cramer(const cs_real_6_t s, cs_real_6_t sout)
Compute the inverse of a symmetric matrix using Cramer's rule. NB: Symmetric matrix are stored as fol...
Definition: cs_math.h:174
static void cs_math_33_3_product(const cs_real_33_t m, const cs_real_3_t v, cs_real_3_t mv)
Compute the product of a matrix of 3x3 real values by a vector of 3 real values.
Definition: cs_math.h:94
#define END_C_DECLS
Definition: cs_defs.h:420
double cs_real_t
Definition: cs_defs.h:296
static void cs_math_sym_33_product(const cs_real_6_t s1, const cs_real_6_t s2, cs_real_6_t sout)
Compute the product of two symmetric matrices. NB: Symmetric matrix are stored as follows (s11...
Definition: cs_math.h:208
#define CS_PROCF(x, y)
Definition: cs_defs.h:443
cs_real_t cs_real_33_t[3][3]
3x3 matrix of floating-point values
Definition: cs_defs.h:311
static void cs_math_sym_33_3_product(const cs_real_6_t m, const cs_real_3_t v, cs_real_3_t mv)
Compute the product of a symmetric matrix of 3x3 real values by a vector of 3 real values...
Definition: cs_math.h:116