7.3
general documentation
cs_rotation.c File Reference
#include "cs_defs.h"
#include <assert.h>
#include <math.h>
#include <string.h>
#include "bft_mem.h"
#include "cs_base.h"
#include "cs_math.h"
#include "cs_time_step.h"
#include "cs_timer.h"
#include "cs_rotation.h"
+ Include dependency graph for cs_rotation.c:

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...
 
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...
 

Function Documentation

◆ 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]coordscartesian 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