programmer's documentation
Macros | Typedefs | Functions | Variables
cs_equation.c File Reference
#include "cs_defs.h"
#include <assert.h>
#include <ctype.h>
#include <float.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <bft_mem.h>
#include "cs_base.h"
#include "cs_cdo.h"
#include "cs_cdovb_scaleq.h"
#include "cs_cdovcb_scaleq.h"
#include "cs_cdofb_scaleq.h"
#include "cs_evaluate.h"
#include "cs_hho_scaleq.h"
#include "cs_log.h"
#include "cs_mesh_location.h"
#include "cs_parall.h"
#include "cs_post.h"
#include "cs_range_set.h"
#include "cs_sles.h"
#include "cs_timer_stats.h"
#include "cs_equation.h"
Include dependency graph for cs_equation.c:

Macros

#define CS_EQUATION_DBG   1
 

Typedefs

typedef void *() cs_equation_init_builder_t(const cs_equation_param_t *eqp, const cs_mesh_t *mesh)
 Initialize a builder structure. More...
 
typedef void *() cs_equation_free_builder_t(void *builder)
 Destroy a builder structure. More...
 
typedef void() cs_equation_initialize_system_t(void *builder, cs_matrix_t **system_matrix, cs_real_t **system_rhs)
 Create the matrix of the current algebraic system. Allocate and initialize the right-hand side associated to the given builder structure. More...
 
typedef void() cs_equation_build_system_t(const cs_mesh_t *mesh, const cs_real_t *field_val, double dt_cur, void *builder, cs_real_t *rhs, cs_matrix_t *matrix)
 Build a linear system within the CDO framework. More...
 
typedef void() cs_equation_update_field_t(const cs_real_t *solu, const cs_real_t *rhs, void *builder, cs_real_t *field_val)
 Store solution(s) of the linear system into a field structure Update extra-field values if required (for hybrid discretization) More...
 
typedef void() cs_equation_compute_source_t(void *builder)
 Compute the contribution of source terms for the current time. More...
 
typedef void() cs_equation_flux_plane_t(const cs_real_t direction[], const cs_real_t *pdi, int ml_id, void *builder, double *diff_flux, double *conv_flux)
 Compute the diffusive and convective flux across a list of faces. More...
 
typedef void() cs_equation_cell_difflux_t(const cs_real_t *f_vals, void *builder, cs_flag_t location, cs_real_t *d_flux)
 Cellwise computation of the diffusive flux across all faces. Primal or dual faces are considered according to the space scheme. More...
 
typedef void() cs_equation_extra_op_t(const char *eqname, const cs_field_t *field, void *builder)
 Extra-operation related to this equation. More...
 
typedef double *() cs_equation_get_extra_values_t(const void *builder)
 Get the computed values at a different location than that of the field associated to this equation. More...
 
typedef void() cs_equation_monitor_t(const char *eqname, const void *builder)
 Display information related to the monitoring of the current system. More...
 

Functions

static int _check_ml_name (const char *ml_name, const char *default_ml_name)
 Given its name, get the id related to a cs_mesh_location_t structure. More...
 
static int _add_bc_def (cs_param_bc_t *bc)
 Update the structure storing the BC parameters. More...
 
static int _add_ic_def (cs_param_time_t *t_info)
 Add a new definition to set the initial condition (IC) More...
 
static void _initialize_field_from_ic (cs_equation_t *eq)
 Set the initial values for the variable related to an equation. More...
 
cs_equation_t * cs_equation_create (const char *eqname, const char *varname, cs_equation_type_t eqtype, cs_param_var_type_t vartype, cs_param_bc_type_t default_bc)
 Define and initialize a new structure to store parameters related to an equation. More...
 
cs_equation_t * cs_equation_free (cs_equation_t *eq)
 Destroy a cs_equation_t structure. More...
 
void cs_equation_print_monitoring (const cs_equation_t *eq)
 Print a synthesis of the monitoring information in the performance file. More...
 
void cs_equation_summary (const cs_equation_t *eq)
 Summary of a cs_equation_t structure. More...
 
void cs_equation_set_timer_stats (cs_equation_t *eq)
 Create timer statistics structures to enable a "home-made" profiling. More...
 
void cs_equation_last_setup (const cs_cdo_connect_t *connect, cs_equation_t *eq)
 Assign a set of pointer functions for managing the cs_equation_t structure during the computation. More...
 
