programmer's documentation
Enumerations | Functions
cs_advection_field.h File Reference
#include "cs_cdo.h"
#include "cs_cdo_connect.h"
#include "cs_cdo_local.h"
#include "cs_cdo_quantities.h"
#include "cs_param.h"
#include "cs_property.h"
#include "cs_time_step.h"
Include dependency graph for cs_advection_field.h:

Go to the source code of this file.

Enumerations

enum  cs_advection_field_key_t {
  CS_ADVKEY_POST, CS_ADVKEY_POST_UNITV, CS_ADVKEY_CELL_FIELD, CS_ADVKEY_VERTEX_FIELD,
  CS_ADVKEY_N_KEYS
}
 

Functions

void cs_advection_field_set_shared_pointers (const cs_cdo_quantities_t *quant, const cs_cdo_connect_t *connect, const cs_time_step_t *time_step)
 Set shared pointers to main domain members. More...
 
cs_adv_field_t * cs_advection_field_create (const char *name)
 Create and initialize a new advection field structure. More...
 
cs_adv_field_t * cs_advection_field_free (cs_adv_field_t *adv)
 Free a cs_adv_field_t structure. More...
 
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. More...
 
bool cs_advection_field_is_uniform (const cs_adv_field_t *adv)
 returns true if the advection field is uniform, otherwise false More...
 
bool cs_advection_field_is_cellwise (const cs_adv_field_t *adv)
 returns true if the advection field is uniform in each cell otherwise false More...
 
const char * cs_advection_field_get_name (const cs_adv_field_t *adv)
 Retrieve the name of an advection field. More...
 
cs_param_def_type_t cs_advection_field_get_deftype (const cs_adv_field_t *adv)
 Retrieve the type of definition used to set the current advection field structure. More...
 
void cs_advection_field_summary (const cs_adv_field_t *adv)
 Print a summary of a cs_adv_field_t structure. More...
 
void cs_advection_field_set_option (cs_adv_field_t *adv, cs_advection_field_key_t key, const char *keyval)
 Set optional parameters related to a cs_adv_field_t structure. More...
 
void cs_advection_field_def_by_value (cs_adv_field_t *adv, const char *val)
 Define the value of a cs_adv_field_t structure. More...
 
void cs_advection_field_def_by_analytic (cs_adv_field_t *adv, cs_analytic_func_t *func)
 Define a cs_adv_field_t structure thanks to an analytic function. More...
 
void cs_advection_field_def_by_array (cs_adv_field_t *adv, cs_desc_t desc, const cs_real_t *array)
 Define a cs_adv_field_t structure thanks to an array of values. More...
 
void cs_advection_field_create_field (cs_adv_field_t *adv)
 Create a cs_field_t structure related to an advection field. More...
 
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. More...
 
void cs_advection_field_get_at_xyz (const cs_adv_field_t *adv, const cs_real_3_t xyz, cs_nvec3_t *vect)
 Compute the value of the advection field for a given face. More...
 
void cs_advection_field_at_cells (const cs_adv_field_t *adv, cs_real_t *cell_values)
 Compute the value of the advection field at cell centers. More...
 
void cs_advection_field_at_vertices (const cs_adv_field_t *adv, cs_real_t *vtx_values)
 Compute the value of the advection field at vertices. More...
 
double cs_advection_field_get_cell_max (const cs_adv_field_t *adv)
 Compute the max. value of the advection field among cells. More...
 
void cs_advection_field_get_flux_dfaces (cs_lnum_t c_id, const cs_param_advection_t a_info, const cs_adv_field_t *adv, cs_real_t *fluxes)
 Compute the value of the flux of the advection field across the the dual faces of a cell. More...
 
cs_real_t cs_advection_field_get_flux_tef (const cs_adv_field_t *adv, const cs_param_advection_t a_info, const cs_cell_mesh_t *cm, short int f, short int e, short int v1, short int v2)
 Compute the value of the flux of the advection field across the triangle defined by the two vertices of an edge and the barycenter of a face. More...
 
