#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"
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_mesh_t *mesh, 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 (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_t * | cs_cdocb_scaleq_get_cell_values (void *context, bool previous) |
Retrieve an array of values at mesh cellss 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... | |
cs_real_t * | cs_cdocb_scaleq_get_face_values (void *context, bool previous) |
Retrieve an array of values at mesh faces 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_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. 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... | |
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.
[in] | eqp | pointer to a cs_equation_param_t structure |
[in,out] | eqb | pointer to a cs_equation_builder_t structure |
[in,out] | context | pointer to a scheme builder structure |
Compute the balance for an equation over the full computational domain Case of scalar-valued CDO cell-based scheme.
[in] | eqp | pointer to a cs_equation_param_t structure |
[in,out] | eqb | pointer to a cs_equation_builder_t structure |
[in,out] | context | pointer to a scheme builder structure |
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.
[in] | eqp | pointer to a cs_equation_param_t structure |
[in,out] | eqb | pointer to a cs_equation_builder_t structure |
[in,out] | context | pointer to a scheme context structure |
Copy current content of the related variables-fields to previous values Case of the monolithic coupling algorithm.
[in] | eqp | pointer to a cs_equation_param_t structure |
[in,out] | eqb | pointer to a cs_equation_builder_t structure |
[in,out] | context | pointer to a scheme context structure |
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.
[in] | values | discrete values for the potential |
[in] | eqp | pointer to a cs_equation_param_t structure |
[in] | t_eval | time at which one performs the evaluation |
[in,out] | eqb | pointer to a cs_equation_builder_t structure |
[in,out] | context | pointer to cs_cdovb_scaleq_t structure |
[in,out] | diff_flux | values of the diffusive flux |
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.
[in] | eqp | pointer to a cs_equation_param_t structure |
[in] | eqb | pointer to a cs_equation_builder_t structure |
[in] | eqc | context for this kind of discretization |
[in] | cm | pointer to a cellwise view of the mesh |
[in,out] | diff_hodge | pointer to a cs_hodge_t structure for diffusion |
[in,out] | csys | pointer to a cellwise view of the system |
[in,out] | cb | pointer to a cellwise builder |
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.
[in] | eqp | pointer to a cs_equation_param_t structure |
[in,out] | eqb | pointer to a cs_equation_builder_t structure |
[in,out] | context | pointer to cs_cdocb_scaleq_t structure |
void cs_cdocb_scaleq_finalize_sharing | ( | void | ) |
Free shared pointers with lifecycle dedicated to this file.
void * cs_cdocb_scaleq_free_context | ( | void * | scheme_context | ) |
Destroy a cs_cdocb_scaleq_t structure.
[in,out] | scheme_context | pointer to a scheme context to free |
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.
[out] | csys | pointer to a pointer on a cs_cell_sys_t structure |
[out] | cb | pointer to a pointer on a cs_cell_builder_t structure |
cs_real_t * cs_cdocb_scaleq_get_cell_values | ( | void * | context, |
bool | previous | ||
) |
Retrieve an array of values at mesh cellss 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.
[in,out] | context | pointer to a data structure cast on-the-fly |
[in] | previous | retrieve the previous state (true/false) |
Retrieve an array of values at mesh cellss 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.
[in,out] | context | pointer to a data structure cast on-the-fly |
[in] | previous | retrieve the previous state (true/false) |
cs_real_t * cs_cdocb_scaleq_get_face_values | ( | void * | context, |
bool | previous | ||
) |
Retrieve an array of values at mesh faces 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.
[in,out] | context | pointer to a data structure cast on-the-fly |
[in] | previous | retrieve the previous state (true/false) |
Retrieve an array of values at mesh faces 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.
[in,out] | context | pointer to a data structure cast on-the-fly |
[in] | previous | retrieve the previous state (true/false) |
void * cs_cdocb_scaleq_init_context | ( | 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.
[in,out] | eqp | set of parameters related an equation |
[in] | var_id | id of the variable field |
[in] | bflux_id | id of the boundary flux field |
[in,out] | eqb | pointer to a cs_equation_builder_t struct. |
void cs_cdocb_scaleq_init_sharing | ( | const cs_mesh_t * | mesh, |
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.
[in] | mesh | pointer to the mesh structure |
[in] | cdoq | additional CDO mesh quantities |
[in] | connect | pointer to a cs_cdo_connect_t struct. |
[in] | time_step | pointer to a cs_time_step_t structure |
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.
[in] | t_eval | time at which one evaluates BCs |
[in] | field_id | id related to the variable field of this equation |
[in] | mesh | pointer to a cs_mesh_t structure |
[in] | eqp | pointer to a cs_equation_param_t structure |
[in,out] | eqb | pointer to a cs_equation_builder_t structure |
[in,out] | context | pointer to the scheme context (cast on-the-fly) |
bool cs_cdocb_scaleq_is_initialized | ( | void | ) |
Check if the generic structures for building a CDO-Cb scheme are allocated.
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.
[in] | t_eval | time at which one evaluates BCs |
[in] | mesh | pointer to a cs_mesh_t structure |
[in] | eqp | pointer to a cs_equation_param_t structure |
[in,out] | eqb | pointer to a cs_equation_builder_t structure |
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.
[in] | cur2prev | true="current to previous" operation is performed |
[in] | mesh | pointer to a cs_mesh_t structure |
[in] | field_id | id of the variable field related to this equation |
[in] | eqp | pointer to a cs_equation_param_t structure |
[in,out] | eqb | pointer to a cs_equation_builder_t structure |
[in,out] | context | pointer to cs_cdocb_scaleq_t structure |