My Project
programmer's documentation
Enumerations | Functions
cs_field_operator.h File Reference
#include "cs_defs.h"
#include "cs_field.h"
#include "cs_gradient.h"
Include dependency graph for cs_field_operator.h:

Go to the source code of this file.

Enumerations

enum  cs_field_interpolate_t { CS_FIELD_INTERPOLATE_MEAN, CS_FIELD_INTERPOLATE_GRADIENT }
 Field interpolation modes. More...
 

Functions

void cs_field_gradient_scalar (const cs_field_t *f, bool use_previous_t, int inc, bool recompute_cocg, cs_real_3_t *restrict grad)
 Compute cell gradient of scalar field or component of vector or tensor field. More...
 
void cs_field_gradient_potential (const cs_field_t *f, bool use_previous_t, int inc, bool recompute_cocg, int hyd_p_flag, cs_real_3_t f_ext[], cs_real_3_t *restrict grad)
 Compute cell gradient of scalar field or component of vector or tensor field. More...
 
void cs_field_gradient_vector (const cs_field_t *f, bool use_previous_t, int inc, cs_real_33_t *restrict grad)
 Compute cell gradient of vector field. More...
 
void cs_field_gradient_tensor (const cs_field_t *f, bool use_previous_t, int inc, cs_real_63_t *restrict grad)
 Compute cell gradient of tensor field. More...
 
void cs_field_interpolate (cs_field_t *f, cs_field_interpolate_t interpolation_type, cs_lnum_t n_points, const cs_lnum_t point_location[], const cs_real_3_t point_coords[], cs_real_t *val)
 Interpolate field values at a given set of points. More...
 
void cs_field_local_extrema_scalar (int f_id, cs_halo_type_t halo_type, cs_real_t *local_max, cs_real_t *local_min)
 Find local extrema of a given scalar field at each cell. More...
 
void cs_field_set_volume_average (cs_field_t *f, const cs_real_t mean)
 Shift field values in order to set its spatial average to a given value. More...
 
void cs_field_synchronize (cs_field_t *f, cs_halo_type_t halo_type)
 Synchronize current parallel and periodic field values. More...
 

Enumeration Type Documentation

◆ cs_field_interpolate_t

Field interpolation modes.

Enumerator
CS_FIELD_INTERPOLATE_MEAN 

Mean element value (P0 interpolation)

CS_FIELD_INTERPOLATE_GRADIENT 

Mean element value + gradient correction (pseudo-P1)

Function Documentation

◆ cs_field_gradient_potential()

void cs_field_gradient_potential ( const cs_field_t f,
bool  use_previous_t,
int  inc,
bool  recompute_cocg,
int  hyd_p_flag,
cs_real_3_t  f_ext[],
cs_real_3_t *restrict  grad 
)

Compute cell gradient of scalar field or component of vector or tensor field.

Parameters
[in]fpointer to field
[in]use_previous_tshould we use values from the previous time step ?
[in]incif 0, solve on increment; 1 otherwise
[in]recompute_cocgshould COCG FV quantities be recomputed ?
[in]hyd_p_flagflag for hydrostatic pressure
[in]f_extexterior force generating the hydrostatic pressure
[out]gradgradient

◆ cs_field_gradient_scalar()

void cs_field_gradient_scalar ( const cs_field_t f,
bool  use_previous_t,
int  inc,
bool  recompute_cocg,
cs_real_3_t *restrict  grad 
)

Compute cell gradient of scalar field or component of vector or tensor field.

Parameters
[in]fpointer to field
[in]use_previous_tshould we use values from the previous time step ?
[in]incif 0, solve on increment; 1 otherwise
[in]recompute_cocgshould COCG FV quantities be recomputed ?
[out]gradgradient

◆ cs_field_gradient_tensor()

void cs_field_gradient_tensor ( const cs_field_t f,
bool  use_previous_t,
int  inc,
cs_real_63_t *restrict  grad 
)

Compute cell gradient of tensor field.

Parameters
[in]fpointer to field
[in]use_previous_tshould we use values from the previous time step ?
[in]incif 0, solve on increment; 1 otherwise
[out]gradgradient

◆ cs_field_gradient_vector()

void cs_field_gradient_vector ( const cs_field_t f,
bool  use_previous_t,
int  inc,
cs_real_33_t *restrict  grad 
)

Compute cell gradient of vector field.

Parameters
[in]fpointer to field
[in]use_previous_tshould we use values from the previous time step ?
[in]incif 0, solve on increment; 1 otherwise
[out]gradgradient

◆ cs_field_interpolate()

void cs_field_interpolate ( cs_field_t f,
cs_field_interpolate_t  interpolation_type,
cs_lnum_t  n_points,
const cs_lnum_t  point_location[],
const cs_real_3_t  point_coords[],
cs_real_t val 
)

Interpolate field values at a given set of points.

Parameters
[in]fpointer to field
[in]interpolation_typeinterpolation type
[in]n_pointsnumber of points at which interpolation is required
[in]point_locationlocation of points in mesh elements (based on the field location)
[in]point_coordspoint coordinates
[out]valinterpolated values

◆ cs_field_local_extrema_scalar()

void cs_field_local_extrema_scalar ( int  f_id,
cs_halo_type_t  halo_type,
cs_real_t local_max,
cs_real_t local_min 
)

Find local extrema of a given scalar field at each cell.

This assumes the field values have been synchronized.

Parameters
[in]fid scalar field id
[in]halo_typehalo type
[in,out]local_maxlocal maximum value
[in,out]local_minlocal minimum value

◆ cs_field_set_volume_average()

void cs_field_set_volume_average ( cs_field_t f,
const cs_real_t  va 
)

Shift field values in order to set its spatial average to a given value.

Parameters
[in]fpointer to field
[in]vareal value of volume average to be set

Shift field values in order to set its spatial average to a given value.

Parameters
[in]fpointer to field
[in]vareal value of fluid volume average to be set

◆ cs_field_synchronize()

void cs_field_synchronize ( cs_field_t f,
cs_halo_type_t  halo_type 
)

Synchronize current parallel and periodic field values.

This function currently only upates fields based on CS_MESH_LOCATION_CELLS.

Parameters
[in,out]fpointer to field
[in]halo_typehalo type