8.1
general documentation
cs_cdocb_scaleq.h File Reference
#include "cs_defs.h"
#include "cs_base.h"
#include "cs_cdo_connect.h"
#include "cs_cdocb_priv.h"
#include "cs_cdo_quantities.h"
#include "cs_equation.h"
#include "cs_mesh.h"
#include "cs_time_step.h"
#include "cs_domain.h"
+ Include dependency graph for cs_cdocb_scaleq.h:

Go to the source code of this file.

Functions

bool cs_cdocb_scaleq_is_initialized (void)
 Check if the generic structures for building a CDO-Cb scheme are allocated. More...
 
void cs_cdocb_scaleq_get (cs_cell_sys_t **csys, cs_cell_builder_t **cb)
 Retrieve work buffers used for building a CDO system cellwise. More...
 
void cs_cdocb_scaleq_init_sharing (const cs_cdo_quantities_t *cdoq, const cs_cdo_connect_t *connect, const cs_time_step_t *time_step)
 Set shared pointers from the main domain members. More...
 
void cs_cdocb_scaleq_finalize_sharing (void)
 Free shared pointers with lifecycle dedicated to this file. More...
 
void * cs_cdocb_scaleq_init_context (const cs_equation_param_t *eqp, int var_id, int bflux_id, cs_equation_builder_t *eqb)
 Initialize a cs_cdocb_scaleq_t structure storing data useful for building and managing such a scheme. More...
 
void * cs_cdocb_scaleq_free_context (void *scheme_context)
 Destroy a cs_cdocb_scaleq_t structure. More...
 
void cs_cdocb_scaleq_setup (cs_real_t t_eval, const cs_mesh_t *mesh, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb)
 Set the boundary conditions known from the settings Define an indirection array for the enforcement of internal DoFs only if needed. Case of scalar-valued CDO-Cb schemes. More...
 
void cs_cdocb_scaleq_init_values (cs_real_t t_eval, const int field_id, const cs_mesh_t *mesh, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context)
 Set the initial values of the variable field taking into account the boundary conditions. Case of scalar-valued CDO-Cb schemes. More...
 
void cs_cdocb_scaleq_diffusion (const cs_equation_param_t *eqp, const cs_equation_builder_t *eqb, const cs_cdocb_scaleq_t *eqc, const cs_cell_mesh_t *cm, cs_hodge_t *diff_hodge, cs_cell_sys_t *csys, cs_cell_builder_t *cb)
 Build the local matrices arising from the diffusion term in the scalar-valued CDO-Cb schemes. More...
 
void cs_cdocb_scaleq_solve_steady_state (bool cur2prev, const cs_mesh_t *mesh, const int field_id, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context)
 Solve the steady-state equation with a CDO cell-based scheme Scalar-valued diffusion equation up-to-now One works cellwise and then process to the assembly. More...
 
void cs_cdocb_scaleq_current_to_previous (const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context)
 Copy current content of the related variables-fields to previous values Case of the monolithic coupling algorithm. More...
 
cs_real_tcs_cdocb_scaleq_get_cell_values (void *context, bool previous)
 Retrieve an array of values at mesh vertices for the variable field associated to the given context The lifecycle of this array is managed by the code. So one does not have to free the return pointer. More...
 
void cs_cdocb_scaleq_diff_flux_faces (const cs_real_t *values, const cs_equation_param_t *eqp, cs_real_t t_eval, cs_equation_builder_t *eqb, void *context, cs_real_t *diff_flux)
 Cellwise computation of the diffusive flux accross (primal) faces A scalar-valued flux for each face. Case of scalar-valued CDO-Cb schemes. More...
 
cs_cdo_balance_tcs_cdocb_scaleq_balance (const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context)
 Compute the balance for an equation over the full computational domain Case of scalar-valued CDO cell-based scheme. More...
 
void cs_cdocb_scaleq_extra_post (const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context)
 Predefined extra-operations related to this equation. More...
 

Function Documentation

◆ cs_cdocb_scaleq_balance()