void cs_equation_set_param (cs_equation_t *eq, cs_equation_key_t key, const char *keyval)
 Set a parameter in a cs_equation_t structure attached to keyname. More...
 
void cs_equation_link (cs_equation_t *eq, const char *keyword, void *pointer)
 Associate a material property or an advection field with an equation for a given term (diffusion, time, convection) More...
 
void cs_equation_set_ic_by_value (cs_equation_t *eq, const char *ml_name, cs_get_t get)
 Define the initial condition for the unknown related to this equation This definition can be done on a specified mesh location. By default, the unknown is set to zero everywhere. Here a constant value is set to all the entities belonging to the given mesh location. More...
 
void cs_equation_set_ic_by_qov (cs_equation_t *eq, const char *ml_name, double quantity)
 Define the initial condition for the unknown related to this equation This definition can be done on a specified mesh location. By default, the unknown is set to zero everywhere. Here the value related to all the entities belonging to the given mesh location is such that the integral over these cells returns the requested quantity. More...
 
void cs_equation_set_ic_by_analytic (cs_equation_t *eq, const char *ml_name, cs_analytic_func_t *analytic)
 Define the initial condition for the unknown related to this equation This definition can be done on a specified mesh location. By default, the unknown is set to zero everywhere. Here the initial value is set according to an analytical function. More...
 
void cs_equation_add_bc_by_value (cs_equation_t *eq, const cs_param_bc_type_t bc_type, const char *ml_name, const cs_get_t get)
 Define and initialize a new structure to set a boundary condition related to the givan equation structure ml_name corresponds to the name of a pre-existing cs_mesh_location_t. More...
 
void cs_equation_add_bc_by_analytic (cs_equation_t *eq, const cs_param_bc_type_t bc_type, const char *ml_name, cs_analytic_func_t *analytic)
 Define and initialize a new structure to set a boundary condition related to the givan equation structure ml_name corresponds to the name of a pre-existing cs_mesh_location_t. More...
 
void cs_equation_add_linear_reaction (cs_equation_t *eq, cs_property_t *property, const char *r_name)
 Define and initialize a new structure to store parameters related to a reaction term. More...
 
cs_source_term_tcs_equation_add_source_term_by_val (cs_equation_t *eq, const char *st_name, const char *ml_name, const void *val)
 Define a new source term structure and initialize it by value. More...
 
cs_source_term_tcs_equation_add_source_term_by_analytic (cs_equation_t *eq, const char *st_name, const char *ml_name, cs_analytic_func_t *ana)
 Define a new source term structure and initialize it by an analytical function. More...
 
void cs_equation_create_field (cs_equation_t *eq)
 Create a field structure related to this cs_equation_t structure to an equation. More...
 
void cs_equation_init_system (const cs_mesh_t *mesh, cs_equation_t *eq)
 Initialize the values of a field according to the initial condition related to its equation. More...
 
bool cs_equation_needs_build (const cs_equation_t *eq)
 Check if one has to build the linear system. More...
 
void cs_equation_build_system (const cs_mesh_t *mesh, const cs_time_step_t *time_step, double dt_cur, cs_equation_t *eq)
 Build the linear system for this equation. More...
 
void cs_equation_solve (cs_equation_t *eq)
 Solve the linear system for this equation. More...
 
bool cs_equation_is_steady (const cs_equation_t *eq)
 Return true is the given equation is steady otherwise false. More...
 
const char * cs_equation_get_name (const cs_equation_t *eq)
 Return the name related to the given cs_equation_t structure to an equation. More...
 
cs_field_tcs_equation_get_field (const cs_equation_t *eq)
 Return the field structure associated to a cs_equation_t structure. More...
 
cs_flag_t cs_equation_get_flag (const cs_equation_t *eq)
 Return the flag associated to an equation. More...
 
const cs_equation_param_tcs_equation_get_param (const cs_equation_t *eq)
 Return the cs_equation_param_t structure associated to a cs_equation_t structure. More...
 
cs_property_tcs_equation_get_diffusion_property (const cs_equation_t *eq)
 Return a pointer to the cs_property_t structure associated to the diffusion term for this equation (NULL if not activated). More...
 
cs_property_tcs_equation_get_time_property (const cs_equation_t *eq)
 Return a pointer to the cs_property_t structure associated to the unsteady term for this equation (NULL if not activated). More...
 
