#include "cs_defs.h"#include <assert.h>#include <math.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "bft_mem.h"#include "bft_error.h"#include "bft_printf.h"#include "cs_field.h"#include "cs_field_default.h"#include "cs_gradient.h"#include "cs_gradient_boundary.h"#include "cs_halo.h"#include "cs_halo_perio.h"#include "cs_mesh.h"#include "cs_log.h"#include "cs_map.h"#include "cs_parameters.h"#include "cs_parall.h"#include "cs_mesh_adjacencies.h"#include "cs_mesh_location.h"#include "cs_mesh_quantities.h"#include "cs_internal_coupling.h"#include "cs_field_operator.h" Include dependency graph for cs_field_operator.c:
 Include dependency graph for cs_field_operator.c:| Functions | |
| static void | _field_interpolate_by_mean (const cs_field_t *f, cs_lnum_t n_points, const cs_lnum_t point_location[], cs_real_t *val) | 
| static void | _field_interpolate_by_gradient (const cs_field_t *f, cs_lnum_t n_points, const cs_lnum_t point_location[], const cs_real_3_t point_coords[], cs_real_t *val) | 
| static void | _local_extrema_scalar (const cs_real_t *restrict pvar, cs_halo_type_t halo_type, cs_real_t *local_max, cs_real_t *local_min) | 
| void | cs_field_gradient_scalar (const cs_field_t *f, bool use_previous_t, int inc, cs_real_3_t *restrict grad) | 
| Compute cell gradient of scalar field or component of vector or tensor field.  More... | |
| void | cs_field_gradient_scalar_array (int f_id, int inc, const cs_field_bc_coeffs_t *bc_coeffs, cs_real_t var[], cs_real_3_t grad[]) | 
| Compute cell gradient of scalar array using parameters associated with a given field.  More... | |
| void | cs_field_gradient_potential (const cs_field_t *f, bool use_previous_t, int inc, 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_gradient_boundary_iprime_scalar (const cs_field_t *f, bool use_previous_t, cs_lnum_t n_faces, const cs_lnum_t *face_ids, cs_real_t var_iprime[]) | 
| Compute the values of a scalar field at boundary face I' positions.  More... | |
| void | cs_field_gradient_boundary_iprime_vector (const cs_field_t *f, bool use_previous_t, cs_lnum_t n_faces, const cs_lnum_t *face_ids, cs_real_3_t var_iprime[]) | 
| Compute the values of a vector field at boundary face I' positions.  More... | |
| void | cs_field_gradient_boundary_iprime_tensor (const cs_field_t *f, bool use_previous_t, cs_lnum_t n_faces, const cs_lnum_t *face_ids, cs_real_6_t var_iprime[]) | 
| Compute the values of a symmetric tensor field at boundary face I' positions.  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 va) | 
| Shift field values in order to set its spatial average (fluid volume 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... | |
Field based algebraic operators.
| 
 | static | 
| 
 | static | 
| 
 | static | 
| void cs_field_gradient_boundary_iprime_scalar | ( | const cs_field_t * | f, | 
| bool | use_previous_t, | ||
| cs_lnum_t | n_faces, | ||
| const cs_lnum_t * | face_ids, | ||
| cs_real_t | var_iprime[] | ||
| ) | 
Compute the values of a scalar field at boundary face I' positions.
| [in] | f | pointer to field | 
| [in] | use_previous_t | should we use values from the previous time step ? | 
| [in] | inc | if 0, solve on increment; 1 otherwise | 
| [out] | grad | gradient | 
| void cs_field_gradient_boundary_iprime_tensor | ( | const cs_field_t * | f, | 
| bool | use_previous_t, | ||
| cs_lnum_t | n_faces, | ||
| const cs_lnum_t * | face_ids, | ||
| cs_real_6_t | var_iprime[] | ||
| ) | 
Compute the values of a symmetric tensor field at boundary face I' positions.
| [in] | f | pointer to field | 
| [in] | use_previous_t | should we use values from the previous time step ? | 
| [in] | inc | if 0, solve on increment; 1 otherwise | 
| [out] | grad | gradient | 
| void cs_field_gradient_boundary_iprime_vector | ( | const cs_field_t * | f, | 
| bool | use_previous_t, | ||
| cs_lnum_t | n_faces, | ||
| const cs_lnum_t * | face_ids, | ||
| cs_real_3_t | var_iprime[] | ||
| ) | 
Compute the values of a vector field at boundary face I' positions.
| [in] | f | pointer to field | 
| [in] | use_previous_t | should we use values from the previous time step ? | 
| [in] | inc | if 0, solve on increment; 1 otherwise | 
| [out] | grad | gradient | 
| void cs_field_gradient_potential | ( | const cs_field_t * | f, | 
| bool | use_previous_t, | ||
| int | inc, | ||
| 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.
| [in] | f | pointer to field | 
| [in] | use_previous_t | should we use values from the previous time step ? | 
| [in] | inc | if 0, solve on increment; 1 otherwise | 
| [in] | hyd_p_flag | flag for hydrostatic pressure | 
| [in] | f_ext | exterior force generating the hydrostatic pressure | 
| [out] | grad | gradient | 
| void cs_field_gradient_scalar | ( | const cs_field_t * | f, | 
| bool | use_previous_t, | ||
| int | inc, | ||
| cs_real_3_t *restrict | grad | ||
| ) | 
Compute cell gradient of scalar field or component of vector or tensor field.
| [in] | f | pointer to field | 
| [in] | use_previous_t | should we use values from the previous time step ? | 
| [in] | inc | if 0, solve on increment; 1 otherwise | 
| [out] | grad | gradient | 
| void cs_field_gradient_scalar_array | ( | int | f_id, | 
| int | inc, | ||
| const cs_field_bc_coeffs_t * | bc_coeffs, | ||
| cs_real_t | var[], | ||
| cs_real_3_t | grad[] | ||
| ) | 
Compute cell gradient of scalar array using parameters associated with a given field.
| [in] | f_id | associated field id | 
| [in] | inc | if 0, solve on increment; 1 otherwise | 
| [in] | bc_coeffs | boundary condition structure | 
| [in,out] | var | gradient's base variable | 
| [out] | grad | gradient | 
| 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.
| [in] | f | pointer to field | 
| [in] | use_previous_t | should we use values from the previous time step ? | 
| [in] | inc | if 0, solve on increment; 1 otherwise | 
| [out] | grad | gradient | 
| 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.
| [in] | f | pointer to field | 
| [in] | use_previous_t | should we use values from the previous time step ? | 
| [in] | inc | if 0, solve on increment; 1 otherwise | 
| [out] | grad | gradient | 
| 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.
| [in] | f | pointer to field | 
| [in] | interpolation_type | interpolation type | 
| [in] | n_points | number of points at which interpolation is required | 
| [in] | point_location | location of points in mesh elements (based on the field location) | 
| [in] | point_coords | point coordinates | 
| [out] | val | interpolated values | 
| 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.
| [in] | f_id | scalar field id | 
| [in] | halo_type | halo type | 
| [in,out] | local_max | local maximum value | 
| [in,out] | local_min | local minimum value | 
| 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 (fluid volume average) to a given value.
Shift field values in order to set its spatial average to a given value.
| [in] | f | pointer to field | 
| [in] | va | real value of fluid volume average to be set | 
| 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.
| [in,out] | f | pointer to field | 
| [in] | halo_type | halo type |