My Project
programmer's documentation
|
Go to the source code of this file.
Enumerations | |
enum | cs_math_sym_tensor_component_t { XX, YY, ZZ, XY, YZ, XZ } |
Functions | |
static int | cs_math_binom (int n, int k) |
Computes the binomial coefficient of n and k. More... | |
static cs_real_t | cs_math_fabs (cs_real_t x) |
Compute the absolute value of a real value. More... | |
static cs_real_t | cs_math_fmin (cs_real_t x, cs_real_t y) |
Compute the min value of two real values. More... | |
static cs_real_t | cs_math_fmax (cs_real_t x, cs_real_t y) |
Compute the max value of two real values. More... | |
static cs_real_t | cs_math_sq (cs_real_t x) |
Compute the square of a real value. More... | |
static cs_real_t | cs_math_pow2 (cs_real_t x) |
Compute the square of a real value. More... | |
static cs_real_t | cs_math_pow3 (cs_real_t x) |
Compute the cube of a real value. More... | |
static cs_real_t | cs_math_pow4 (cs_real_t x) |
Compute the 4-th power of a real value. More... | |
static cs_real_t | cs_math_3_distance (const cs_real_t xa[3], const cs_real_t xb[3]) |
Compute the (euclidean) distance between two points xa and xb in a cartesian coordinate system of dimension 3. More... | |
static cs_real_t | cs_math_3_distance_dot_product (const cs_real_t xa[3], const cs_real_t xb[3], const cs_real_t xc[3]) |
Compute . More... | |
static cs_real_t | cs_math_3_square_distance (const cs_real_t xa[3], const cs_real_t xb[3]) |
Compute the squared distance between two points xa and xb in a cartesian coordinate system of dimension 3. More... | |
static cs_real_t | cs_math_3_dot_product (const cs_real_t u[3], const cs_real_t v[3]) |
Compute the dot product of two vectors of 3 real values. More... | |
static cs_real_t | cs_math_3_33_3_dot_product (const cs_real_t n1[3], const cs_real_t t[3][3], const cs_real_t n2[3]) |
Compute the dot product of a tensor t with two vectors n1, and n2 n1 t n2. More... | |
static cs_real_t | cs_math_3_norm (const cs_real_t v[3]) |
Compute the euclidean norm of a vector of dimension 3. More... | |
static cs_real_t | cs_math_3_square_norm (const cs_real_t v[3]) |
Compute the square norm of a vector of 3 real values. More... | |
static void | cs_math_3_normalise (const cs_real_t vin[3], cs_real_t vout[restrict 3]) |
Normalise a vector of 3 real values. More... | |
static void | cs_math_3_orthogonal_projection (const cs_real_t n[3], const cs_real_t v[3], cs_real_t vout[restrict 3]) |
Orthogonal projection of a vector with respect to a normalised vector. More... | |
static void | cs_math_3_normal_scaling (const cs_real_t n[3], cs_real_t factor, cs_real_3_t v) |
Add the dot product with a normal vector to the normal direction to a vector. More... | |
static void | cs_math_33_normal_scaling_add (const cs_real_t n[3], cs_real_t factor, cs_real_33_t t) |
Add the dot product with a normal vector to the normal,normal component of a tensor: t += factor * n.t.n n(x)n. More... | |
static void | cs_math_33_3_product (const cs_real_t m[3][3], const cs_real_t v[3], cs_real_3_t mv) |
Compute the product of a matrix of 3x3 real values by a vector of 3 real values. More... | |
static void | cs_math_33_3_product_add (const cs_real_t m[3][3], const cs_real_t v[3], cs_real_3_t mv) |
Compute the product of a matrix of 3x3 real values by a vector of 3 real values add. More... | |
static void | cs_math_33t_3_product (const cs_real_t m[3][3], const cs_real_t v[3], cs_real_3_t mv) |
Compute the product of the transpose of a matrix of 3x3 real values by a vector of 3 real values. More... | |
static void | cs_math_sym_33_3_product (const cs_real_t m[6], const cs_real_t v[3], cs_real_t mv[restrict 3]) |
Compute the product of a symmetric matrix of 3x3 real values by a vector of 3 real values. NB: Symmetric matrix are stored as follows (s11, s22, s33, s12, s23, s13) More... | |
static void | cs_math_sym_33_3_product_add (const cs_real_t m[6], const cs_real_t v[3], cs_real_t mv[restrict 3]) |
Compute the product of a symmetric matrix of 3x3 real values by a vector of 3 real values and add it to the vector. NB: Symmetric matrix are stored as follows (s11, s22, s33, s12, s23, s13) More... | |
static void | cs_math_66_6_product (const cs_real_t m[6][6], const cs_real_t v[6], cs_real_t mv[restrict 6]) |
Compute the product of a matrix of 6x6 real values by a vector of 6 real values. More... | |
static void | cs_math_66_6_product_add (const cs_real_t m[6][6], const cs_real_t v[6], cs_real_t mv[restrict 6]) |
Compute the product of a matrix of 6x6 real values by a vector of 6 real values and add it to the vector. More... | |
static cs_real_t | cs_math_33_determinant (const cs_real_t m[3][3]) |
Compute the determinant of a 3x3 matrix. More... | |
static cs_real_t | cs_math_sym_33_determinant (const cs_real_6_t m) |
Compute the determinant of a 3x3 symmetric matrix. More... | |
static void | cs_math_3_cross_product (const cs_real_t u[3], const cs_real_t v[3], cs_real_t uv[restrict 3]) |
Compute the cross product of two vectors of 3 real values. More... | |
static cs_real_t | cs_math_3_triple_product (const cs_real_t u[3], const cs_real_t v[3], const cs_real_t w[3]) |
Compute the triple product. More... | |
static void | cs_math_33_inv_cramer (const cs_real_t in[3][3], cs_real_t out[3][3]) |
Inverse a 3x3 matrix. More... | |
static void | cs_math_33_inv_cramer_in_place (cs_real_t a[3][3]) |
Inverse a 3x3 matrix in place, using Cramer's rule. More... | |
static void | cs_math_33_inv_cramer_sym_in_place (cs_real_t a[3][3]) |
Inverse a 3x3 symmetric matrix (with non-symmetric storage) in place, using Cramer's rule. More... | |
static void | cs_math_sym_33_inv_cramer (const cs_real_t s[6], cs_real_t sout[restrict 6]) |
Compute the inverse of a symmetric matrix using Cramer's rule. More... | |
static void | cs_math_33_product (const cs_real_t m1[3][3], const cs_real_t m2[3][3], cs_real_33_t mout) |
Compute the product of a matrix of 3x3 real values by a matrix of 3x3 real values. More... | |
static void | cs_math_33_product_add (const cs_real_t m1[3][3], const cs_real_t m2[3][3], cs_real_33_t mout) |
Compute the product of a matrix of 3x3 real values by a matrix of 3x3 real values and add. More... | |
static void | cs_math_sym_33_product (const cs_real_t s1[6], const cs_real_t s2[6], cs_real_t sout[restrict 6]) |
Compute the product of two symmetric matrices. Warning: this is valid if and only if s1 and s2 commute (otherwise sout is not symmetric). More... | |
static void | cs_math_reduce_sym_prod_33_to_66 (const cs_real_t s[3][3], cs_real_t sout[restrict 6][6]) |
Compute a 6x6 matrix A, equivalent to a 3x3 matrix s, such as: A*R_6 = R*s^t + s*R. More... | |
static void | cs_math_sym_33_double_product (const cs_real_t s1[6], const cs_real_t s2[6], const cs_real_t s3[6], cs_real_t sout[restrict 3][3]) |
Compute the product of three symmetric matrices. More... | |
static void | cs_nvec3 (const cs_real_3_t v, cs_nvec3_t *qv) |
Define a cs_nvec3_t structure from a cs_real_3_t. More... | |
void | cs_math_set_machine_epsilon (void) |
Compute the value related to the machine precision. More... | |
double | cs_math_get_machine_epsilon (void) |
Get the value related to the machine precision. More... | |
void | cs_math_3_length_unitv (const cs_real_t xa[3], const cs_real_t xb[3], cs_real_t *len, cs_real_3_t unitv) |
Compute the length (euclidien norm) between two points xa and xb in a cartesian coordinate system of dimension 3. More... | |
void | cs_math_sym_33_eigen (const cs_real_t m[6], cs_real_t eig_vals[3]) |
Compute all eigenvalues of a 3x3 symmetric matrix with symmetric storage. More... | |
void | cs_math_33_eigen (const cs_real_t m[3][3], cs_real_t *eig_ratio, cs_real_t *eig_max) |
Compute max/min eigenvalues ratio and max. eigenvalue of a 3x3 symmetric matrix with non-symmetric storage. More... | |
double | cs_math_surftri (const cs_real_t xv[3], const cs_real_t xe[3], const cs_real_t xf[3]) |
Compute the area of the convex_hull generated by 3 points. This corresponds to the computation of the surface of a triangle. More... | |
double | cs_math_voltet (const cs_real_t xv[3], const cs_real_t xe[3], const cs_real_t xf[3], const cs_real_t xc[3]) |
Compute the volume of the convex_hull generated by 4 points. This is equivalent to the computation of the volume of a tetrahedron. More... | |
void | cs_math_fact_lu (cs_lnum_t n_blocks, const int b_size, const cs_real_t *a, cs_real_t *a_lu) |
Compute LU factorization of an array of dense matrices of identical size. More... | |
void | cs_math_fw_and_bw_lu (const cs_real_t a_lu[], const int n, cs_real_t x[], const cs_real_t b[]) |
Block Jacobi utilities. Compute forward and backward to solve an LU P*P system. More... | |
Variables | |
const cs_real_t | cs_math_zero_threshold |
const cs_real_t | cs_math_1ov3 |
const cs_real_t | cs_math_2ov3 |
const cs_real_t | cs_math_4ov3 |
const cs_real_t | cs_math_5ov3 |
const cs_real_t | cs_math_1ov6 |
const cs_real_t | cs_math_1ov12 |
const cs_real_t | cs_math_1ov24 |
const cs_real_t | cs_math_epzero |
const cs_real_t | cs_math_infinite_r |
const cs_real_t | cs_math_big_r |
const cs_real_t | cs_math_pi |
|
inlinestatic |
Compute the product of a matrix of 3x3 real values by a vector of 3 real values.
[in] | m | matrix of 3x3 real values |
[in] | v | vector of 3 real values |
[out] | mv | vector of 3 real values |
|
inlinestatic |
Compute the product of a matrix of 3x3 real values by a vector of 3 real values add.
[in] | m | matrix of 3x3 real values |
[in] | v | vector of 3 real values |
[in,out] | mv | vector of 3 real values |
Compute the determinant of a 3x3 matrix.
[in] | m | 3x3 matrix |
Compute max/min eigenvalues ratio and max. eigenvalue of a 3x3 symmetric matrix with non-symmetric storage.
Based on: Oliver K. Smith "eigenvalues of a symmetric 3x3 matrix", Communication of the ACM (April 1961) (Wikipedia article entitled "Eigenvalue algorithm")
[in] | m | 3x3 matrix |
[out] | eig_ratio | max/min |
[out] | eig_max | max. eigenvalue |
Inverse a 3x3 matrix.
[in] | in | matrix to inverse |
[out] | out | inversed matrix |
|
inlinestatic |
Inverse a 3x3 matrix in place, using Cramer's rule.
[in,out] | a | matrix to inverse |
|
inlinestatic |
Inverse a 3x3 symmetric matrix (with non-symmetric storage) in place, using Cramer's rule.
[in,out] | a | matrix to inverse |
|
inlinestatic |
Add the dot product with a normal vector to the normal,normal component of a tensor: t += factor * n.t.n n(x)n.
[in] | n | normalised face normal vector |
[in] | factor | factor |
[in,out] | t | vector to be scaled |
|
inlinestatic |
Compute the product of a matrix of 3x3 real values by a matrix of 3x3 real values.
[in] | m1 | matrix of 3x3 real values |
[in] | m2 | matrix of 3x3 real values |
[out] | mout | matrix of 3x3 real values |
|
inlinestatic |
Compute the product of a matrix of 3x3 real values by a matrix of 3x3 real values and add.
[in] | m1 | matrix of 3x3 real values |
[in] | m2 | matrix of 3x3 real values |
[out] | mout | matrix of 3x3 real values |
|
inlinestatic |
Compute the product of the transpose of a matrix of 3x3 real values by a vector of 3 real values.
[in] | m | matrix of 3x3 real values |
[in] | v | vector of 3 real values |
[out] | mv | vector of 3 real values |
|
inlinestatic |
Compute the dot product of a tensor t with two vectors n1, and n2 n1 t n2.
[in] | n1 | vector of 3 real values |
[in] | t | vector of 3 real values |
[in] | n2 | vector of 3 real values |
|
inlinestatic |
Compute the cross product of two vectors of 3 real values.
[in] | u | vector of 3 real values |
[in] | v | vector of 3 real values |
[out] | uv | vector of 3 real values |
Compute the (euclidean) distance between two points xa and xb in a cartesian coordinate system of dimension 3.
[in] | xa | first coordinate |
[in] | xb | second coordinate |
|
inlinestatic |
Compute .
[in] | xa | first coordinate |
[in] | xb | second coordinate |
[in] | xc | third coordinate |
Compute the dot product of two vectors of 3 real values.
[in] | u | vector of 3 real values |
[in] | v | vector of 3 real values |
|
inline |
Compute the length (euclidien norm) between two points xa and xb in a cartesian coordinate system of dimension 3.
[in] | xa | coordinate of the first extremity |
[in] | xb | coordinate of the second extremity |
[out] | len | pointer to the length of the vector va -> vb |
[out] | unitv | unitary vector along xa -> xb |
[in] | xa | coordinate of the first extremity |
[in] | xb | coordinate of the second extremity |
[out] | len | pointer to the length of the vector va -> vb |
[out] | unitv | unitary vector anlong va -> vb |
Compute the euclidean norm of a vector of dimension 3.
[in] | v |
|
inlinestatic |
Add the dot product with a normal vector to the normal direction to a vector.
[in] | n | normalised face normal vector |
[in] | factor | factor |
[in,out] | v | vector to be scaled |
Normalise a vector of 3 real values.
[in] | vin | vector |
[out] | vout | normalized vector |
|
inlinestatic |
Orthogonal projection of a vector with respect to a normalised vector.
[in] | n | normal vector direction |
[in] | v | vector to be projected |
[out] | vout | projection |
|
inlinestatic |
Compute the squared distance between two points xa and xb in a cartesian coordinate system of dimension 3.
[in] | xa | first coordinate |
[in] | xb | second coordinate |
Compute the square norm of a vector of 3 real values.
[in] | v | vector of 3 real values |
|
inlinestatic |
Compute the triple product.
[in] | u | vector of 3 real values |
[in] | v | vector of 3 real values |
[in] | w | vector of 3 real values |
|
inlinestatic |
Compute the product of a matrix of 6x6 real values by a vector of 6 real values.
[in] | m | matrix of 6x6 real values |
[in] | v | vector of 6 real values |
[out] | mv | vector of 6 real values |
|
inlinestatic |
Compute the product of a matrix of 6x6 real values by a vector of 6 real values and add it to the vector.
[in] | m | matrix of 6x6 real values |
[in] | v | vector of 6 real values |
[out] | mv | vector of 6 real values |
|
inlinestatic |
Computes the binomial coefficient of n and k.
[in] | n | first argument |
[in] | k | second argument |
Compute the absolute value of a real value.
[in] | x | value |
Compute LU factorization of an array of dense matrices of identical size.
[in] | n_blocks | number of blocks |
[in] | b_size | block size |
[in] | a | matrix blocks |
[out] | a_lu | LU factorizations of matrix blocks |
Compute the max value of two real values.
[in] | x,y | values |
Compute the min value of two real values.
[in] | x,y | values |
Block Jacobi utilities. Compute forward and backward to solve an LU P*P system.
[in] | a_lu | matrix LU factorization |
[in] | n | matrix size |
[out] | x | solution |
[out] | b | right hand side |
double cs_math_get_machine_epsilon | ( | void | ) |
Get the value related to the machine precision.
Compute the square of a real value.
[in] | x | value |
Compute the cube of a real value.
[in] | x | value |
Compute the 4-th power of a real value.
[in] | x | value |
|
inlinestatic |
Compute a 6x6 matrix A, equivalent to a 3x3 matrix s, such as: A*R_6 = R*s^t + s*R.
[in] | s | 3x3 matrix |
[out] | sout | 6x6 matrix |
void cs_math_set_machine_epsilon | ( | void | ) |
Compute the value related to the machine precision.
Compute the square of a real value.
[in] | x | value |
|
inline |
Compute the area of the convex_hull generated by 3 points. This corresponds to the computation of the surface of a triangle.
[in] | xv | coordinates of the first vertex |
[in] | xe | coordinates of the second vertex |
[in] | xf | coordinates of the third vertex |
|
inlinestatic |
Compute the product of a symmetric matrix of 3x3 real values by a vector of 3 real values. NB: Symmetric matrix are stored as follows (s11, s22, s33, s12, s23, s13)
[in] | m | matrix of 3x3 real values |
[in] | v | vector of 3 real values |
[out] | mv | vector of 3 real values |
|
inlinestatic |
Compute the product of a symmetric matrix of 3x3 real values by a vector of 3 real values and add it to the vector. NB: Symmetric matrix are stored as follows (s11, s22, s33, s12, s23, s13)
[in] | m | matrix of 3x3 real values |
[in] | v | vector of 3 real values |
[out] | mv | vector of 3 real values |
|
inlinestatic |
Compute the determinant of a 3x3 symmetric matrix.
[in] | m | 3x3 symmetric matrix |
|
inlinestatic |
Compute the product of three symmetric matrices.
[in] | s1 | symmetric matrix |
[in] | s2 | symmetric matrix |
[in] | s3 | symmetric matrix |
[out] | sout | sout = s1 * s2 * s3 |
Compute all eigenvalues of a 3x3 symmetric matrix with symmetric storage.
Based on: Oliver K. Smith "eigenvalues of a symmetric 3x3 matrix", Communication of the ACM (April 1961) (Wikipedia article entitled "Eigenvalue algorithm")
[in] | m | 3x3 symmetric matrix (m11, m22, m33, m12, m23, m13) |
[out] | eig_vals | size 3 vector |
|
inlinestatic |
Compute the inverse of a symmetric matrix using Cramer's rule.
[in] | s | symmetric matrix |
[out] | sout | sout = 1/s1 |
|
inlinestatic |
Compute the product of two symmetric matrices. Warning: this is valid if and only if s1 and s2 commute (otherwise sout is not symmetric).
[in] | s1 | symmetric matrix |
[in] | s2 | symmetric matrix |
[out] | sout | sout = s1 * s2 |
double cs_math_voltet | ( | const cs_real_t | xv[3], |
const cs_real_t | xe[3], | ||
const cs_real_t | xf[3], | ||
const cs_real_t | xc[3] | ||
) |
Compute the volume of the convex_hull generated by 4 points. This is equivalent to the computation of the volume of a tetrahedron.
[in] | xv | coordinates of the first vertex |
[in] | xe | coordinates of the second vertex |
[in] | xf | coordinates of the third vertex |
[in] | xc | coordinates of the fourth vertex |
|
inlinestatic |
Define a cs_nvec3_t structure from a cs_real_3_t.
[in] | v | vector of size 3 |
[out] | qv | pointer to a cs_nvec3_t structure |
const cs_real_t cs_math_1ov12 |
const cs_real_t cs_math_1ov24 |
const cs_real_t cs_math_1ov3 |
const cs_real_t cs_math_1ov6 |
const cs_real_t cs_math_2ov3 |
const cs_real_t cs_math_4ov3 |
const cs_real_t cs_math_5ov3 |
const cs_real_t cs_math_big_r |
const cs_real_t cs_math_epzero |
const cs_real_t cs_math_infinite_r |
const cs_real_t cs_math_pi |
const cs_real_t cs_math_zero_threshold |