cs_real_t cs_advection_field_get_flux_svef (cs_lnum_t v_id, cs_lnum_t e_id, cs_lnum_t f_id, const cs_param_advection_t a_info, const cs_adv_field_t *adv)
 Compute the value of the flux of the advection field across the triangle defined by a vertex, the face and edge barycenters. More...
 
void cs_advection_field_update (cs_adv_field_t *adv)
 Update the values of the related field(s) More...
 
bool cs_advection_field_needs_post (const cs_adv_field_t *adv)
 Check if additional predefined postprocessing is requested. More...
 
void cs_advection_field_extra_post (void *input, int mesh_id, int cat_id, int ent_flag[5], cs_lnum_t n_cells, cs_lnum_t n_i_faces, cs_lnum_t n_b_faces, const cs_lnum_t cell_list[], const cs_lnum_t i_face_list[], const cs_lnum_t b_face_list[], const cs_time_step_t *time_step)
 Predefined post-processing output for advection fields. Prototype of this function is fixed since it is a function pointer defined in cs_post.h (cs_post_time_mesh_dep_output_t) More...
 
void cs_advection_get_peclet (const cs_adv_field_t *adv, const cs_property_t *diff, cs_real_t peclet[])
 Compute the Peclet number in each cell. More...
 
void cs_advection_get_courant (const cs_adv_field_t *adv, double dt, cs_real_t courant[])
 Compute the Courant number in each cell. More...
 

Enumeration Type Documentation

§ cs_advection_field_key_t

Enumerator
CS_ADVKEY_POST 
CS_ADVKEY_POST_UNITV 
CS_ADVKEY_CELL_FIELD 
CS_ADVKEY_VERTEX_FIELD 
CS_ADVKEY_N_KEYS 

Function Documentation

§ cs_advection_field_at_cells()

void cs_advection_field_at_cells ( const cs_adv_field_t *  adv,
cs_real_t cell_values 
)

Compute the value of the advection field at cell centers.

Parameters
[in]advpointer to a cs_adv_field_t structure
[in,out]cell_valuesarray of values at cell centers

§ cs_advection_field_at_vertices()

void cs_advection_field_at_vertices ( const cs_adv_field_t *  adv,
cs_real_t vtx_values 
)

Compute the value of the advection field at vertices.

Parameters
[in]advpointer to a cs_adv_field_t structure
[in,out]vectpointer to a cs_nvec3_t structure (meas/unitv)

§ cs_advection_field_check_name()

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.

Parameters
[in]advpointer to a cs_adv_field_t structure to test
[in]ref_namename of the advection field to find
Returns
true if the name of the advection field is ref_name otherwise false

§ cs_advection_field_create()

cs_adv_field_t* cs_advection_field_create ( const char *  name)

Create and initialize a new advection field structure.

Parameters
[in]namename of the advection field
Returns
a pointer to a new allocated cs_adv_field_t structure

§ cs_advection_field_create_field()

void cs_advection_field_create_field ( cs_adv_field_t *  adv)

Create a cs_field_t structure related to an advection field.

Parameters
[in,out]advpointer to a cs_adv_field_t structure

§ cs_advection_field_def_by_analytic()

void cs_advection_field_def_by_analytic ( cs_adv_field_t *  adv,
cs_analytic_func_t func 
)

Define a cs_adv_field_t structure thanks to an analytic function.

Parameters
[in,out]advpointer to a cs_adv_field_t structure
[in]funcpointer to a function

§ cs_advection_field_def_by_array()

void cs_advection_field_def_by_array ( cs_adv_field_t *  adv,
cs_desc_t  desc,
const cs_real_t array 
)

Define a cs_adv_field_t structure thanks to an array of values.

Parameters
[in,out]advpointer to a cs_adv_field_t structure
[in]descinformation about this array
[in]arraypointer to an array

§ cs_advection_field_def_by_value()

void cs_advection_field_def_by_value ( cs_adv_field_t *  adv,
const char *  val 
)

Define the value of a cs_adv_field_t structure.