cs_property_tcs_equation_get_reaction_property (const cs_equation_t *eq, const char *r_name)
 Return a pointer to the cs_property_t structure associated to the reaction term called r_name and related to this equation. More...
 
cs_space_scheme_t cs_equation_get_space_scheme (const cs_equation_t *eq)
 Return the type of numerical scheme used for the discretization in space. More...
 
int cs_equation_get_space_poly_degree (const cs_equation_t *eq)
 Return the max. degree used in the polynomial basis for the space discretization. More...
 
cs_param_var_type_t cs_equation_get_var_type (const cs_equation_t *eq)
 Return the type of variable solved by this equation. More...
 
cs_equation_type_t cs_equation_get_type (const cs_equation_t *eq)
 Return the type of equation for the given equation structure. More...
 
const cs_real_tcs_equation_get_face_values (const cs_equation_t *eq)
 Get the values at each face of the mesh for the field unknowns related to this equation. More...
 
const cs_real_tcs_equation_get_cell_values (const cs_equation_t *eq)
 Get the values at each cell centers for the field unknowns related to this equation. More...
 
void cs_equation_compute_flux_across_plane (const cs_equation_t *eq, const char *ml_name, const cs_real_3_t direction, cs_real_t *diff_flux, cs_real_t *conv_flux)
 Compute the diffusive and convective flux accross a plane defined by a mesh location structure attached to the name ml_name. More...
 
void cs_equation_compute_diff_flux_cellwise (const cs_equation_t *eq, cs_flag_t location, cs_real_t *diff_flux)
 Cellwise computation of the diffusive flux across all cell faces. Primal or dual faces are considered according to the space scheme. More...
 
void cs_equation_extra_post (const cs_equation_t *eq, const cs_time_step_t *ts, double dt)
 Predefined extra-operations related to this equation. More...
 

Variables

static const char _err_empty_eq []
 

Macro Definition Documentation

◆ CS_EQUATION_DBG

#define CS_EQUATION_DBG   1

Typedef Documentation

◆ cs_equation_build_system_t

typedef void() cs_equation_build_system_t(const cs_mesh_t *mesh, const cs_real_t *field_val, double dt_cur, void *builder, cs_real_t *rhs, cs_matrix_t *matrix)

Build a linear system within the CDO framework.

Parameters
[in]mpointer to a cs_mesh_t structure
[in]field_valpointer to the current value of the field
[in]dt_curcurrent value of the time step
[in,out]builderpointer to builder structure
[in,out]rhsright-hand side to compute
[in,out]matrixpointer to cs_matrix_t structure to compute

◆ cs_equation_cell_difflux_t

typedef void() cs_equation_cell_difflux_t(const cs_real_t *f_vals, void *builder, cs_flag_t location, cs_real_t *d_flux)

Cellwise computation of the diffusive flux across all faces. Primal or dual faces are considered according to the space scheme.

Parameters
[in]f_valspointer to an array of field values
[in,out]builderpointer to a builder structure
[in,out]locationwhere the flux is defined
[in,out]diff_fluxpointer to the value of the diffusive flux

◆ cs_equation_compute_source_t

typedef void() cs_equation_compute_source_t(void *builder)

Compute the contribution of source terms for the current time.

Parameters
[in,out]builderpointer to builder structure

◆ cs_equation_extra_op_t

typedef void() cs_equation_extra_op_t(const char *eqname, const cs_field_t *field, void *builder)

Extra-operation related to this equation.

Parameters
[in]eqnamename of the equation
[in]fieldpointer to a field structure
[in,out]builderpointer to builder structure

◆ cs_equation_flux_plane_t

typedef void() cs_equation_flux_plane_t(const cs_real_t direction[], const cs_real_t *pdi, int ml_id, void *builder, double *diff_flux, double *conv_flux)

Compute the diffusive and convective flux across a list of faces.

Parameters
[in]directionindicate in which direction flux is > 0
[in]pdipointer to an array of field values
[in]ml_idid related to a cs_mesh_location_t struct.
[in,out]builderpointer to a builder structure
[in,out]diff_fluxpointer to the value of the diffusive flux
[in,out]conv_fluxpointer to the value of the convective flux

◆ cs_equation_free_builder_t

typedef void*() cs_equation_free_builder_t(void *builder)

Destroy a builder structure.