cs_cdo_balance_t* cs_cdocb_scaleq_balance ( const cs_equation_param_t eqp,
cs_equation_builder_t eqb,
void *  context 
)

Compute the balance for an equation over the full computational domain Case of scalar-valued CDO cell-based scheme.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in,out]eqbpointer to a cs_equation_builder_t structure
[in,out]contextpointer to a scheme builder structure
Returns
a pointer to a cs_cdo_balance_t structure

Compute the balance for an equation over the full computational domain Case of scalar-valued CDO cell-based scheme.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in,out]eqbpointer to a cs_equation_builder_t structure
[in,out]contextpointer to a scheme builder structure
Returns
a pointer to a cs_cdo_balance_t structure

◆ cs_cdocb_scaleq_current_to_previous()

void cs_cdocb_scaleq_current_to_previous ( const cs_equation_param_t eqp,
cs_equation_builder_t eqb,
void *  context 
)

Copy current content of the related variables-fields to previous values Case of the monolithic coupling algorithm.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in,out]eqbpointer to a cs_equation_builder_t structure
[in,out]contextpointer to a scheme context structure

Copy current content of the related variables-fields to previous values Case of the monolithic coupling algorithm.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in,out]eqbpointer to a cs_equation_builder_t structure
[in,out]contextpointer to a scheme context structure

◆ cs_cdocb_scaleq_diff_flux_faces()

void cs_cdocb_scaleq_diff_flux_faces ( const cs_real_t values,
const cs_equation_param_t eqp,
cs_real_t  t_eval,
cs_equation_builder_t eqb,
void *  context,
cs_real_t diff_flux 
)

Cellwise computation of the diffusive flux accross (primal) faces A scalar-valued flux for each face. Case of scalar-valued CDO-Cb schemes.

Parameters
[in]valuesdiscrete values for the potential
[in]eqppointer to a cs_equation_param_t structure
[in]t_evaltime at which one performs the evaluation
[in,out]eqbpointer to a cs_equation_builder_t structure
[in,out]contextpointer to cs_cdovb_scaleq_t structure
[in,out]diff_fluxvalues of the diffusive flux

◆ cs_cdocb_scaleq_diffusion()

void cs_cdocb_scaleq_diffusion ( const cs_equation_param_t eqp,
const cs_equation_builder_t eqb,
const cs_cdocb_scaleq_t *  eqc,
const cs_cell_mesh_t cm,
cs_hodge_t diff_hodge,
cs_cell_sys_t csys,
cs_cell_builder_t cb 
)

Build the local matrices arising from the diffusion term in the scalar-valued CDO-Cb schemes.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in]eqbpointer to a cs_equation_builder_t structure
[in]eqccontext for this kind of discretization
[in]cmpointer to a cellwise view of the mesh
[in,out]diff_hodgepointer to a cs_hodge_t structure for diffusion
[in,out]csyspointer to a cellwise view of the system
[in,out]cbpointer to a cellwise builder

◆ cs_cdocb_scaleq_extra_post()

void cs_cdocb_scaleq_extra_post ( const cs_equation_param_t eqp,
cs_equation_builder_t eqb,
void *  context 
)

Predefined extra-operations related to this equation.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in,out]eqbpointer to a cs_equation_builder_t structure
[in,out]contextpointer to cs_cdocb_scaleq_t structure

◆ cs_cdocb_scaleq_finalize_sharing()

void cs_cdocb_scaleq_finalize_sharing ( void  )

Free shared pointers with lifecycle dedicated to this file.

◆ cs_cdocb_scaleq_free_context()

void* cs_cdocb_scaleq_free_context ( void *  scheme_context)

Destroy a cs_cdocb_scaleq_t structure.

Parameters
[in,out]scheme_contextpointer to a scheme context to free
Returns
a NULL pointer

◆ cs_cdocb_scaleq_get()

void cs_cdocb_scaleq_get ( cs_cell_sys_t **  csys,
cs_cell_builder_t **  cb 
)

Retrieve work buffers used for building a CDO system cellwise.