Parameters
[in,out]advpointer to a cs_adv_field_t structure
[in]keyvalaccessor to the value to set
[in,out]advpointer to a cs_adv_field_t structure
[in]valaccessor to the value to set

§ cs_advection_field_extra_post()

void cs_advection_field_extra_post ( void *  input,
int  mesh_id,
int  cat_id,
int  ent_flag[5],
cs_lnum_t  n_cells,
cs_lnum_t  n_i_faces,
cs_lnum_t  n_b_faces,
const cs_lnum_t  cell_list[],
const cs_lnum_t  i_face_list[],
const cs_lnum_t  b_face_list[],
const cs_time_step_t time_step 
)

Predefined post-processing output for advection fields. Prototype of this function is fixed since it is a function pointer defined in cs_post.h (cs_post_time_mesh_dep_output_t)

Parameters
[in,out]inputpointer to a optional structure (here a cs_groundwater_t structure)
[in]mesh_idid of the output mesh for the current call
[in]cat_idcategory id of the output mesh for this call
[in]ent_flagindicate global presence of cells (ent_flag[0]), interior faces (ent_flag[1]), boundary faces (ent_flag[2]), particles (ent_flag[3]) or probes (ent_flag[4])
[in]n_cellslocal number of cells of post_mesh
[in]n_i_faceslocal number of interior faces of post_mesh
[in]n_b_faceslocal number of boundary faces of post_mesh
[in]cell_listlist of cells (1 to n)
[in]i_face_listlist of interior faces (1 to n)
[in]b_face_listlist of boundary faces (1 to n)
[in]time_steppointer to a cs_time_step_t struct.

§ cs_advection_field_free()

cs_adv_field_t* cs_advection_field_free ( cs_adv_field_t *  adv)

Free a cs_adv_field_t structure.

Parameters
[in,out]advpointer to a cs_adv_field_t structure to free
Returns
a NULL pointer

§ cs_advection_field_get_at_xyz()

void cs_advection_field_get_at_xyz ( const cs_adv_field_t *  adv,
const cs_real_3_t  xyz,
cs_nvec3_t vect 
)

Compute the value of the advection field for a given face.

Parameters
[in]advpointer to a cs_adv_field_t structure
[in]xyzcoordinates where to evaluate the advection field
[in,out]vectpointer to a cs_nvec3_t structure (meas + unitv)

§ cs_advection_field_get_cell_max()

double cs_advection_field_get_cell_max ( const cs_adv_field_t *  adv)

Compute the max. value of the advection field among cells.

Parameters
[in]advpointer to a cs_adv_field_t structure
Returns
the max. value of the magnitude of the field at cell centers

§ cs_advection_field_get_cell_vector()

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.

Parameters
[in]c_idid of the current cell
[in]advpointer to a cs_adv_field_t structure
[in,out]vectpointer to a cs_nvec3_t structure (meas + unitv)

§ cs_advection_field_get_deftype()

cs_param_def_type_t cs_advection_field_get_deftype ( const cs_adv_field_t *  adv)

Retrieve the type of definition used to set the current advection field structure.

Parameters
[in]advpointer to an advection field structure
Returns
the type of definition

§ cs_advection_field_get_flux_dfaces()

void cs_advection_field_get_flux_dfaces ( cs_lnum_t  c_id,
const cs_param_advection_t  a_info,
const cs_adv_field_t *  adv,
cs_real_t fluxes 
)

Compute the value of the flux of the advection field across the the dual faces of a cell.

Parameters
[in]c_idid of the current cell
[in]a_infoset of parameters for the advection operator
[in]advpointer to a cs_adv_field_t structure
[in,out]fluxesarray of values attached to dual faces of a cell

§ cs_advection_field_get_flux_svef()

cs_real_t cs_advection_field_get_flux_svef ( cs_lnum_t  v_id,
cs_lnum_t  e_id,
cs_lnum_t  f_id,
const cs_param_advection_t  a_info,
const cs_adv_field_t *  adv 
)

Compute the value of the flux of the advection field across the triangle defined by a vertex, the face and edge barycenters.