Parameters
[in,out]builderpointer to a builder structure
Returns
a NULL pointer

◆ cs_equation_get_extra_values_t

typedef double*() cs_equation_get_extra_values_t(const void *builder)

Get the computed values at a different location than that of the field associated to this equation.

Parameters
[in]builderpointer to a builder structure
Returns
a pointer to an array of double

◆ cs_equation_init_builder_t

typedef void*() cs_equation_init_builder_t(const cs_equation_param_t *eqp, const cs_mesh_t *mesh)

Initialize a builder structure.

Parameters
[in]eqpointer to a cs_equation_param_t structure
[in]meshpointer to a cs_mesh_t structure
Returns
a pointer to a new allocated builder structure

◆ cs_equation_initialize_system_t

typedef void() cs_equation_initialize_system_t(void *builder, cs_matrix_t **system_matrix, cs_real_t **system_rhs)

Create the matrix of the current algebraic system. Allocate and initialize the right-hand side associated to the given builder structure.

Parameters
[in,out]builderpointer to generic builder structure
[in,out]system_matrixpointer of pointer to a cs_matrix_t struct.
[in,out]system_rhspointer of pointer to an array of double

◆ cs_equation_monitor_t

typedef void() cs_equation_monitor_t(const char *eqname, const void *builder)

Display information related to the monitoring of the current system.

Parameters
[in]eqnamename of the related equation
[in]builderpointer to an equation builder structure

◆ cs_equation_update_field_t

typedef void() cs_equation_update_field_t(const cs_real_t *solu, const cs_real_t *rhs, void *builder, cs_real_t *field_val)

Store solution(s) of the linear system into a field structure Update extra-field values if required (for hybrid discretization)

Parameters
[in]solusolution array
[in]rhsrhs associated to this solution array
[in,out]builderpointer to builder structure
[in,out]field_valpointer to the current value of the field

Function Documentation

◆ _add_bc_def()

static int _add_bc_def ( cs_param_bc_t bc)
inlinestatic

Update the structure storing the BC parameters.

Parameters
[in,out]bcpointer to a cs_param_bc_t structure
Returns
the id of the new BC definition

◆ _add_ic_def()

static int _add_ic_def ( cs_param_time_t t_info)
inlinestatic

Add a new definition to set the initial condition (IC)

Parameters
[in,out]t_infopointer to a cs_param_time_t structure
Returns
the id of the new IC definition

◆ _check_ml_name()

static int _check_ml_name ( const char *  ml_name,
const char *  default_ml_name 
)
inlinestatic

Given its name, get the id related to a cs_mesh_location_t structure.

Parameters
[in]ml_namename of the location
[in]default_ml_namename of the location by default
Returns
the id of the related mesh location

◆ _initialize_field_from_ic()

static void _initialize_field_from_ic ( cs_equation_t *  eq)
static

Set the initial values for the variable related to an equation.

Parameters
[in,out]eqpointer to a cs_equation_t structure

◆ cs_equation_add_bc_by_analytic()

void cs_equation_add_bc_by_analytic ( cs_equation_t *  eq,
const cs_param_bc_type_t  bc_type,
const char *  ml_name,
cs_analytic_func_t analytic 
)

Define and initialize a new structure to set a boundary condition related to the givan equation structure ml_name corresponds to the name of a pre-existing cs_mesh_location_t.

Parameters
[in,out]eqpointer to a cs_equation_t structure
[in]bc_typetype of boundary condition to add
[in]ml_namename of the related mesh location
[in]analyticpointer to an analytic function defining the value

◆ cs_equation_add_bc_by_value()

void cs_equation_add_bc_by_value ( cs_equation_t *  eq,
const cs_param_bc_type_t  bc_type,
const char *  ml_name,
const cs_get_t  get 
)

Define and initialize a new structure to set a boundary condition related to the givan equation structure ml_name corresponds to the name of a pre-existing cs_mesh_location_t.

Parameters
[in,out]eqpointer to a cs_equation_t structure
[in]bc_typetype of boundary condition to add
[in]ml_namename of the related mesh location
[in]getpointer to a cs_get_t structure storing the value

◆ cs_equation_add_linear_reaction()

void cs_equation_add_linear_reaction ( cs_equation_t *  eq,
cs_property_t property,
const char *  r_name 
)

Define and initialize a new structure to store parameters related to a reaction term.

