|
programmer's documentation
|
#include "cs_defs.h"#include <stdio.h>#include <stdlib.h>#include <math.h>#include <float.h>#include <assert.h>#include <string.h>#include <bft_mem.h>#include <bft_printf.h>#include "cs_log.h"#include "cs_search.h"#include "cs_post.h"#include "cs_quadrature.h"#include "cs_evaluate.h"#include "cs_cdo_bc.h"#include "cs_hodge.h"#include "cs_cdovb_advection.h"#include "cs_cdovb_diffusion.h"#include "cs_cdovb_scaleq.h"
Macros | |
| #define | CS_CDOVB_SCALEQ_DBG 0 |
Functions | |
| static void | _add_source_terms (cs_cdovb_scaleq_t *builder, cs_real_t full_rhs[]) |
| Compute the contribution of source terms to the rhs for this time step. More... | |
| static void | _build_hvpcd_conf (cs_cdovb_scaleq_t *builder) |
| Compute a discrete Hodge op. Vp–>Cd using conforming reco. op. More... | |
| static cs_sla_matrix_t * | _init_time_matrix (cs_cdovb_scaleq_t *builder) |
| Initialize the matrix related to the unsteady term. More... | |
| static void | _apply_time_scheme (const cs_real_t *field_val, const cs_sla_matrix_t *time_mat, double dt_cur, cs_cdovb_scaleq_t *builder, cs_real_t *rhs, cs_sla_matrix_t *sys_mat) |
| Apply the time discretization to all the terms of the equation excepted for the unsteady term and the source term. More... | |
| static void | _compute_dir_values (const cs_mesh_t *mesh, const cs_real_t *field_val, const cs_cdovb_scaleq_t *builder) |
| Compute the values of the Dirichlet BCs. More... | |
| static void | _add_advection_bc (cs_cdovb_scaleq_t *builder, cs_cdovb_adv_t *adv, cs_real_t *rhs, cs_sla_matrix_t *matrix) |
| Update the matrix of the linear system to take into account the boundary contribution of the convection term. More... | |
| static void | _weak_bc_enforcement (cs_cdovb_scaleq_t *builder, cs_cdovb_diff_t *diff_builder, cs_real_t full_rhs[], cs_sla_matrix_t *full_matrix) |
| Apply Dirichlet boundary conditions arising from the diffusion op. Only useful if boundary conditions are weakly imposed using a Nitsche technique. Right-hand side and the system matrix are updated. More... | |
| static void | _strong_bc_enforcement (cs_cdovb_scaleq_t *builder, cs_real_t **rhs, cs_sla_matrix_t **matrix) |
| Apply boundary conditions. Update right-hand side and the system matrix. More... | |
| static void | _enforce_bc (cs_cdovb_scaleq_t *builder, cs_real_t **rhs, cs_sla_matrix_t **matrix) |
| Modify the matrix of the linear system and its right hand side to take into account a strong enforcement or a large penalization of the boundary conditions. Nothing to do in case of weak enforcement. More... | |
| void | cs_cdovb_scaleq_init_buffer (const cs_cdo_connect_t *connect) |
| Allocate work buffer related to cdo vertex-based schemes. More... | |
| void | cs_cdovb_scaleq_free_buffer (void) |
| Free work buffer related to cdo vertex-based schemes. More... | |
| cs_real_t * | cs_cdovb_scaleq_get_tmpbuf (void) |
| Retrieve a pointer to a temporary buffer related to scalar equations discretized with CDO vertex-based schemes. More... | |
| void * | cs_cdovb_scaleq_init (const cs_equation_param_t *eqp, const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *time_step) |
| Initialize a cs_cdovb_scaleq_t structure. More... | |
| void * | cs_cdovb_scaleq_free (void *builder) |
| Destroy a cs_cdovb_scaleq_t structure. More... | |
| void | cs_cdovb_scaleq_compute_source (void *builder) |
| Compute the contributions of source terms (store inside builder) More... | |
| void | cs_cdovb_scaleq_build_system (const cs_mesh_t *mesh, const cs_real_t *field_val, double dt_cur, void *builder, cs_real_t **rhs, cs_sla_matrix_t **sla_mat) |
| Build the linear system arising from a scalar convection/diffusion equation with a CDO vertex-based scheme. One works cellwise and then process to the assembly. More... | |
| void | cs_cdovb_scaleq_update_field (const cs_real_t *solu, void *builder, cs_real_t *field_val) |
| Post-process the solution of a scalar convection/diffusion equation solved with a CDO vertex-based scheme. More... | |
| void | cs_cdovb_scaleq_post (const char *eqname, const cs_field_t *field, void *builder) |
| Post-processing related to this equation. More... | |
Variables | |
| static const cs_real_t | cs_weak_nitsche_pena_coef = 500 |
| static const cs_real_t | cs_weak_penalization_weight = 0.01 |
| static size_t | _vbscal_work_size = 0 |
| static cs_real_t * | _vbscal_work = NULL |
| #define CS_CDOVB_SCALEQ_DBG 0 |
|
static |
Update the matrix of the linear system to take into account the boundary contribution of the convection term.
| [in,out] | adv | pointer to an advection builder structure |
| [in,out] | rhs | pointer of pointer to the right-hand side |
| [in,out] | matrix | pointer to a matrix structure |
|
static |
Compute the contribution of source terms to the rhs for this time step.
| [in] | builder | pointer to a cs_cdovb_scaleq_t structure |
| [in,out] | full_rhs | right-hand side |
|
static |
Apply the time discretization to all the terms of the equation excepted for the unsteady term and the source term.
| [in] | field_val | pointer to the current value of the field |
| [in] | time_mat | pointer to a cs_sla_matrix_t structure |
| [in] | dt_cur | current value of the time step |
| [in,out] | builder | pointer to a cs_cdovb_scaleq_t structure |
| [in,out] | rhs | pointer to the right-hand side array |
| [in,out] | sys_mat | pointer to a cs_sla_matrix_t structure |
|
static |
Compute a discrete Hodge op. Vp–>Cd using conforming reco. op.
| [in,out] | builder | pointer to a cs_cdovb_scaleq_t structure |
|
static |
Compute the values of the Dirichlet BCs.
| [in] | mesh | pointer to a cs_mesh_t structure |
| [in] | field_val | pointer to the current value of the field |
| [in,out] | builder | pointer to a cs_cdovb_scaleq_t structure |
|
static |
Modify the matrix of the linear system and its right hand side to take into account a strong enforcement or a large penalization of the boundary conditions. Nothing to do in case of weak enforcement.
| [in,out] | builder | pointer to a cs_cdovb_scaleq_t structure |
| [in,out] | rhs | right-hand side |
| [in,out] | matrix | matrix of the linear system |
|
static |
Initialize the matrix related to the unsteady term.
| [in] | builder | pointer to a cs_cdovb_scaleq_t structure |
|
static |
Apply boundary conditions. Update right-hand side and the system matrix.
| [in,out] | builder | pointer to a cs_cdovb_scaleq_t structure |
| [in,out] | full_rhs | right-hand side |
| [in,out] | full_matrix | matrix of the linear system |
|
static |
Apply Dirichlet boundary conditions arising from the diffusion op. Only useful if boundary conditions are weakly imposed using a Nitsche technique. Right-hand side and the system matrix are updated.
| [in,out] | builder | pointer to a cs_cdovb_scaleq_t structure |
| [in,out] | diff_builder | pointer to a cs_cdovb_diff_t structure |
| [in,out] | full_rhs | right-hand side |
| [in,out] | full_matrix | matrix of the linear system |
| void cs_cdovb_scaleq_build_system | ( | const cs_mesh_t * | mesh, |
| const cs_real_t * | field_val, | ||
| double | dt_cur, | ||
| void * | builder, | ||
| cs_real_t ** | rhs, | ||
| cs_sla_matrix_t ** | sla_mat | ||
| ) |
Build the linear system arising from a scalar convection/diffusion equation with a CDO vertex-based scheme. One works cellwise and then process to the assembly.
| [in] | mesh | pointer to a cs_mesh_t structure |
| [in] | field_val | pointer to the current value of the field |
| [in] | dt_cur | current value of the time step |
| [in,out] | builder | pointer to cs_cdovb_scaleq_t structure |
| [in,out] | rhs | right-hand side |
| [in,out] | sla_mat | pointer to cs_sla_matrix_t structure pointer |
| void cs_cdovb_scaleq_compute_source | ( | void * | builder | ) |
Compute the contributions of source terms (store inside builder)
| [in,out] | builder | pointer to a cs_cdovb_scaleq_t structure |
| void* cs_cdovb_scaleq_free | ( | void * | builder | ) |
Destroy a cs_cdovb_scaleq_t structure.
| [in,out] | builder | pointer to a cs_cdovb_scaleq_t structure |
| void cs_cdovb_scaleq_free_buffer | ( | void | ) |
Free work buffer related to cdo vertex-based schemes.
| cs_real_t* cs_cdovb_scaleq_get_tmpbuf | ( | void | ) |
Retrieve a pointer to a temporary buffer related to scalar equations discretized with CDO vertex-based schemes.
| void* cs_cdovb_scaleq_init | ( | const cs_equation_param_t * | eqp, |
| const cs_mesh_t * | mesh, | ||
| const cs_cdo_connect_t * | connect, | ||
| const cs_cdo_quantities_t * | quant, | ||
| const cs_time_step_t * | time_step | ||
| ) |
Initialize a cs_cdovb_scaleq_t structure.
| [in] | eqp | pointer to a cs_equation_param_t structure |
| [in] | mesh | pointer to a cs_mesh_t structure |
| [in] | connect | pointer to a cs_cdo_connect_t structure |
| [in] | quant | pointer to a cs_cdo_quantities_t structure |
| [in] | time_step | time_step structure |
| void cs_cdovb_scaleq_init_buffer | ( | const cs_cdo_connect_t * | connect | ) |
Allocate work buffer related to cdo vertex-based schemes.
| [in] | connect | pointer to a cs_cdo_connect_t structure |
| void cs_cdovb_scaleq_post | ( | const char * | eqname, |
| const cs_field_t * | field, | ||
| void * | builder | ||
| ) |
Post-processing related to this equation.
| [in] | eqname | name of the equation |
| [in] | field | pointer to a field strufcture |
| [in,out] | builder | pointer to builder structure |
Post-process the solution of a scalar convection/diffusion equation solved with a CDO vertex-based scheme.
| [in] | solu | solution array |
| [in,out] | builder | pointer to cs_cdovb_scaleq_t structure |
| [in,out] | field_val | pointer to the current value of the field |
|
static |
|
static |
|
static |
|
static |
1.8.9.1