My Project
programmer's documentation
Data Structures | Functions | Variables
cs_rotation.h File Reference
#include "cs_defs.h"
Include dependency graph for cs_rotation.h:

Go to the source code of this file.

Data Structures

struct  cs_rotation_t
 Subdomain rotation description. More...
 

Functions

void cs_rotation_define (double omega_x, double omega_y, double omega_z, double invariant_x, double invariant_y, double invariant_z)
 Define a global rotation. More...
 
void cs_rotation_matrix (double theta, const double axis[3], const double invariant_point[3], double matrix[3][4])
 Compute rotation matrix. More...
 
void cs_rotation_update_coords (cs_lnum_t n_coords, double t_rot, cs_real_3_t coords[])
 Update coordinates based on a global rotation and time. More...
 
static void cs_rotation_velocity (const cs_rotation_t *r, const cs_real_t coords[3], cs_real_t vr[3])
 Compute velocity relative to a fixed frame at a given point. More...
 
static void cs_rotation_add_coriolis_v (const cs_rotation_t *r, cs_real_t c, const cs_real_t v[3], cs_real_t vr[3])
 Add a Coriolis term to a vector. More...
 
static void cs_rotation_coriolis_v (const cs_rotation_t *r, cs_real_t c, const cs_real_t v[3], cs_real_t vr[3])
 Compute a vector Coriolis term. More...
 
static void cs_rotation_add_coriolis_t (const cs_rotation_t *r, cs_real_t c, cs_real_t tr[3][3])
 Add the dual tensor of a rotation vector to a tensor. More...
 
static void cs_rotation_coriolis_t (const cs_rotation_t *r, cs_real_t c, cs_real_t tr[3][3])
 Compute the dual tensor of a rotation vector. More...
 
void cs_rotation_cyl_v (const cs_rotation_t *r, const cs_real_t coords[3], const cs_real_t v[3], cs_real_t vc[3])
 Express a vector in the cyclindrical system associated to a rotation. More...
 
void cs_rotation_to_array (int r_num, cs_real_t fra[8])
 Copy rotation structure values to an array. More...
 

Variables

cs_rotation_tcs_glob_rotation
 

Function Documentation

◆ cs_rotation_add_coriolis_t()

static void cs_rotation_add_coriolis_t ( const cs_rotation_t r,
cs_real_t  c,
cs_real_t  tr[3][3] 
)
inlinestatic

Add the dual tensor of a rotation vector to a tensor.

Parameters
[in]rpointer to rotation structure
[in]cmultiplicative coefficient
[in,out]trtensor to which dual tensor of rotation is added

◆ cs_rotation_add_coriolis_v()

static void cs_rotation_add_coriolis_v ( const cs_rotation_t r,
cs_real_t  c,
const cs_real_t  v[3],
cs_real_t  vr[3] 
)
inlinestatic

Add a Coriolis term to a vector.

Parameters
[in]rpointer to rotation structure
[in]cmultiplicative coefficient
[in]vvelocity
[in,out]vrresulting Coriolis term

◆ cs_rotation_coriolis_t()

static void cs_rotation_coriolis_t ( const cs_rotation_t r,
cs_real_t  c,
cs_real_t  tr[3][3] 
)
inlinestatic

Compute the dual tensor of a rotation vector.

Parameters
[in]rpointer to rotation structure
[in]cmultiplicative coefficient
[out]trdual tensor of rotation is added

◆ cs_rotation_coriolis_v()

static void cs_rotation_coriolis_v ( const cs_rotation_t r,
cs_real_t  c,
const cs_real_t  v[3],
cs_real_t  vr[3] 
)
inlinestatic

Compute a vector Coriolis term.

Parameters
[in]rpointer to rotation structure
[in]cmultiplicative coefficient
[in]vvelocity
[out]vrresulting Coriolis term

◆ cs_rotation_cyl_v()

void cs_rotation_cyl_v ( const cs_rotation_t r,
const cs_real_t  coords[3],
const cs_real_t  v[3],
cs_real_t  vc[3] 
)

Express a vector in the cyclindrical system associated to a rotation.

Parameters
[in]rpointer to rotation structure
[in]pcartesian coordinates of the location point
[in]vvector components in cartesian coordinates system
[out]vcvector components in cylindrical coordinates system

◆ cs_rotation_define()

void cs_rotation_define ( double  omega_x,
double  omega_y,
double  omega_z,
double  invariant_x,
double  invariant_y,
double  invariant_z 
)

Define a global rotation.

The rotation vector's length determines the angular velocity (in rad/s).

Parameters
[in]omega_xrotation vector x component
[in]omega_yrotation vector y component
[in]omega_zrotation vector z component
[in]invariant_xinvariant point x component
[in]invariant_yinvariant point y component
[in]invariant_zinvariant point z component

◆ cs_rotation_matrix()

void cs_rotation_matrix ( double  theta,
const double  axis[3],
const double  invariant_point[3],
double  matrix[3][4] 
)

Compute rotation matrix.

Parameters
[in]thetarotation angle, in radians
[in]axisrotation axis direction vector
[in]invariant_pointinvariant point coordinates
[out]matrixresulting rotation matrix

◆ cs_rotation_to_array()

void cs_rotation_to_array ( int  r_num,
cs_real_t  fra[8] 
)

Copy rotation structure values to an array.

This may be useful to avoid requiring specific type mappings for MPI or other programming languages.

Parameters
[in]r_numrotation number (1 to n numbering, 0 for none)
[in]fraflat rotation array: axis (0-2), invariant(3-5), omega (6), angle(7)

◆ cs_rotation_update_coords()

void cs_rotation_update_coords ( cs_lnum_t  n_coords,
double  t_rot,
cs_real_3_t  coords[] 
)

Update coordinates based on a global rotation and time.

Parameters
[in]n_coordsnumber of coordinates
[in]t_rottime since rotation start
[in,out]coordscoordinates array

◆ cs_rotation_velocity()

static void cs_rotation_velocity ( const cs_rotation_t r,
const cs_real_t  coords[3],
cs_real_t  vr[3] 
)
inlinestatic

Compute velocity relative to a fixed frame at a given point.

Parameters
[in]rpointer to rotation structure
[in]coordspoint coordinates
[out]vrresulting rotation frame velocity

Variable Documentation

◆ cs_glob_rotation

cs_rotation_t* cs_glob_rotation