Parameters
[in,out]eqpointer to a cs_equation_t structure
[in]propertypointer to a cs_property_t struct.
[in]r_namename of the reaction term (optional, i.e. NULL)

◆ cs_equation_add_source_term_by_analytic()

cs_source_term_t* cs_equation_add_source_term_by_analytic ( cs_equation_t *  eq,
const char *  st_name,
const char *  ml_name,
cs_analytic_func_t ana 
)

Define a new source term structure and initialize it by an analytical function.

Define and initialize by an analytical function a new structure related to a source term defined by a user.

Parameters
[in,out]eqpointer to a cs_equation_t structure
[in]st_namename of the source term or NULL
[in]ml_namename of the related mesh location
[in]anapointer to an analytical function
Returns
a pointer to the new cs_source_term_t structure

◆ cs_equation_add_source_term_by_val()

cs_source_term_t* cs_equation_add_source_term_by_val ( cs_equation_t *  eq,
const char *  st_name,
const char *  ml_name,
const void *  val 
)

Define a new source term structure and initialize it by value.

Define and initialize by value a new structure to store parameters related to a source term defined by a user.

Parameters
[in,out]eqpointer to a cs_equation_t structure
[in]st_namename of the source term or NULL
[in]ml_namename of the related mesh location or NULL
[in]valpointer to the value
Returns
a pointer to the new cs_source_term_t structure

◆ cs_equation_build_system()

void cs_equation_build_system ( const cs_mesh_t mesh,
const cs_time_step_t time_step,
double  dt_cur,
cs_equation_t *  eq 
)

Build the linear system for this equation.

Parameters
[in]mpointer to a cs_mesh_t structure
[in]time_steppointer to a time step structure
[in]dt_curvalue of the current time step
[in,out]eqpointer to a cs_equation_t structure

◆ cs_equation_compute_diff_flux_cellwise()

void cs_equation_compute_diff_flux_cellwise ( const cs_equation_t *  eq,
cs_flag_t  location,
cs_real_t diff_flux 
)

Cellwise computation of the diffusive flux across all cell faces. Primal or dual faces are considered according to the space scheme.

Parameters
[in]eqpointer to a cs_equation_t structure
[in]locationindicate where the flux has to be computed
[in,out]diff_fluxvalue of the diffusive flux

◆ cs_equation_compute_flux_across_plane()

void cs_equation_compute_flux_across_plane ( const cs_equation_t *  eq,
const char *  ml_name,
const cs_real_3_t  direction,
cs_real_t diff_flux,
cs_real_t conv_flux 
)

Compute the diffusive and convective flux accross a plane defined by a mesh location structure attached to the name ml_name.

Parameters
[in]eqpointer to a cs_equation_t structure
[in]ml_namename of the related mesh location
[in]directionvector indicating in which direction flux is > 0
[in,out]diff_fluxvalue of the diffusive part of the flux
[in,out]conv_fluxvalue of the convective part of the flux

◆ cs_equation_create()

cs_equation_t* cs_equation_create ( const char *  eqname,
const char *  varname,
cs_equation_type_t  eqtype,
cs_param_var_type_t  vartype,
cs_param_bc_type_t  default_bc 
)

Define and initialize a new structure to store parameters related to an equation.

Parameters
[in]eqnamename of the equation
[in]varnamename of the variable associated to this equation
[in]eqtypetype of equation (user, predefined...)
[in]vartypetype of variable (scalar, vector, tensor...)
[in]default_bctype of boundary condition set by default
Returns
a pointer to the new allocated cs_equation_t structure

◆ cs_equation_create_field()

void cs_equation_create_field ( cs_equation_t *  eq)

Create a field structure related to this cs_equation_t structure to an equation.

Parameters
[in,out]eqpointer to a cs_equation_t structure

◆ cs_equation_extra_post()

void cs_equation_extra_post ( const cs_equation_t *  eq,
const cs_time_step_t ts,
double  dt 
)

Predefined extra-operations related to this equation.

Parameters
[in]eqpointer to a cs_equation_t structure
[in]tspointer to a cs_time_step_t struct.
[in]dtvalue of the current time step

◆ cs_equation_free()

cs_equation_t* cs_equation_free ( cs_equation_t *  eq)

Destroy a cs_equation_t structure.

Parameters
[in,out]eqpointer to a cs_equation_t structure
Returns
a NULL pointer

◆ cs_equation_get_cell_values()