Parameters
[in]v_idid of the current vertex
[in]e_idid of the current edge
[in]f_idid of the current face
[in]a_infoset of parameters for the advection operator
[in]advpointer to a cs_adv_field_t structure
Returns
the value of the flux across s(v,e,f)

§ cs_advection_field_get_flux_tef()

cs_real_t cs_advection_field_get_flux_tef ( const cs_adv_field_t *  adv,
const cs_param_advection_t  a_info,
const cs_cell_mesh_t cm,
short int  f,
short int  e,
short int  v1,
short int  v2 
)

Compute the value of the flux of the advection field across the triangle defined by the two vertices of an edge and the barycenter of a face.

Parameters
[in]advpointer to a cs_adv_field_t structure
[in]a_infoset of parameters for the advection operator
[in]cmpointer to a cs_cell_mesh_t structure
[in]fid of the face in the current cell
[in]eid of the edge in the current cell
[in]v1id of the first vertex in the current cell
[in]v2id of the second vertex in the current cell
Returns
the value of the flux across tef

§ cs_advection_field_get_name()

const char* cs_advection_field_get_name ( const cs_adv_field_t *  adv)

Retrieve the name of an advection field.

Parameters
[in]advpointer to an advection field structure
Returns
the name of the related advection field

§ cs_advection_field_is_cellwise()

bool cs_advection_field_is_cellwise ( const cs_adv_field_t *  adv)

returns true if the advection field is uniform in each cell otherwise false

Parameters
[in]advpointer to a property to test
Returns
true or false

§ cs_advection_field_is_uniform()

bool cs_advection_field_is_uniform ( const cs_adv_field_t *  adv)

returns true if the advection field is uniform, otherwise false

Parameters
[in]advpointer to a property to test
Returns
true or false

§ cs_advection_field_needs_post()

bool cs_advection_field_needs_post ( const cs_adv_field_t *  adv)

Check if additional predefined postprocessing is requested.

Parameters
[in]advpointer to a cs_adv_field_t structure
Returns
true or false

§ cs_advection_field_set_option()

void cs_advection_field_set_option ( cs_adv_field_t *  adv,
cs_advection_field_key_t  key,
const char *  keyval 
)

Set optional parameters related to a cs_adv_field_t structure.

Parameters
[in,out]advpointer to a cs_adv_field_t structure
[in]keykey related to the member of adv to set
[in]keyvalaccessor to the value to set

§ cs_advection_field_set_shared_pointers()

void cs_advection_field_set_shared_pointers ( const cs_cdo_quantities_t quant,
const cs_cdo_connect_t connect,
const cs_time_step_t time_step 
)

Set shared pointers to main domain members.

Parameters
[in]quantadditional mesh quantities struct.
[in]connectpointer to a cs_cdo_connect_t struct.
[in]time_steppointer to a time step structure

§ cs_advection_field_summary()

void cs_advection_field_summary ( const cs_adv_field_t *  adv)

Print a summary of a cs_adv_field_t structure.

Parameters
[in]advpointer to a cs_adv_field_t structure to summarize

§ cs_advection_field_update()

void cs_advection_field_update ( cs_adv_field_t *  adv)

Update the values of the related field(s)

Parameters
[in,out]advpointer to a cs_adv_field_t structure

§ cs_advection_get_courant()

void cs_advection_get_courant ( const cs_adv_field_t *  adv,
double  dt,
cs_real_t  courant[] 
)

Compute the Courant number in each cell.

Parameters
[in]advpointer to the advection field struct.
[in]dtvalue of the current time step
[in,out]courantpointer to an array storing Courant numbers

§ cs_advection_get_peclet()

void cs_advection_get_peclet ( const cs_adv_field_t *  adv,
const cs_property_t *  diff,
cs_real_t  peclet[] 
)

Compute the Peclet number in each cell.

Parameters
[in]advpointer to the advection field struct.
[in]diffpointer to the diffusion property struct.
[in,out]pecletpointer to an array storing Peclet number