programmer's documentation
Macros | Functions | Variables
cs_cdofb_scaleq.c File Reference
#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_cdofb_scaleq.h"
Include dependency graph for cs_cdofb_scaleq.c:

Macros

#define CDOFB_SCALEQ_DBG   0
 

Functions

static cs_sla_matrix_t_init_diffusion_matrix (const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant)
 Allocate and initialize the matrix related to the diffusion op. Note: values are filled in a second step. More...
 
static cs_sla_matrix_t_build_diffusion_system (const cs_mesh_t *m, cs_real_t *rhs, cs_cdofb_scaleq_t *builder)
 Define the final (reduced) matrix for diffusion and its right hand side (RHS). RHS is the sum of three contributions. More...
 
void cs_cdofb_scaleq_init_buffer (const cs_cdo_connect_t *connect)
 Allocate work buffer related to cdo face-based schemes. More...
 
void cs_cdofb_scaleq_free_buffer (void)
 Free work buffer related to cdo face-based schemes. More...
 
cs_real_tcs_cdofb_scaleq_get_tmpbuf (void)
 Retrieve a pointer to a temporary buffer related to scalar equations discretized with CDO face-based schemes. More...
 
void * cs_cdofb_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_cdofb_scaleq_t structure. More...
 
void * cs_cdofb_scaleq_free (void *builder)
 Destroy a cs_cdofb_scaleq_t structure. More...
 
void cs_cdofb_scaleq_compute_source (void *builder)
 Compute the contributions of source terms (store inside builder) More...
 
void cs_cdofb_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 face-based scheme. More...
 
void cs_cdofb_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 face-based scheme. More...
 
void cs_cdofb_scaleq_post (const char *eqname, const cs_field_t *field, void *builder)
 Post-processing related to this equation. More...
 
const double * cs_cdofb_scaleq_get_face_values (const void *builder, const cs_field_t *field)
 Get the computed values at each face. More...
 

Variables

static size_t _fbscal_work_size = 0
 
static cs_real_t_fbscal_work = NULL
 

Macro Definition Documentation

#define CDOFB_SCALEQ_DBG   0

Function Documentation

static cs_sla_matrix_t* _build_diffusion_system ( const cs_mesh_t m,
cs_real_t rhs,
cs_cdofb_scaleq_t *  builder 
)
static

Define the final (reduced) matrix for diffusion and its right hand side (RHS). RHS is the sum of three contributions.

  • Source terms
  • Neumann boundary conditions
  • Dirichlet boundary conditions
Parameters
[in]mpointer to a cs_mesh_t structure
[in,out]rhsright-hand side
[in,out]builderpointer to a cs_cdofb_scaleq_t struct.
Returns
a pointer to the full stiffness matrix
static cs_sla_matrix_t* _init_diffusion_matrix ( const cs_cdo_connect_t connect,
const cs_cdo_quantities_t quant 
)
static

Allocate and initialize the matrix related to the diffusion op. Note: values are filled in a second step.

Parameters
[in]connectpointer to a cs_cdo_connect_t structure
[in]quantpointer to a cs_cdo_quantities_t structure
Returns
a pointer to a cs_sla_matrix_t structure
void cs_cdofb_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 face-based scheme.

Parameters
[in]meshpointer to a cs_mesh_t structure
[in]field_valpointer to the current value of the field
[in]dt_curcurrent value of the time step
[in,out]builderpointer to cs_cdofb_scaleq_t structure
[in,out]rhspointer to a right-hand side array pointer
[in,out]sla_matpointer to cs_sla_matrix_t structure pointer
void cs_cdofb_scaleq_compute_source ( void *  builder)

Compute the contributions of source terms (store inside builder)

Parameters
[in,out]builderpointer to a cs_cdofb_scaleq_t structure
void* cs_cdofb_scaleq_free ( void *  builder)

Destroy a cs_cdofb_scaleq_t structure.

Parameters
[in,out]builderpointer to a cs_cdovb_scaleq_t structure
Returns
a NULL pointer
void cs_cdofb_scaleq_free_buffer ( void  )

Free work buffer related to cdo face-based schemes.

const double* cs_cdofb_scaleq_get_face_values ( const void *  builder,
const cs_field_t field 
)

Get the computed values at each face.

Parameters
[in]builderpointer to a cs_cdofb_scaleq_t structure
[in]fieldpointer to a cs_field_t structure
Returns
a pointer to an array of double (size n_faces)
cs_real_t* cs_cdofb_scaleq_get_tmpbuf ( void  )

Retrieve a pointer to a temporary buffer related to scalar equations discretized with CDO face-based schemes.

Returns
a pointer to an array of double
void* cs_cdofb_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_cdofb_scaleq_t structure.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in]meshpointer to a cs_mesh_t structure
[in]connectpointer to a cs_cdo_connect_t structure
[in]quantpointer to a cs_cdo_quantities_t structure
[in]time_steptime_step structure
Returns
a pointer to a new allocated cs_cdofb_scaleq_t structure
void cs_cdofb_scaleq_init_buffer ( const cs_cdo_connect_t connect)

Allocate work buffer related to cdo face-based schemes.

Parameters
[in]connectpointer to a cs_cdo_connect_t structure
void cs_cdofb_scaleq_post ( const char *  eqname,
const cs_field_t field,
void *  builder 
)

Post-processing related to this equation.

Parameters
[in]eqnamename of the equation
[in]fieldpointer to a field strufcture
[in,out]builderpointer to builder structure
void cs_cdofb_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 face-based scheme.

Parameters
[in]solusolution array
[in,out]builderpointer to cs_cdofb_scaleq_t structure
[in,out]field_valpointer to the current value of the field

Variable Documentation

cs_real_t* _fbscal_work = NULL
static
size_t _fbscal_work_size = 0
static