const cs_real_t* cs_equation_get_cell_values ( const cs_equation_t *  eq)

Get the values at each cell centers for the field unknowns related to this equation.

Parameters
[in]eqpointer to a cs_equation_t structure
Returns
a pointer to the cell values

◆ cs_equation_get_diffusion_property()

cs_property_t* cs_equation_get_diffusion_property ( const cs_equation_t *  eq)

Return a pointer to the cs_property_t structure associated to the diffusion term for this equation (NULL if not activated).

Return a pointer to the cs_property_t structure associated to the diffusion term for this equation.

Parameters
[in]eqpointer to a cs_equation_t structure
Returns
a pointer to a cs_property_t structure

◆ cs_equation_get_face_values()

const cs_real_t* cs_equation_get_face_values ( const cs_equation_t *  eq)

Get the values at each face of the mesh for the field unknowns related to this equation.

Parameters
[in]eqpointer to a cs_equation_t structure
Returns
a pointer to the face values

◆ cs_equation_get_field()

cs_field_t* cs_equation_get_field ( const cs_equation_t *  eq)

Return the field structure associated to a cs_equation_t structure.

Parameters
[in]eqpointer to a cs_equation_t structure
Returns
a cs_field_t structure or NULL if not found

◆ cs_equation_get_flag()

cs_flag_t cs_equation_get_flag ( const cs_equation_t *  eq)

Return the flag associated to an equation.

Parameters
[in]eqpointer to a cs_equation_t structure
Returns
a flag (cs_flag_t type)

◆ cs_equation_get_name()

const char* cs_equation_get_name ( const cs_equation_t *  eq)

Return the name related to the given cs_equation_t structure to an equation.

Parameters
[in]eqpointer to a cs_equation_t structure
Returns
a name or NULL if not found

◆ cs_equation_get_param()

const cs_equation_param_t* cs_equation_get_param ( const cs_equation_t *  eq)

Return the cs_equation_param_t structure associated to a cs_equation_t structure.

Parameters
[in]eqpointer to a cs_equation_t structure
Returns
a cs_equation_param_t structure or NULL if not found

◆ cs_equation_get_reaction_property()

cs_property_t* cs_equation_get_reaction_property ( const cs_equation_t *  eq,
const char *  r_name 
)

Return a pointer to the cs_property_t structure associated to the reaction term called r_name and related to this equation.

Parameters
[in]eqpointer to a cs_equation_t structure
Returns
a pointer to a cs_property_t structure or NULL if not found

◆ cs_equation_get_space_poly_degree()

int cs_equation_get_space_poly_degree ( const cs_equation_t *  eq)

Return the max. degree used in the polynomial basis for the space discretization.

Parameters
[in]eqpointer to a cs_equation_t structure
Returns
the polynomial order

◆ cs_equation_get_space_scheme()

cs_space_scheme_t cs_equation_get_space_scheme ( const cs_equation_t *  eq)

Return the type of numerical scheme used for the discretization in space.

Parameters
[in]eqpointer to a cs_equation_t structure
Returns
a cs_space_scheme_t variable

◆ cs_equation_get_time_property()

cs_property_t* cs_equation_get_time_property ( const cs_equation_t *  eq)

Return a pointer to the cs_property_t structure associated to the unsteady term for this equation (NULL if not activated).

Return a pointer to the cs_property_t structure associated to the unsteady term for this equation.

Parameters
[in]eqpointer to a cs_equation_t structure
Returns
a pointer to a cs_property_t structure

◆ cs_equation_get_type()

cs_equation_type_t cs_equation_get_type ( const cs_equation_t *  eq)

Return the type of equation for the given equation structure.

Parameters
[in]eqpointer to a cs_equation_t structure
Returns
the type of the given equation

◆ cs_equation_get_var_type()

cs_param_var_type_t cs_equation_get_var_type ( const cs_equation_t *  eq)

Return the type of variable solved by this equation.

Parameters
[in]eqpointer to a cs_equation_t structure
Returns
the type of variable (sclar, vector...) associated to this equation

◆ cs_equation_init_system()

void cs_equation_init_system ( const cs_mesh_t mesh,
cs_equation_t *  eq 
)

Initialize the values of a field according to the initial condition related to its equation.

Parameters
[in]meshpointer to the mesh structure
[in,out]eqpointer to a cs_equation_t structure

◆ cs_equation_is_steady()

