8.1
general documentation
cs_equation_system.h File Reference
+ Include dependency graph for cs_equation_system.h:

Go to the source code of this file.

Data Structures

struct  cs_equation_system_t
 Main structure to handle a set of coupled equations. More...
 

Typedefs

typedef void *() cs_equation_system_define_t(int n_eqs, const cs_equation_system_param_t *sysp, cs_equation_core_t **core_array, cs_cdo_system_helper_t **p_sh)
 Create and initialize equation builders and scheme context for each equation which are in the extra-diagonal blocks related to a system of equations. Structures associated to diagonal blocks should be already initialized during the treatment of the classical equations. More...
 
typedef void *() cs_equation_system_free_t(int n_eqs, cs_equation_core_t **core_array, void *sys_context)
 Free an array of structures (equation parameters, equation builders or scheme context) for each equation which are in the extra-diagonal blocks related to a system of equations. Structures associated to diagonal blocks are freed during the treatment of the classical full equations. More...
 
typedef void() cs_equation_system_solve_t(bool c2p, int n_eqs, cs_equation_system_param_t *sysp, cs_equation_core_t **blocks, void *sys_context, cs_cdo_system_helper_t *sh)
 Build and solve a linear system within the CDO framework. More...
 

Functions

int cs_equation_system_get_n_systems (void)
 Get the number of systems of equations. More...
 
cs_equation_system_tcs_equation_system_by_id (int sys_id)
 Retrieve the pointer to the equation system related to the given id. More...
 
cs_equation_system_param_tcs_equation_system_param_by_id (int sys_id)
 Retrieve the pointer to the set of parameters of a system of equations related to the given id. More...
 
cs_equation_system_tcs_equation_system_add (const char *sysname, int n_eqs, int block_var_dim)
 Add a new structure to handle system of coupled equations. More...
 
void cs_equation_system_destroy_all (void)
 Destroy all cs_equation_system_t structures. More...
 
void cs_equation_system_log_setup (void)
 Log the setup for all structures managing systems of equations. More...
 
void cs_equation_system_log_monitoring (void)
 Print a synthesis of the monitoring information in the performance file. More...
 
void cs_equation_system_init_sharing (const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *time_step)
 Assign a set of shared pointer to the main structures. More...
 
void cs_equation_system_set_functions (void)
 Assign a set of pointer functions for managing all the systems of equations. More...
 
void cs_equation_system_set_sles (void)
 Set the SLES associated to each system of equations. More...
 
void cs_equation_system_define (void)
 Define the builder and scheme context structures associated to all the systems of equations which have been added. For the diagonal blocks, one relies on the builder and context of the related equations. For extra-diagonal blocks, one defines new builder and context structures. More...
 
void cs_equation_system_solve (bool cur2prev, cs_equation_system_t *eqsys)
 Solve of a system of coupled equations. Unsteady case. More...
 
void cs_equation_system_assign_equation (int row_id, cs_equation_t *eq, cs_equation_system_t *eqsys)
 Assign the given equation to the diagonal block located at position (row_id, row_id) in the matrix of blocks. More...
 
void cs_equation_system_assign_param (int row_id, int col_id, cs_equation_param_t *eqp, cs_equation_system_t *eqsys)
 Assign the given equation parameters to the block with ids (row_id, col_id) in the block matrix. More...
 

Typedef Documentation

◆ cs_equation_system_define_t

typedef void*() cs_equation_system_define_t(int n_eqs, const cs_equation_system_param_t *sysp, cs_equation_core_t **core_array, cs_cdo_system_helper_t **p_sh)

Create and initialize equation builders and scheme context for each equation which are in the extra-diagonal blocks related to a system of equations. Structures associated to diagonal blocks should be already initialized during the treatment of the classical equations.

Generic prototype to define the function pointer.

Parameters
[in]n_eqsnumber of equations
[in]syspset of parameters to specify a system of eqs
[in,out]core_arrayarray of the core structures for an equation
[out]p_shdouble pointer to a system helper to define
Returns
a pointer to a new allocated system context structure

◆ cs_equation_system_free_t

typedef void*() cs_equation_system_free_t(int n_eqs, cs_equation_core_t **core_array, void *sys_context)

Free an array of structures (equation parameters, equation builders or scheme context) for each equation which are in the extra-diagonal blocks related to a system of equations. Structures associated to diagonal blocks are freed during the treatment of the classical full equations.

Generic prototype to define the function pointer.

Parameters
[in]n_eqsnumber of equations
[in,out]core_arrayarray of the core structures for an equation
[in,out]sys_contextpointer to a context structure cast on-the-fly
Returns
a NULL pointer

