My Project
programmer's documentation
|
#include "cs_defs.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <float.h>
#include <bft_mem.h>
#include "cs_basis_func.h"
#include "cs_evaluate.h"
#include "cs_hho_builder.h"
#include "cs_log.h"
#include "cs_math.h"
#include "cs_volume_zone.h"
#include "cs_source_term.h"
Macros | |
#define | CS_SOURCE_TERM_DBG 0 |
Functions | |
void | cs_source_term_set_shared_pointers (const cs_cdo_quantities_t *quant, const cs_cdo_connect_t *connect) |
Set shared pointers to main domain members. More... | |
cs_flag_t | cs_source_term_set_default_flag (cs_param_space_scheme_t scheme) |
Set the default flag related to a source term according to the numerical scheme chosen for discretizing an equation. More... | |
void | cs_source_term_set_reduction (cs_xdef_t *st, cs_flag_t flag) |
Set advanced parameters which are defined by default in a source term structure. More... | |
cs_flag_t | cs_source_term_get_flag (const cs_xdef_t *st) |
Get metadata related to the given source term structure. More... | |
cs_flag_t | cs_source_term_init (cs_param_space_scheme_t space_scheme, const int n_source_terms, cs_xdef_t *const *source_terms, cs_source_term_cellwise_t *compute_source[], cs_flag_t *sys_flag, cs_mask_t *source_mask[]) |
Initialize data to build the source terms. More... | |
void | cs_source_term_compute_cellwise (const int n_source_terms, cs_xdef_t *const *source_terms, const cs_cell_mesh_t *cm, const cs_mask_t *source_mask, cs_source_term_cellwise_t *compute_source[], cs_real_t time_eval, void *input, cs_cell_builder_t *cb, cs_real_t *result) |
Compute the local contributions of source terms in a cell. More... | |
void | cs_source_term_compute_from_density (cs_flag_t loc, const cs_xdef_t *source, cs_real_t time_eval, double *p_values[]) |
Compute the contribution related to a source term in the case of an input data which is a density. More... | |
void | cs_source_term_compute_from_potential (cs_flag_t loc, const cs_xdef_t *source, cs_real_t time_eval, double *p_values[]) |
Compute the contribution related to a source term in the case of an input data which is a potential. More... | |
void | cs_source_term_pvsp_by_value (const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a scalar potential defined at primal vertices by a constant value. A discrete Hodge operator has to be computed before this call and stored inside a cs_cell_builder_t structure. More... | |
void | cs_source_term_pvsp_by_analytic (const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a scalar potential defined at primal vertices by an analytical function. A discrete Hodge operator has to be computed before this call and stored inside a cs_cell_builder_t structure. More... | |
void | cs_source_term_dcsd_by_value (const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a scalar density defined at dual cells by a value. More... | |
void | cs_source_term_dcvd_by_value (const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a vector-valued density defined at dual cells by a value. More... | |
void | cs_source_term_dcsd_by_array (const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a scalar density defined at dual cells by an array. More... | |
void | cs_source_term_dcsd_bary_by_analytic (const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a scalar density defined at dual cells by an analytical function. Use the barycentric approximation as quadrature to evaluate the integral. Exact for linear function. More... | |
void | cs_source_term_dcsd_q1o1_by_analytic (const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a scalar density defined at dual cells by an analytical function. Use a the barycentric approximation as quadrature to evaluate the integral. Exact for linear function. More... | |
void | cs_source_term_dcsd_q10o2_by_analytic (const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a scalar density defined at dual cells by an analytical function. Use a ten-point quadrature rule to evaluate the integral. Exact for quadratic function. More... | |
void | cs_source_term_dcsd_q5o3_by_analytic (const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a scalar density defined at dual cells by an analytical function. Use a five-point quadrature rule to evaluate the integral. Exact for cubic function. This function may be expensive since many evaluations are needed. Please use it with care. More... | |
void | cs_source_term_vcsp_by_value (const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a scalar potential defined at primal vertices and cells by a constant value. A discrete Hodge operator has to be computed before this call and stored inside a cs_cell_builder_t structure. More... | |
void | cs_source_term_vcsp_by_analytic (const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a scalar potential defined at primal vertices and cells by an analytical function. A discrete Hodge operator has to be computed before this call and stored inside a cs_cell_builder_t structure. More... | |
void | cs_source_term_pcsd_by_value (const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a scalar density (sd) defined on primal cells by a value. Case of face-based schemes. More... | |
void | cs_source_term_pcvd_by_value (const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a vector-valued density (vd) defined on primal cells by a value. Case of face-based schemes. More... | |
void | cs_source_term_pcsd_bary_by_analytic (const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a scalar density defined at primal cells by an analytical function. Use the barycentric approximation as quadrature to evaluate the integral. Exact for linear function. Case of face-based schemes. More... | |
void | cs_source_term_pcsd_by_analytic (const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values) |
Compute the contribution of a source term for a cell and add it to the given array of values. Case of a scalar density (sd) defined on primal cells by an analytic function. Case of face-based schemes. More... | |
void | cs_source_term_pcsd_by_array (const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a scalar density defined at primal cells by an array. More... | |
void | cs_source_term_pcvd_bary_by_analytic (const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a vector-valued density defined at primal cells by an analytical function. Use the barycentric approximation as quadrature to evaluate the integral. Exact for linear function. Case of face-based schemes. More... | |
void | cs_source_term_pcvd_by_analytic (const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values) |
Compute the contribution of a source term for a cell and add it to the given array of values. Case of a vector density (vd) defined on primal cells by an analytic function. Case of face-based schemes. More... | |
void | cs_source_term_pcvd_by_array (const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values) |
Compute the contribution of a source term for a cell and add it to the given array of values. Case of a vector density (vd) defined on primal cells by an array. More... | |
void | cs_source_term_hhosd_by_value (const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values) |
Compute the contribution of a source term for a cell and add it to the given array of values. Case of a scalar density (sd) defined on primal cells by a value. Case of HHO schemes. More... | |
void | cs_source_term_hhosd_by_analytic (const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values) |
Compute the contribution of a source term for a cell and add it to the given array of values. Case of a scalar density (sd) defined on primal cells by an analytic function. Case of HHO schemes. More... | |
void | cs_source_term_hhovd_by_analytic (const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values) |
Compute the contribution of a source term for a cell and add it to the given array of values. Case of a vector field (vd) defined on primal cells by an analytic function. Case of HHO schemes. More... | |
Variables | |
static const char | _err_empty_st [] |
static const cs_cdo_quantities_t * | cs_cdo_quant |
static const cs_cdo_connect_t * | cs_cdo_connect |
#define CS_SOURCE_TERM_DBG 0 |
void cs_source_term_compute_cellwise | ( | const int | n_source_terms, |
cs_xdef_t *const * | source_terms, | ||
const cs_cell_mesh_t * | cm, | ||
const cs_mask_t * | source_mask, | ||
cs_source_term_cellwise_t * | compute_source[], | ||
cs_real_t | time_eval, | ||
void * | input, | ||
cs_cell_builder_t * | cb, | ||
cs_real_t * | result | ||
) |
Compute the local contributions of source terms in a cell.
[in] | n_source_terms | number of source terms |
[in] | source_terms | pointer to the definitions of source terms |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | source_mask | array storing in a compact way which source term is defined in a given cell |
[in] | compute_source | array of function pointers |
[in] | time_eval | physical time at which one evaluates the term |
[in,out] | input | pointer to an element cast on-the-fly |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | result | array storing the result of the evaluation |
void cs_source_term_compute_from_density | ( | cs_flag_t | loc, |
const cs_xdef_t * | source, | ||
cs_real_t | time_eval, | ||
double * | p_values[] | ||
) |
Compute the contribution related to a source term in the case of an input data which is a density.
[in] | loc | describe where is located the associated DoF |
[in] | source | pointer to a cs_xdef_t structure |
[in] | time_eval | physical time at which one evaluates the term |
[in,out] | p_values | pointer to the computed values (allocated if NULL) |
void cs_source_term_compute_from_potential | ( | cs_flag_t | loc, |
const cs_xdef_t * | source, | ||
cs_real_t | time_eval, | ||
double * | p_values[] | ||
) |
Compute the contribution related to a source term in the case of an input data which is a potential.
[in] | loc | describe where is located the associated DoF |
[in] | source | pointer to a cs_xdef_t structure |
[in] | time_eval | physical time at which one evaluates the term |
[in,out] | p_values | pointer to the computed values (allocated if NULL) |
void cs_source_term_dcsd_bary_by_analytic | ( | const cs_xdef_t * | source, |
const cs_cell_mesh_t * | cm, | ||
cs_real_t | time_eval, | ||
cs_cell_builder_t * | cb, | ||
void * | input, | ||
double * | values | ||
) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a scalar density defined at dual cells by an analytical function. Use the barycentric approximation as quadrature to evaluate the integral. Exact for linear function.
[in] | source | pointer to a cs_xdef_t structure |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | time_eval | physical time at which one evaluates the term |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | input | pointer to an element cast on-the-fly (or NULL) |
[in,out] | values | pointer to the computed values |
void cs_source_term_dcsd_by_array | ( | const cs_xdef_t * | source, |
const cs_cell_mesh_t * | cm, | ||
cs_real_t | time_eval, | ||
cs_cell_builder_t * | cb, | ||
void * | input, | ||
double * | values | ||
) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a scalar density defined at dual cells by an array.
[in] | source | pointer to a cs_xdef_t structure |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | time_eval | physical time at which one evaluates the term |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | input | pointer to an element cast on-the-fly (or NULL) |
[in,out] | values | pointer to the computed values |
void cs_source_term_dcsd_by_value | ( | const cs_xdef_t * | source, |
const cs_cell_mesh_t * | cm, | ||
cs_real_t | time_eval, | ||
cs_cell_builder_t * | cb, | ||
void * | input, | ||
double * | values | ||
) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a scalar density defined at dual cells by a value.
[in] | source | pointer to a cs_xdef_t structure |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | time_eval | physical time at which one evaluates the term |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | input | pointer to an element cast on-the-fly (or NULL) |
[in,out] | values | pointer to the computed values |
void cs_source_term_dcsd_q10o2_by_analytic | ( | const cs_xdef_t * | source, |
const cs_cell_mesh_t * | cm, | ||
cs_real_t | time_eval, | ||
cs_cell_builder_t * | cb, | ||
void * | input, | ||
double * | values | ||
) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a scalar density defined at dual cells by an analytical function. Use a ten-point quadrature rule to evaluate the integral. Exact for quadratic function.
[in] | source | pointer to a cs_xdef_t structure |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | time_eval | physical time at which one evaluates the term |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | input | pointer to an element cast on-the-fly (or NULL) |
[in,out] | values | pointer to the computed values |
void cs_source_term_dcsd_q1o1_by_analytic | ( | const cs_xdef_t * | source, |
const cs_cell_mesh_t * | cm, | ||
cs_real_t | time_eval, | ||
cs_cell_builder_t * | cb, | ||
void * | input, | ||
double * | values | ||
) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a scalar density defined at dual cells by an analytical function. Use a the barycentric approximation as quadrature to evaluate the integral. Exact for linear function.
[in] | source | pointer to a cs_xdef_t structure |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | time_eval | physical time at which one evaluates the term |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | input | pointer to an element cast on-the-fly (or NULL) |
[in,out] | values | pointer to the computed values |
void cs_source_term_dcsd_q5o3_by_analytic | ( | const cs_xdef_t * | source, |
const cs_cell_mesh_t * | cm, | ||
cs_real_t | time_eval, | ||
cs_cell_builder_t * | cb, | ||
void * | input, | ||
double * | values | ||
) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a scalar density defined at dual cells by an analytical function. Use a five-point quadrature rule to evaluate the integral. Exact for cubic function. This function may be expensive since many evaluations are needed. Please use it with care.
[in] | source | pointer to a cs_xdef_t structure |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | time_eval | physical time at which one evaluates the term |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | input | pointer to an element cast on-the-fly (or NULL) |
[in,out] | values | pointer to the computed values |
void cs_source_term_dcvd_by_value | ( | const cs_xdef_t * | source, |
const cs_cell_mesh_t * | cm, | ||
cs_real_t | time_eval, | ||
cs_cell_builder_t * | cb, | ||
void * | input, | ||
double * | values | ||
) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a vector-valued density defined at dual cells by a value.
[in] | source | pointer to a cs_xdef_t structure |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | time_eval | physical time at which one evaluates the term |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | input | pointer to an element cast on-the-fly (or NULL) |
[in,out] | values | pointer to the computed values |
Get metadata related to the given source term structure.
[in,out] | st | pointer to a cs_xdef_t structure |
void cs_source_term_hhosd_by_analytic | ( | const cs_xdef_t * | source, |
const cs_cell_mesh_t * | cm, | ||
cs_real_t | time_eval, | ||
cs_cell_builder_t * | cb, | ||
void * | input, | ||
double * | values | ||
) |
Compute the contribution of a source term for a cell and add it to the given array of values. Case of a scalar density (sd) defined on primal cells by an analytic function. Case of HHO schemes.
[in] | source | pointer to a cs_xdef_t structure |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | time_eval | physical time at which one evaluates the term |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | input | pointer to an element cast on-the-fly (or NULL) |
[in,out] | values | pointer to the computed value |
void cs_source_term_hhosd_by_value | ( | const cs_xdef_t * | source, |
const cs_cell_mesh_t * | cm, | ||
cs_real_t | time_eval, | ||
cs_cell_builder_t * | cb, | ||
void * | input, | ||
double * | values | ||
) |
Compute the contribution of a source term for a cell and add it to the given array of values. Case of a scalar density (sd) defined on primal cells by a value. Case of HHO schemes.
[in] | source | pointer to a cs_xdef_t structure |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | time_eval | physical time at which one evaluates the term |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | input | pointer to an element cast on-the-fly (or NULL) |
[in,out] | values | pointer to the computed value |
void cs_source_term_hhovd_by_analytic | ( | const cs_xdef_t * | source, |
const cs_cell_mesh_t * | cm, | ||
cs_real_t | time_eval, | ||
cs_cell_builder_t * | cb, | ||
void * | input, | ||
double * | values | ||
) |
Compute the contribution of a source term for a cell and add it to the given array of values. Case of a vector field (vd) defined on primal cells by an analytic function. Case of HHO schemes.
[in] | source | pointer to a cs_xdef_t structure |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | time_eval | physical time at which one evaluates the term |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | input | pointer to an element cast on-the-fly (or NULL) |
[in,out] | values | pointer to the computed value |
cs_flag_t cs_source_term_init | ( | cs_param_space_scheme_t | space_scheme, |
const int | n_source_terms, | ||
cs_xdef_t *const * | source_terms, | ||
cs_source_term_cellwise_t * | compute_source[], | ||
cs_flag_t * | sys_flag, | ||
cs_mask_t * | source_mask[] | ||
) |
Initialize data to build the source terms.
[in] | space_scheme | scheme used to discretize in space |
[in] | n_source_terms | number of source terms |
[in] | source_terms | pointer to the definitions of source terms |
[in,out] | compute_source | array of function pointers |
[in,out] | sys_flag | metadata about the algebraic system |
[in,out] | source_mask | pointer to an array storing in a compact way which source term is defined in a given cell |
void cs_source_term_pcsd_bary_by_analytic | ( | const cs_xdef_t * | source, |
const cs_cell_mesh_t * | cm, | ||
cs_real_t | time_eval, | ||
cs_cell_builder_t * | cb, | ||
void * | input, | ||
double * | values | ||
) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a scalar density defined at primal cells by an analytical function. Use the barycentric approximation as quadrature to evaluate the integral. Exact for linear function. Case of face-based schemes.
[in] | source | pointer to a cs_xdef_t structure |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | time_eval | physical time at which one evaluates the term |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in] | input | NULL or pointer to a structure cast on-the-fly |
[in,out] | values | pointer to the computed values |
void cs_source_term_pcsd_by_analytic | ( | const cs_xdef_t * | source, |
const cs_cell_mesh_t * | cm, | ||
cs_real_t | time_eval, | ||
cs_cell_builder_t * | cb, | ||
void * | input, | ||
double * | values | ||
) |
Compute the contribution of a source term for a cell and add it to the given array of values. Case of a scalar density (sd) defined on primal cells by an analytic function. Case of face-based schemes.
Compute the contribution of a source term for a cell and add it to the given array of values. Case of a scalar density (sd) defined on primal cells by an analytic function.
[in] | source | pointer to a cs_xdef_t structure |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | time_eval | physical time at which one evaluates the term |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | input | pointer to an element cast on-the-fly (or NULL) |
[in,out] | values | pointer to the computed value |
void cs_source_term_pcsd_by_array | ( | const cs_xdef_t * | source, |
const cs_cell_mesh_t * | cm, | ||
cs_real_t | time_eval, | ||
cs_cell_builder_t * | cb, | ||
void * | input, | ||
double * | values | ||
) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a scalar density defined at primal cells by an array.
[in] | source | pointer to a cs_xdef_t structure |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | time_eval | physical time at which one evaluates the term |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | input | pointer to an element cast on-the-fly (or NULL) |
[in,out] | values | pointer to the computed values |
void cs_source_term_pcsd_by_value | ( | const cs_xdef_t * | source, |
const cs_cell_mesh_t * | cm, | ||
cs_real_t | time_eval, | ||
cs_cell_builder_t * | cb, | ||
void * | input, | ||
double * | values | ||
) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a scalar density (sd) defined on primal cells by a value. Case of face-based schemes.
[in] | source | pointer to a cs_xdef_t structure |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | time_eval | physical time at which one evaluates the term |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | input | pointer to an element cast on-the-fly (or NULL) |
[in,out] | values | pointer to the computed value |
void cs_source_term_pcvd_bary_by_analytic | ( | const cs_xdef_t * | source, |
const cs_cell_mesh_t * | cm, | ||
cs_real_t | time_eval, | ||
cs_cell_builder_t * | cb, | ||
void * | input, | ||
double * | values | ||
) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a vector-valued density defined at primal cells by an analytical function. Use the barycentric approximation as quadrature to evaluate the integral. Exact for linear function. Case of face-based schemes.
[in] | source | pointer to a cs_xdef_t structure |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | time_eval | physical time at which one evaluates the term |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in] | input | NULL or pointer to a structure cast on-the-fly |
[in,out] | values | pointer to the computed values |
void cs_source_term_pcvd_by_analytic | ( | const cs_xdef_t * | source, |
const cs_cell_mesh_t * | cm, | ||
cs_real_t | time_eval, | ||
cs_cell_builder_t * | cb, | ||
void * | input, | ||
double * | values | ||
) |
Compute the contribution of a source term for a cell and add it to the given array of values. Case of a vector density (vd) defined on primal cells by an analytic function. Case of face-based schemes.
Compute the contribution of a source term for a cell and add it to the given array of values. Case of a vector average (va) defined on primal cells by an analytic function.
[in] | source | pointer to a cs_xdef_t structure |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | time_eval | physical time at which one evaluates the term |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | input | pointer to an element cast on-the-fly (or NULL) |
[in,out] | values | pointer to the computed value |
void cs_source_term_pcvd_by_array | ( | const cs_xdef_t * | source, |
const cs_cell_mesh_t * | cm, | ||
cs_real_t | time_eval, | ||
cs_cell_builder_t * | cb, | ||
void * | input, | ||
double * | values | ||
) |
Compute the contribution of a source term for a cell and add it to the given array of values. Case of a vector density (vd) defined on primal cells by an array.
[in] | source | pointer to a cs_xdef_t structure |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | time_eval | physical time at which one evaluates the term |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | input | pointer to an element cast on-the-fly (or NULL) |
[in,out] | values | pointer to the computed value |
void cs_source_term_pcvd_by_value | ( | const cs_xdef_t * | source, |
const cs_cell_mesh_t * | cm, | ||
cs_real_t | time_eval, | ||
cs_cell_builder_t * | cb, | ||
void * | input, | ||
double * | values | ||
) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a vector-valued density (vd) defined on primal cells by a value. Case of face-based schemes.
[in] | source | pointer to a cs_xdef_t structure |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | time_eval | physical time at which one evaluates the term |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | input | pointer to an element cast on-the-fly (or NULL) |
[in,out] | values | pointer to the computed value |
void cs_source_term_pvsp_by_analytic | ( | const cs_xdef_t * | source, |
const cs_cell_mesh_t * | cm, | ||
cs_real_t | time_eval, | ||
cs_cell_builder_t * | cb, | ||
void * | input, | ||
double * | values | ||
) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a scalar potential defined at primal vertices by an analytical function. A discrete Hodge operator has to be computed before this call and stored inside a cs_cell_builder_t structure.
[in] | source | pointer to a cs_xdef_t structure |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | time_eval | physical time at which one evaluates the term |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | input | pointer to an element cast on-the-fly (or NULL) |
[in,out] | values | pointer to the computed values |
void cs_source_term_pvsp_by_value | ( | const cs_xdef_t * | source, |
const cs_cell_mesh_t * | cm, | ||
cs_real_t | time_eval, | ||
cs_cell_builder_t * | cb, | ||
void * | input, | ||
double * | values | ||
) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a scalar potential defined at primal vertices by a constant value. A discrete Hodge operator has to be computed before this call and stored inside a cs_cell_builder_t structure.
[in] | source | pointer to a cs_xdef_t structure |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | time_eval | physical time at which one evaluates the term |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | input | pointer to an element cast on-the-fly (or NULL) |
[in,out] | values | pointer to the computed values |
cs_flag_t cs_source_term_set_default_flag | ( | cs_param_space_scheme_t | scheme | ) |
Set the default flag related to a source term according to the numerical scheme chosen for discretizing an equation.
[in] | scheme | numerical scheme used for the discretization |
Set advanced parameters which are defined by default in a source term structure.
[in,out] | st | pointer to a cs_xdef_t structure |
[in] | flag | CS_FLAG_DUAL or CS_FLAG_PRIMAL |
void cs_source_term_set_shared_pointers | ( | const cs_cdo_quantities_t * | quant, |
const cs_cdo_connect_t * | connect | ||
) |
Set shared pointers to main domain members.
[in] | quant | additional mesh quantities struct. |
[in] | connect | pointer to a cs_cdo_connect_t struct. |
void cs_source_term_vcsp_by_analytic | ( | const cs_xdef_t * | source, |
const cs_cell_mesh_t * | cm, | ||
cs_real_t | time_eval, | ||
cs_cell_builder_t * | cb, | ||
void * | input, | ||
double * | values | ||
) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a scalar potential defined at primal vertices and cells by an analytical function. A discrete Hodge operator has to be computed before this call and stored inside a cs_cell_builder_t structure.
[in] | source | pointer to a cs_xdef_t structure |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | time_eval | physical time at which one evaluates the term |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | input | pointer to an element cast on-the-fly (or NULL) |
[in,out] | values | pointer to the computed values |
void cs_source_term_vcsp_by_value | ( | const cs_xdef_t * | source, |
const cs_cell_mesh_t * | cm, | ||
cs_real_t | time_eval, | ||
cs_cell_builder_t * | cb, | ||
void * | input, | ||
double * | values | ||
) |
Compute the contribution for a cell related to a source term and add it the given array of values. Case of a scalar potential defined at primal vertices and cells by a constant value. A discrete Hodge operator has to be computed before this call and stored inside a cs_cell_builder_t structure.
[in] | source | pointer to a cs_xdef_t structure |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | time_eval | physical time at which one evaluates the term |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | input | pointer to an element cast on-the-fly (or NULL) |
[in,out] | values | pointer to the computed values |
|
static |
|
static |
|
static |