Parameters
[out]csyspointer to a pointer on a cs_cell_sys_t structure
[out]cbpointer to a pointer on a cs_cell_builder_t structure

◆ cs_cdocb_scaleq_get_cell_values()

cs_real_t* cs_cdocb_scaleq_get_cell_values ( void *  context,
bool  previous 
)

Retrieve an array of values at mesh vertices for the variable field associated to the given context The lifecycle of this array is managed by the code. So one does not have to free the return pointer.

Parameters
[in,out]contextpointer to a data structure cast on-the-fly
[in]previousretrieve the previous state (true/false)
Returns
a pointer to an array of cs_real_t (size: n_cells)

◆ cs_cdocb_scaleq_init_context()

void* cs_cdocb_scaleq_init_context ( const cs_equation_param_t eqp,
int  var_id,
int  bflux_id,
cs_equation_builder_t eqb 
)

Initialize a cs_cdocb_scaleq_t structure storing data useful for building and managing such a scheme.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in]var_idid of the variable field
[in]bflux_idid of the boundary flux field
[in,out]eqbpointer to a cs_equation_builder_t struct.
Returns
a pointer to a new allocated cs_cdocb_scaleq_t structure

◆ cs_cdocb_scaleq_init_sharing()

void cs_cdocb_scaleq_init_sharing ( const cs_cdo_quantities_t cdoq,
const cs_cdo_connect_t connect,
const cs_time_step_t time_step 
)

Set shared pointers from the main domain members.

Parameters
[in]cdoqadditional CDO mesh quantities
[in]connectpointer to a cs_cdo_connect_t struct.
[in]time_steppointer to a cs_time_step_t structure

◆ cs_cdocb_scaleq_init_values()

void cs_cdocb_scaleq_init_values ( cs_real_t  t_eval,
const int  field_id,
const cs_mesh_t mesh,
const cs_equation_param_t eqp,
cs_equation_builder_t eqb,
void *  context 
)

Set the initial values of the variable field taking into account the boundary conditions. Case of scalar-valued CDO-Cb schemes.

Parameters
[in]t_evaltime at which one evaluates BCs
[in]field_idid related to the variable field of this equation
[in]meshpointer to a cs_mesh_t structure
[in]eqppointer to a cs_equation_param_t structure
[in,out]eqbpointer to a cs_equation_builder_t structure
[in,out]contextpointer to the scheme context (cast on-the-fly)

◆ cs_cdocb_scaleq_is_initialized()

bool cs_cdocb_scaleq_is_initialized ( void  )

Check if the generic structures for building a CDO-Cb scheme are allocated.

Returns
true or false

◆ cs_cdocb_scaleq_setup()

void cs_cdocb_scaleq_setup ( cs_real_t  t_eval,
const cs_mesh_t mesh,
const cs_equation_param_t eqp,
cs_equation_builder_t eqb 
)

Set the boundary conditions known from the settings Define an indirection array for the enforcement of internal DoFs only if needed. Case of scalar-valued CDO-Cb schemes.

Parameters
[in]t_evaltime at which one evaluates BCs
[in]meshpointer to a cs_mesh_t structure
[in]eqppointer to a cs_equation_param_t structure
[in,out]eqbpointer to a cs_equation_builder_t structure

◆ cs_cdocb_scaleq_solve_steady_state()

void cs_cdocb_scaleq_solve_steady_state ( bool  cur2prev,
const cs_mesh_t mesh,
const int  field_id,
const cs_equation_param_t eqp,
cs_equation_builder_t eqb,
void *  context 
)

Solve the steady-state equation with a CDO cell-based scheme Scalar-valued diffusion equation up-to-now One works cellwise and then process to the assembly.

Parameters
[in]cur2prevtrue="current to previous" operation is performed
[in]meshpointer to a cs_mesh_t structure
[in]field_idid of the variable field related to this equation
[in]eqppointer to a cs_equation_param_t structure
[in,out]eqbpointer to a cs_equation_builder_t structure
[in,out]contextpointer to cs_cdocb_scaleq_t structure