 |
6.3
general documentation
|
|
Go to the documentation of this file. 1 #ifndef __CS_ADVECTION_FIELD_H__
2 #define __CS_ADVECTION_FIELD_H__
60 #define CS_ADVECTION_FIELD_POST_COURANT (1 << 0)
302 static inline const char *
383 " %s: Invalid mesh location type %d.\n"
384 " Stop retrieving the advection field.\n",
499 const char *ref_name);
cs_mesh_location_type_t
Definition: cs_mesh_location.h:60
@ CS_N_XDEF_TYPES
Definition: cs_xdef.h:120
@ CS_ADVECTION_FIELD_LEGACY_FV
Definition: cs_advection_field.h:139
@ CS_ADVECTION_FIELD_NAVSTO
Definition: cs_advection_field.h:125
cs_real_t * cs_advection_field_divergence_at_vertices(const cs_adv_field_t *adv, cs_real_t t_eval)
Compute the divergence of the advection field at vertices Useful for CDO Vertex-based schemes.
Definition: cs_advection_field.c:3301
@ CS_MESH_LOCATION_BOUNDARY_FACES
Definition: cs_mesh_location.h:65
void cs_advection_field_finalize_setup(void)
Last stage of the definition of an advection field based on several definitions (i....
Definition: cs_advection_field.c:1213
cs_real_t cs_advection_field_cw_boundary_face_flux(const cs_real_t time_eval, const short int f, const cs_cell_mesh_t *cm, const cs_adv_field_t *adv)
Compute the value of the normal flux of the advection field across a boundary face f (cellwise versio...
Definition: cs_advection_field.c:2157
int id
Definition: cs_advection_field.h:195
int n_bdy_flux_defs
Definition: cs_advection_field.h:210
void cs_advection_field_at_vertices(const cs_adv_field_t *adv, cs_real_t time_eval, cs_real_t *vtx_values)
Compute the value of the advection field at vertices.
Definition: cs_advection_field.c:1692
Structure storing medata for defining a quantity in a very flexible way.
Definition: cs_xdef.h:154
void() cs_analytic_func_t(cs_real_t time, cs_lnum_t n_elts, const cs_lnum_t *elt_ids, const cs_real_t *coords, bool dense_output, void *input, cs_real_t *retval)
Generic function pointer for an evaluation relying on an analytic function elt_ids is optional....
Definition: cs_param_types.h:94
@ CS_MESH_LOCATION_VERTICES
Definition: cs_mesh_location.h:66
void cs_advection_field_in_cells(const cs_adv_field_t *adv, cs_real_t time_eval, cs_real_t *cell_values)
Compute the mean-value of the vector-valued field related to the advection field inside each cell.
Definition: cs_advection_field.c:1494
void cs_advection_field_cw_boundary_f2v_flux(const cs_cell_mesh_t *cm, const cs_adv_field_t *adv, short int f, cs_real_t time_eval, cs_real_t *fluxes)
Compute the value of the normal flux of the advection field across the closure of the dual cell relat...
Definition: cs_advection_field.c:2404
short int * bdy_def_ids
Definition: cs_advection_field.h:212
#define restrict
Definition: cs_defs.h:124
int cs_advection_field_get_n_fields(void)
Get the number of allocated cs_adv_field_t structures.
Definition: cs_advection_field.c:383
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:317
void cs_advection_field_def_boundary_flux_by_field(cs_adv_field_t *adv, cs_field_t *field)
Define the value of the boundary normal flux for the given cs_adv_field_t structure using a field str...
Definition: cs_advection_field.c:1064
void cs_advection_field_cw_face_flux(const cs_cell_mesh_t *cm, const cs_adv_field_t *adv, cs_real_t time_eval, cs_real_t *fluxes)
Compute the value of the flux of the advection field across the the (primal) faces of a cell.
Definition: cs_advection_field.c:2631
cs_flag_t cs_advection_field_status_t
Definition: cs_advection_field.h:68
void cs_advection_field_def_by_dof_func(cs_adv_field_t *adv, cs_flag_t loc_flag, cs_dof_func_t *func, void *input)
Define a cs_adv_field_t structure using a cs_dof_func_t.
Definition: cs_advection_field.c:801
void cs_advection_field_across_boundary(const cs_adv_field_t *adv, cs_real_t time_eval, cs_real_t *flx_values)
Compute the value of the normal flux of the advection field across the boundary faces.
Definition: cs_advection_field.c:1841
#define CS_FLAG_STATE_UNIFORM
Definition: cs_flag.h:87
#define END_C_DECLS
Definition: cs_defs.h:493
void cs_advection_field_get_cell_vector(cs_lnum_t c_id, const cs_adv_field_t *adv, cs_nvec3_t *vect)
Compute the value of the advection field at the cell center.
Definition: cs_advection_field.c:1304
void cs_advection_field_def_by_analytic(cs_adv_field_t *adv, cs_analytic_func_t *func, void *input)
Define a cs_adv_field_t structure thanks to an analytic function.
Definition: cs_advection_field.c:766
double cs_real_t
Floating-point value.
Definition: cs_defs.h:304
cs_adv_field_t * cs_advection_field_by_id(int id)
Search in the array of advection field structures which one has the id given in argument.
Definition: cs_advection_field.c:428
@ CS_ADVECTION_FIELD_USER
Definition: cs_advection_field.h:127
#define BEGIN_C_DECLS
Definition: cs_defs.h:492
void cs_advection_field_def_by_array(cs_adv_field_t *adv, cs_flag_t loc, cs_real_t *array, bool is_owner, cs_lnum_t *index)
Define a cs_adv_field_t structure thanks to an array of values.
Definition: cs_advection_field.c:840
@ CS_ADVECTION_FIELD_STEADY
Definition: cs_advection_field.h:138
void cs_advection_get_courant(const cs_adv_field_t *adv, cs_real_t dt_cur, cs_real_t courant[])
Compute the Courant number in each cell.
Definition: cs_advection_field.c:3256
void cs_advection_field_update(cs_real_t t_eval, bool cur2prev)
For each cs_adv_field_t structures, update the values of the related field(s)
Definition: cs_advection_field.c:3132
void cs_advection_field_cw_eval_at_xyz(const cs_adv_field_t *adv, const cs_cell_mesh_t *cm, const cs_real_3_t xyz, cs_real_t time_eval, cs_nvec3_t *eval)
Compute the vector-valued interpolation of the advection field at a given location inside a cell.
Definition: cs_advection_field.c:1335
int bdy_field_id
Definition: cs_advection_field.h:202
void bft_error(const char *const file_name, const int line_num, const int sys_error_code, const char *const format,...)
Calls the error handler (set by bft_error_handler_set() or default).
Definition: bft_error.c:193
void() cs_dof_func_t(cs_lnum_t n_elts, const cs_lnum_t *elt_ids, bool dense_output, void *input, cs_real_t *retval)
Generic function pointer for computing a quantity at predefined locations such as degrees of freedom ...
Definition: cs_param_types.h:119
int vtx_field_id
Definition: cs_advection_field.h:200
@ CS_ADVECTION_FIELD_TYPE_SCALAR_FLUX
Definition: cs_advection_field.h:133
void cs_advection_field_log_setup(void)
Print all setup information related to cs_adv_field_t structures.
Definition: cs_advection_field.c:619
cs_flag_t state
Definition: cs_xdef.h:193
cs_xdef_type_t cs_xdef_get_type(const cs_xdef_t *d)
Retrieve the flag dedicated to the state.
Definition: cs_xdef.c:835
cs_xdef_t ** bdy_flux_defs
Definition: cs_advection_field.h:211
void cs_advection_field_create_fields(void)
Create all needed cs_field_t structures related to an advection field.
Definition: cs_advection_field.c:1103
void cs_advection_field_set_postprocess(cs_adv_field_t *adv, cs_flag_t post_flag)
Set optional post-processings.
Definition: cs_advection_field.c:717
Definition: cs_cdo_quantities.h:124
Structure associated to the definition of a property relying on the cs_xdef_t structure.
int int_field_id
Definition: cs_advection_field.h:203
void cs_advection_field_def_boundary_flux_by_array(cs_adv_field_t *adv, const char *zname, cs_flag_t loc, cs_real_t *array, bool is_owner, cs_lnum_t *index)
Define the value of the boundary normal flux for the given cs_adv_field_t structure using an array of...
Definition: cs_advection_field.c:1010
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:298
Definition: cs_cdo_connect.h:76
cs_field_t * cs_field_by_id(int id)
Return a pointer to a field based on its id.
Definition: cs_field.c:2314
int cell_field_id
Definition: cs_advection_field.h:201
@ CS_ADVECTION_FIELD_GWF
Definition: cs_advection_field.h:126
cs_flag_t post_flag
Definition: cs_advection_field.h:198
char *restrict name
Definition: cs_advection_field.h:196
cs_xdef_type_t
Definition: cs_xdef.h:108
void cs_advection_get_peclet(const cs_adv_field_t *adv, const cs_property_t *diff, cs_real_t t_eval, cs_real_t peclet[])
Compute the Peclet number in each cell.
Definition: cs_advection_field.c:3208
bool cs_advection_field_check_name(const cs_adv_field_t *adv, const char *ref_name)
Check if the given advection field has the name ref_name.
Definition: cs_advection_field.c:593
@ CS_ADVECTION_FIELD_DEFINE_AT_VERTICES
Definition: cs_advection_field.h:140
void cs_advection_field_def_by_field(cs_adv_field_t *adv, cs_field_t *field)
Define a cs_adv_field_t structure thanks to a field structure.
Definition: cs_advection_field.c:892
void cs_advection_field_set_shared_pointers(const cs_cdo_quantities_t *quant, const cs_cdo_connect_t *connect)
Set shared pointers to main domain members.
Definition: cs_advection_field.c:366
#define CS_FLAG_STATE_CELLWISE
Definition: cs_flag.h:88
unsigned short int cs_flag_t
Definition: cs_defs.h:306
@ CS_ADVECTION_FIELD_TYPE_VELOCITY_VECTOR
Definition: cs_advection_field.h:132
cs_advection_field_status_t status
Definition: cs_advection_field.h:197
cs_adv_field_t * cs_advection_field_add(const char *name, cs_advection_field_status_t status)
Add and initialize a new advection field structure.
Definition: cs_advection_field.c:468
void cs_advection_field_cw_dface_flux(const cs_cell_mesh_t *cm, const cs_adv_field_t *adv, cs_real_t time_eval, cs_real_t *fluxes)
Compute the value of the flux of the advection field across the the dual faces of a cell.
Definition: cs_advection_field.c:2825
Definition: cs_defs.h:350
cs_xdef_t * definition
Definition: cs_advection_field.h:207
cs_adv_field_t * cs_advection_field_by_name(const char *name)
Search in the array of advection field structures which one has the name given in argument.
Definition: cs_advection_field.c:400
Definition: cs_advection_field.h:149
cs_adv_field_t * cs_advection_field_add_user(const char *name)
Add and initialize a new user-defined advection field structure.
Definition: cs_advection_field.c:451
Field descriptor.
Definition: cs_field.h:125
void cs_advection_field_def_by_value(cs_adv_field_t *adv, cs_real_t vector[3])
Define the value of a cs_adv_field_t structure.
Set of local quantities and connectivities related to a mesh cell This is a key structure for all cel...
Definition: cs_cdo_local.h:159
void cs_advection_field_def_boundary_flux_by_analytic(cs_adv_field_t *adv, const char *zname, cs_analytic_func_t *func, void *input)
Define the value of the boundary normal flux for the given cs_adv_field_t structure using an analytic...
Definition: cs_advection_field.c:966
@ CS_MESH_LOCATION_CELLS
Definition: cs_mesh_location.h:63
@ CS_ADVECTION_FIELD_DEFINE_AT_BOUNDARY_FACES
Definition: cs_advection_field.h:141
cs_advection_field_status_bit_t
Bit values for specifying the definition/behavior of an advection field.
Definition: cs_advection_field.h:120
void cs_advection_field_destroy_all(void)
Free all alllocated cs_adv_field_t structures and its related array.
Definition: cs_advection_field.c:553
@ CS_MESH_LOCATION_INTERIOR_FACES
Definition: cs_mesh_location.h:64
void cs_advection_field_def_boundary_flux_by_value(cs_adv_field_t *adv, const char *zname, cs_real_t normal_flux)
Define the value of the boundary normal flux for the given cs_adv_field_t structure.
Definition: cs_advection_field.c:930