◆ cs_equation_system_solve_t

typedef void() cs_equation_system_solve_t(bool c2p, int n_eqs, cs_equation_system_param_t *sysp, cs_equation_core_t **blocks, void *sys_context, cs_cdo_system_helper_t *sh)

Build and solve a linear system within the CDO framework.

Parameters
[in]c2pdo a "current to previous" operation performed ?
[in]n_eqsnumber of equations in the system to solve
[in]syspset of paremeters for the system of equations
[in,out]blocksarray of the core members for an equation
[in,out]sys_contextpointer to a sructure cast on-the-fly ?
[in,out]shpointer to a system helper structure

Function Documentation

◆ cs_equation_system_add()

cs_equation_system_t* cs_equation_system_add ( const char *  sysname,
int  n_eqs,
int  block_var_dim 
)

Add a new structure to handle system of coupled equations.

Parameters
[in]sysnamename of the system of equations
[in]n_eqsnumber of coupled equations composing the system
[in]block_var_dimdimension of the variable in each block
Returns
a pointer to the new allocated cs_equation_system_t structure

◆ cs_equation_system_assign_equation()

void cs_equation_system_assign_equation ( int  row_id,
cs_equation_t eq,
cs_equation_system_t eqsys 
)

Assign the given equation to the diagonal block located at position (row_id, row_id) in the matrix of blocks.

Parameters
[in]row_idposition in the block matrix
[in]eqpointer to the equation to add
[in,out]eqsyspointer to a cs_equation_system_t to update

◆ cs_equation_system_assign_param()

void cs_equation_system_assign_param ( int  row_id,
int  col_id,
cs_equation_param_t eqp,
cs_equation_system_t eqsys 
)

Assign the given equation parameters to the block with ids (row_id, col_id) in the block matrix.

Parameters
[in]row_idrow position id
[in]col_idcolumn position id
[in]eqppointer to the equation parameter to add
[in,out]eqsyspointer to a cs_equation_system_t to update

◆ cs_equation_system_by_id()

cs_equation_system_t* cs_equation_system_by_id ( int  sys_id)

Retrieve the pointer to the equation system related to the given id.

Parameters
[in]sys_idid the system of equations
Returns
a pointer to a cs_equation_system_t structure

◆ cs_equation_system_define()

void cs_equation_system_define ( void  )

Define the builder and scheme context structures associated to all the systems of equations which have been added. For the diagonal blocks, one relies on the builder and context of the related equations. For extra-diagonal blocks, one defines new builder and context structures.

◆ cs_equation_system_destroy_all()

void cs_equation_system_destroy_all ( void  )

Destroy all cs_equation_system_t structures.

Destroy all cs_equation_system_t structures.

◆ cs_equation_system_get_n_systems()

int cs_equation_system_get_n_systems ( void  )

Get the number of systems of equations.

Returns
the number of systems

◆ cs_equation_system_init_sharing()

void cs_equation_system_init_sharing ( const cs_mesh_t mesh,
const cs_cdo_connect_t connect,
const cs_cdo_quantities_t quant,
const cs_time_step_t time_step 
)

Assign a set of shared pointer to the main structures.

Parameters
[in]meshbasic mesh structure
[in]connectadditional connectivity data
[in]quantadditional mesh quantities
[in]time_steppointer to a time step structure

◆ cs_equation_system_log_monitoring()

void cs_equation_system_log_monitoring ( void  )

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

◆ cs_equation_system_log_setup()

void cs_equation_system_log_setup ( void  )

Log the setup for all structures managing systems of equations.

◆ cs_equation_system_param_by_id()

cs_equation_system_param_t* cs_equation_system_param_by_id ( int  sys_id)

Retrieve the pointer to the set of parameters of a system of equations related to the given id.

Parameters
[in]sys_idid the system of equations
Returns
a pointer to a cs_equation_system_param_t structure

◆ cs_equation_system_set_functions()

void cs_equation_system_set_functions ( void  )

Assign a set of pointer functions for managing all the systems of equations.

◆ cs_equation_system_set_sles()

void cs_equation_system_set_sles ( void  )

Set the SLES associated to each system of equations.

◆ cs_equation_system_solve()

void cs_equation_system_solve ( bool  cur2prev,
cs_equation_system_t eqsys 
)

Solve of a system of coupled equations. Unsteady case.

Parameters
[in]cur2prevtrue="current to previous" operation is performed
[in,out]eqsyspointer to the structure to solve