bool cs_equation_is_steady ( const cs_equation_t *  eq)

Return true is the given equation is steady otherwise false.

Parameters
[in]eqpointer to a cs_equation_t structure
Returns
true or false

◆ cs_equation_last_setup()

void cs_equation_last_setup ( const cs_cdo_connect_t connect,
cs_equation_t *  eq 
)

Assign a set of pointer functions for managing the cs_equation_t structure during the computation.

Parameters
[in]connectpointer to a cs_cdo_connect_t structure
[in,out]eqpointer to a cs_equation_t structure

◆ cs_equation_link()

void cs_equation_link ( cs_equation_t *  eq,
const char *  keyword,
void *  pointer 
)

Associate a material property or an advection field with an equation for a given term (diffusion, time, convection)

Parameters
[in,out]eqpointer to a cs_equation_t structure
[in]keyword"time", "diffusion", "advection"
[in]pointerpointer to a given structure

◆ cs_equation_needs_build()

bool cs_equation_needs_build ( const cs_equation_t *  eq)

Check if one has to build the linear system.

Parameters
[in]eqpointer to a cs_equation_t structure
Returns
true or false

◆ cs_equation_print_monitoring()

void cs_equation_print_monitoring ( const cs_equation_t *  eq)

Print a synthesis of the monitoring information in the performance file.

Parameters
[in]eqpointer to a cs_equation_t structure

◆ cs_equation_set_ic_by_analytic()

void cs_equation_set_ic_by_analytic ( cs_equation_t *  eq,
const char *  ml_name,
cs_analytic_func_t analytic 
)

Define the initial condition for the unknown related to this equation This definition can be done on a specified mesh location. By default, the unknown is set to zero everywhere. Here the initial value is set according to an analytical function.

Parameters
[in,out]eqpointer to a cs_equation_t structure
[in]ml_namename of the associated mesh location (if NULL or "" all cells are considered)
[in]analyticpointer to an analytic function

◆ cs_equation_set_ic_by_qov()

void cs_equation_set_ic_by_qov ( cs_equation_t *  eq,
const char *  ml_name,
double  quantity 
)

Define the initial condition for the unknown related to this equation This definition can be done on a specified mesh location. By default, the unknown is set to zero everywhere. Here the value related to all the entities belonging to the given mesh location is such that the integral over these cells returns the requested quantity.

Parameters
[in,out]eqpointer to a cs_equation_t structure
[in]ml_namename of the associated mesh location (if NULL or "" all cells are considered)
[in]quantityquantity to distribute over the mesh location

◆ cs_equation_set_ic_by_value()

void cs_equation_set_ic_by_value ( cs_equation_t *  eq,
const char *  ml_name,
cs_get_t  get 
)

Define the initial condition for the unknown related to this equation This definition can be done on a specified mesh location. By default, the unknown is set to zero everywhere. Here a constant value is set to all the entities belonging to the given mesh location.

Parameters
[in,out]eqpointer to a cs_equation_t structure
[in]ml_namename of the associated mesh location (if NULL or "" all cells are considered)
[in]valpointer to the value

◆ cs_equation_set_param()

void cs_equation_set_param ( cs_equation_t *  eq,
cs_equation_key_t  key,
const char *  keyval 
)

Set a parameter in a cs_equation_t structure attached to keyname.

Parameters
[in,out]eqpointer to a cs_equation_t structure
[in]keykey related to the member of eq to set
[in]keyvalaccessor to the value to set

◆ cs_equation_set_timer_stats()

void cs_equation_set_timer_stats ( cs_equation_t *  eq)

Create timer statistics structures to enable a "home-made" profiling.

Parameters
[in,out]eqpointer to a cs_equation_t structure

◆ cs_equation_solve()

void cs_equation_solve ( cs_equation_t *  eq)

Solve the linear system for this equation.

Parameters
[in,out]eqpointer to a cs_equation_t structure

◆ cs_equation_summary()

void cs_equation_summary ( const cs_equation_t *  eq)

Summary of a cs_equation_t structure.

Parameters
[in]eqpointer to a cs_equation_t structure

Variable Documentation

◆ _err_empty_eq

const char _err_empty_eq[]
static
Initial value:
=
N_(" Stop setting an empty cs_equation_t structure.\n"
" Please check your settings.\n")
#define N_(String)
Definition: cs_defs.h:56