programmer's documentation
Enumerations | Functions
cs_source_term.h File Reference
#include "cs_base.h"
#include "cs_cdo.h"
#include "cs_cdo_quantities.h"
#include "cs_param.h"
#include "cs_quadrature.h"
#include "cs_time_step.h"
Include dependency graph for cs_source_term.h:

Go to the source code of this file.

Enumerations

enum  cs_source_term_type_t {
  CS_SOURCE_TERM_GRAVITY, CS_SOURCE_TERM_HEADLOSS, CS_SOURCE_TERM_MASS, CS_SOURCE_TERM_USER,
  CS_N_SOURCE_TERM_TYPES
}
 
enum  cs_source_term_reduction_t { CS_SOURCE_TERM_REDUC_DUAL, CS_SOURCE_TERM_REDUC_PRIM, CS_N_SOURCE_TERM_REDUCTIONS }
 

Functions

void cs_source_term_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_source_term_t * cs_source_term_create (const char *name, int ml_id, cs_source_term_type_t st_type, cs_source_term_reduction_t red_type, cs_param_var_type_t var_type)
 Create and initialize a cs_source_term_t structure. More...
 
cs_source_term_t * cs_source_term_free (cs_source_term_t *st)
 Destroy a cs_source_term_t structure. More...
 
void cs_source_term_set_quadrature (cs_source_term_t *st, cs_quadra_type_t quad_type)
 Set the type of quadrature to use for computing the source term. More...
 
void cs_source_term_set_reduction (cs_source_term_t *st, cs_source_term_reduction_t red_type)
 Set where the reduction has to be applied forn defining source term. More...
 
const char * cs_source_term_get_name (const cs_source_term_t *st)
 Get the name related to a cs_source_term_t structure. More...
 
cs_source_term_reduction_t cs_source_term_get_reduction (const cs_source_term_t *st)
 Get the type of reduction applied to a cs_source_term_t structure. More...
 
void cs_source_term_summary (const char *eqname, const cs_source_term_t *st)
 Summarize the content of a cs_source_term_t structure. More...
 
void cs_source_term_def_by_value (cs_source_term_t *st, const char *val)
 Generic way to define the value of a cs_source_term_t structure. More...
 
void cs_source_term_def_by_analytic (cs_source_term_t *st, cs_analytic_func_t *func)
 Define a cs_source_term_t structure thanks to an analytic function. More...
 
void cs_source_term_def_by_array (cs_source_term_t *st, cs_desc_t desc, cs_real_t *array)
 Define a cs_source_term_t structure thanks to an array of values. More...
 
void cs_source_term_compute (cs_desc_t dof_desc, const cs_source_term_t *source, double *p_values[])
 Compute the contribution related to a source term. More...
 

Enumeration Type Documentation

◆ cs_source_term_reduction_t

Enumerator
CS_SOURCE_TERM_REDUC_DUAL 
CS_SOURCE_TERM_REDUC_PRIM 
CS_N_SOURCE_TERM_REDUCTIONS 

◆ cs_source_term_type_t

Enumerator
CS_SOURCE_TERM_GRAVITY 
CS_SOURCE_TERM_HEADLOSS 
CS_SOURCE_TERM_MASS 
CS_SOURCE_TERM_USER 
CS_N_SOURCE_TERM_TYPES 

Function Documentation

◆ cs_source_term_compute()

void cs_source_term_compute ( cs_desc_t  dof_desc,
const cs_source_term_t *  source,
double *  p_values[] 
)

Compute the contribution related to a source term.

Parameters
[in]dof_descdescription of the associated DoF
[in]sourcepointer to a cs_source_term_t structure
[in,out]p_valuespointer to the computed values (allocated if NULL)

◆ cs_source_term_create()

cs_source_term_t* cs_source_term_create ( const char *  name,
int  ml_id,
cs_source_term_type_t  st_type,
cs_source_term_reduction_t  red_type,
cs_param_var_type_t  var_type 
)

Create and initialize a cs_source_term_t structure.

Parameters
[in]st_namename of the related source term
[in]ml_idid of the related mesh location
[in]st_typetype of source term to create
[in]red_typetype of reduction to apply
[in]var_typetype of variables (scalar, vector, tensor...)
Returns
a pointer to a new allocated source term structure

◆ cs_source_term_def_by_analytic()

void cs_source_term_def_by_analytic ( cs_source_term_t *  st,
cs_analytic_func_t func 
)

Define a cs_source_term_t structure thanks to an analytic function.

Parameters
[in,out]stpointer to a cs_source_term_t structure
[in]funcpointer to a function

◆ cs_source_term_def_by_array()

void cs_source_term_def_by_array ( cs_source_term_t *  st,
cs_desc_t  desc,
cs_real_t array 
)

Define a cs_source_term_t structure thanks to an array of values.

Parameters
[in,out]stpointer to a cs_source_term_t structure
[in]descdescription of the main feature of this array
[in]arraypointer to an array

◆ cs_source_term_def_by_value()

void cs_source_term_def_by_value ( cs_source_term_t *  st,
const char *  val 
)

Generic way to define the value of a cs_source_term_t structure.

Parameters
[in,out]ptypointer to a cs_source_term_t structure
[in]valaccessor to the value to set

◆ cs_source_term_free()

cs_source_term_t* cs_source_term_free ( cs_source_term_t *  st)

Destroy a cs_source_term_t structure.

Parameters
[in]stpointer to a cs_source_term_t structure
Returns
NULL pointer

◆ cs_source_term_get_name()

const char* cs_source_term_get_name ( const cs_source_term_t *  st)

Get the name related to a cs_source_term_t structure.

Parameters
[in]stpointer to a cs_source_term_t structure
Returns
the name of the source term

◆ cs_source_term_get_reduction()

cs_source_term_reduction_t cs_source_term_get_reduction ( const cs_source_term_t *  st)

Get the type of reduction applied to a cs_source_term_t structure.

Parameters
[in]stpointer to a cs_source_term_t structure
Returns
the type of reduction

◆ cs_source_term_set_quadrature()

void cs_source_term_set_quadrature ( cs_source_term_t *  st,
cs_quadra_type_t  quad_type 
)

Set the type of quadrature to use for computing the source term.

Parameters
[in,out]stpointer to a cs_source_term_t structure
[in]quad_typetype of quadrature to use

Set the type of quadrature to use for computing the source term.

Parameters
[in,out]stpointer to a cs_source_term_t structure
[in]quad_typetype of quadrature to use

◆ cs_source_term_set_reduction()

void cs_source_term_set_reduction ( cs_source_term_t *  st,
cs_source_term_reduction_t  red_type 
)

Set where the reduction has to be applied forn defining source term.

Parameters
[in,out]stpointer to a cs_source_term_t structure
[in]red_typetype of reduction to apply

Set where the reduction has to be applied forn defining source term.

Parameters
[in,out]stpointer to a cs_source_term_t structure
[in]red_typetype of reduction to apply

◆ cs_source_term_set_shared_pointers()

void cs_source_term_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_source_term_summary()

void cs_source_term_summary ( const char *  eqname,
const cs_source_term_t *  st 
)

Summarize the content of a cs_source_term_t structure.

Parameters
[in]eqnamename of the related equation
[in]stpointer to a cs_source_term_t structure