programmer's documentation
Functions
cs_math.c File Reference
#include "cs_defs.h"
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
#include <mpi.h>
#include "bft_error.h"
#include "cs_math.h"
Include dependency graph for cs_math.c:

Functions

void symmetric_matrix_inverse (const cs_real_6_t s, cs_real_6_t sout)
 
void symmetric_matrix_product (const cs_real_6_t s1, const cs_real_6_t s2, cs_real_6_t sout)
 
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_33_eigen (const cs_real_t m[3][3], cs_real_t *eig_ratio, cs_real_t *eig_max)
 Compute the eigenvalues of a 3x3 matrix which is symmetric and real -> Oliver K. Smith "eigenvalues of a symmetric 3x3 matrix", Communication of the ACM (April 1961) -> Wikipedia article entitled "Eigenvalue algorithm". 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...
 
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...
 

Detailed Description

Mathematical base functions.

Function Documentation

§ cs_math_33_eigen()

void cs_math_33_eigen ( const cs_real_t  m[3][3],
cs_real_t eig_ratio,
cs_real_t eig_max 
)

Compute the eigenvalues of a 3x3 matrix which is symmetric and real -> Oliver K. Smith "eigenvalues of a symmetric 3x3 matrix", Communication of the ACM (April 1961) -> Wikipedia article entitled "Eigenvalue algorithm".

Parameters
[in]m3x3 matrix
[out]eig_ratiomax/min
[out]eig_maxmax. eigenvalue

§ cs_math_3_length_unitv()

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 
)
inline

Compute the length (euclidien norm) between two points xa and xb in a cartesian coordinate system of dimension 3.

Parameters
[in]xacoordinate of the first extremity
[in]xbcoordinate of the second extremity
[out]lenpointer to the length of the vector va -> vb
[out]unitvunitary vector anlong va -> vb

§ cs_math_get_machine_epsilon()

double cs_math_get_machine_epsilon ( void  )

Get the value related to the machine precision.

§ cs_math_set_machine_epsilon()

void cs_math_set_machine_epsilon ( void  )

Compute the value related to the machine precision.

§ cs_math_surftri()

double cs_math_surftri ( const cs_real_t  xv[3],
const cs_real_t  xe[3],
const cs_real_t  xf[3] 
)
inline

Compute the area of the convex_hull generated by 3 points. This corresponds to the computation of the surface of a triangle.

Parameters
[in]xvcoordinates of the first vertex
[in]xecoordinates of the second vertex
[in]xfcoordinates of the third vertex
Returns
the surface of a triangle

§ cs_math_voltet()

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.

Parameters
[in]xvcoordinates of the first vertex
[in]xecoordinates of the second vertex
[in]xfcoordinates of the third vertex
[in]xccoordinates of the fourth vertex
Returns
the volume of the tetrahedron.

§ symmetric_matrix_inverse()

void symmetric_matrix_inverse ( const cs_real_6_t  s,
cs_real_6_t  sout 
)

§ symmetric_matrix_product()

void symmetric_matrix_product ( const cs_real_6_t  s1,
const cs_real_6_t  s2,
cs_real_6_t  sout 
)