8.0
general documentation
cs_hodge.c File Reference

Build discrete Hodge operators. More...

#include "cs_defs.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include <limits.h>
#include <assert.h>
#include "bft_mem.h"
#include "cs_log.h"
#include "cs_math.h"
#include "cs_scheme_geometry.h"
#include "cs_hodge.h"
+ Include dependency graph for cs_hodge.c:

Functions

cs_hodge_tcs_hodge_create (const cs_cdo_connect_t *connect, const cs_property_t *property, const cs_hodge_param_t *hp, bool need_tensor, bool need_eigen)
 Create and initialize a pointer to a cs_hodge_t structure. More...
 
cs_hodge_t ** cs_hodge_init_context (const cs_cdo_connect_t *connect, const cs_property_t *property, const cs_hodge_param_t *hp, bool need_tensor, bool need_eigen)
 Create and initialize an array of pointers to a cs_hodge_t structures. This array is of size the number of OpenMP threads. Only the one associated to the current thread is set. More...
 
void cs_hodge_free (cs_hodge_t **p_hodge)
 Free a cs_hodge_t structure. More...
 
void cs_hodge_free_context (cs_hodge_t ***p_hodges)
 Free a set of cs_hodge_t structures. More...
 
cs_hodge_compute_tcs_hodge_get_func (const char *calling_func, const cs_hodge_param_t hp)
 Retrieve a function pointer to compute a discrete Hodge operator. More...
 
cs_hodge_algo_t cs_hodge_set_mass_algo (const char *eqname, cs_hodge_algo_t reac_algo, cs_hodge_algo_t time_algo)
 Check the consistency of the settings between terms related to a mass matrix and define the common algorithm to use. If a term should not be considered, set the algorithm to CS_HODGE_N_ALGOS. More...
 
void cs_hodge_param_log (const char *prefix, const cs_property_t *property, const cs_hodge_param_t hp)
 Output the settings related to a cs_hodge_param_t structure. More...
 
void cs_hodge_copy_parameters (const cs_hodge_param_t *h_ref, cs_hodge_param_t *h_cpy)
 Copy the set of parameters associated to a discrete Hodge operator to another one. More...
 
void cs_hodge_set_property_value (const cs_lnum_t c_id, const cs_real_t t_eval, const cs_flag_t c_flag, cs_hodge_t *hodge)
 Set the property value (scalar- or tensor-valued) related to a discrete Hodge operator inside a cell and if needed other related quantities. More...
 
void cs_hodge_set_property_value_cw (const cs_cell_mesh_t *cm, const cs_real_t t_eval, const cs_flag_t c_flag, cs_hodge_t *hodge)
 Set the property value (scalar- or tensor-valued) related to a discrete Hodge operator inside a cell and if needed ohter related quantities. Cell-wise variant (usage of cs_cell_mesh_t structure) More...
 
bool cs_hodge_fb_cost_get_stiffness (const cs_cell_mesh_t *cm, cs_hodge_t *hodge, cs_cell_builder_t *cb)
 Build a local stiffness matrix using the generic COST algo. The computed matrix is stored in cb->loc and the related discrete hodge operator in hodge->matrix Case of CDO face-based schemes. More...
 
bool cs_hodge_fb_bubble_get_stiffness (const cs_cell_mesh_t *cm, cs_hodge_t *hodge, cs_cell_builder_t *cb)
 Build a local stiffness matrix using the generic COST algo. with the usage of bubble stabilization. The computed matrix is stored in cb->loc and the related discrete hodge operator in hodge->matrix Case of CDO face-based schemes. More...
 
bool cs_hodge_fb_voro_get_stiffness (const cs_cell_mesh_t *cm, cs_hodge_t *hodge, cs_cell_builder_t *cb)
 Build a local stiffness matrix using the Voronoi algorithm The computed matrix is stored in cb->loc and the related discrete hodge operator in hodge->matrix Case of CDO face-based schemes. More...
 
bool cs_hodge_vb_cost_get_iso_stiffness (const cs_cell_mesh_t *cm, cs_hodge_t *hodge, cs_cell_builder_t *cb)
 Build a local stiffness matrix using the generic COST algo. The computed matrix is stored in cb->loc and the related discrete hodge operator in hodge->matrix Case of CDO vertex-based schemes and an isotropic property. More...
 
bool cs_hodge_vb_cost_get_aniso_stiffness (const cs_cell_mesh_t *cm, cs_hodge_t *hodge, cs_cell_builder_t *cb)
 Build a local stiffness matrix using the generic COST algo. The computed matrix is stored in cb->loc and the related discrete hodge operator in hodge->matrix Case of CDO vertex-based schemes and an anistropic property. More...
 
bool cs_hodge_vb_bubble_get_iso_stiffness (const cs_cell_mesh_t *cm, cs_hodge_t *hodge, cs_cell_builder_t *cb)
 Build a local stiffness matrix using the generic Bubble algo. The computed matrix is stored in cb->loc and the related discrete hodge operator in hodge->matrix Case of CDO vertex-based schemes and isotropic material property. More...
 
bool cs_hodge_vb_bubble_get_aniso_stiffness (const cs_cell_mesh_t *cm, cs_hodge_t *hodge, cs_cell_builder_t *cb)
 Build a local stiffness matrix using the generic Bubble algo. The computed matrix is stored in cb->loc and the related discrete hodge operator in hodge->matrix Case of CDO vertex-based schemes and anisotropic material property. More...
 
bool cs_hodge_vb_cost_get_stiffness (const cs_cell_mesh_t *cm, cs_hodge_t *hodge, cs_cell_builder_t *cb)
 Build a local stiffness matrix using the generic COST algo. The computed matrix is stored in cb->loc and the related discrete hodge operator in hodge->matrix Case of CDO vertex-based schemes. More...
 
bool cs_hodge_vb_voro_get_stiffness (const cs_cell_mesh_t *cm, cs_hodge_t *hodge, cs_cell_builder_t *cb)
 Build a local stiffness matrix using the Voronoi algorithm The computed matrix is stored in cb->loc and the related discrete hodge operator in hodge->matrix Case of CDO vertex-based schemes. More...
 
bool cs_hodge_vb_wbs_get_stiffness (const cs_cell_mesh_t *cm, cs_hodge_t *hodge, cs_cell_builder_t *cb)
 Build a local stiffness matrix using the generic WBS algo. WBS standing for Whitney Barycentric Subdivision (WBS) algo. The computed matrix is stored in cb->loc. More...
 
bool cs_hodge_vcb_get_stiffness (const cs_cell_mesh_t *cm, cs_hodge_t *hodge, cs_cell_builder_t *cb)
 Build a local stiffness matrix using the generic WBS algo. WBS standing for Whitney Barycentric Subdivision (WBS) algo. The computed matrix is stored in cb->loc. More...
 
bool cs_hodge_fb_get (const cs_cell_mesh_t *cm, cs_hodge_t *hodge, cs_cell_builder_t *cb)
 Build a local Hodge operator on a given cell which is equivalent of a mass matrix. It relies on a CO+ST algo. and is specific to CDO-Fb schemes. The discrete Hodge operator is stored in hodge->matrix. More...
 
bool cs_hodge_vcb_voro_get (const cs_cell_mesh_t *cm, cs_hodge_t *hodge, cs_cell_builder_t *cb)
 Build a local Hodge operator for a given cell using the Voronoi algo. This leads to a diagonal operator. This function is specific for vertex+cell-based schemes The discrete Hodge operator is stored in hodge->matrix. More...
 
bool cs_hodge_vcb_wbs_get (const cs_cell_mesh_t *cm, cs_hodge_t *hodge, cs_cell_builder_t *cb)
 Build a local Hodge operator for a given cell using the WBS algo. This function is specific for vertex+cell-based schemes The discrete Hodge operator is stored in hodge->matrix. More...
 
bool cs_hodge_vpcd_wbs_get (const cs_cell_mesh_t *cm, cs_hodge_t *hodge, cs_cell_builder_t *cb)
 Build a local Hodge operator for a given cell using WBS algo. Hodge op. from primal vertices to dual cells. This function is specific for vertex-based schemes The discrete Hodge operator is stored in hodge->matrix. More...
 
bool cs_hodge_vpcd_voro_get (const cs_cell_mesh_t *cm, cs_hodge_t *hodge, cs_cell_builder_t *cb)
 Build a local Hodge operator for a given cell using VORONOI algo. Hodge op. from primal vertices to dual cells. This function is specific for vertex-based schemes The discrete Hodge operator is stored in hodge->matrix. More...
 
bool cs_hodge_epfd_voro_get (const cs_cell_mesh_t *cm, cs_hodge_t *hodge, cs_cell_builder_t *cb)
 Build a local Hodge operator for a given cell using VORONOI algo. Hodge op. from primal edges to dual faces. The discrete Hodge operator is stored in hodge->matrix This function is specific for vertex-based schemes. More...
 
bool cs_hodge_epfd_cost_get (const cs_cell_mesh_t *cm, cs_hodge_t *hodge, cs_cell_builder_t *cb)
 Build a local Hodge operator for a given cell using the COST algo. Hodge op. from primal edges to dual faces. The discrete Hodge operator is stored in hodge->matrix This function is specific for vertex-based schemes. More...
 
bool cs_hodge_epfd_bubble_get (const cs_cell_mesh_t *cm, cs_hodge_t *hodge, cs_cell_builder_t *cb)
 Build a local Hodge operator for a given cell using the COST algo. with a bubble stabilization. The discrete Hodge operator is stored in hodge->matrix Hodge op. from primal edges to dual faces. This function is specific for vertex-based schemes. More...
 
bool cs_hodge_fped_voro_get (const cs_cell_mesh_t *cm, cs_hodge_t *hodge, cs_cell_builder_t *cb)
 Build a local Hodge operator for a given cell using VORONOI algo. Hodge op. from primal faces to dual edges. The discrete Hodge operator is stored in hodge->matrix This function is related to cell-based schemes. More...
 
bool cs_hodge_fped_cost_get (const cs_cell_mesh_t *cm, cs_hodge_t *hodge, cs_cell_builder_t *cb)
 Build a local Hodge operator for a given cell using the COST algo. Hodge op. from primal faces to dual edges. The discrete Hodge operator is stored in hodge->matrix This function is related to cell-based schemes. More...
 
bool cs_hodge_fped_bubble_get (const cs_cell_mesh_t *cm, cs_hodge_t *hodge, cs_cell_builder_t *cb)
 Build a local Hodge operator for a given cell using the Bubble algo. Hodge op. from primal faces to dual edges. The discrete Hodge operator is stored in hodge->matrix This function is related to cell-based schemes. More...
 
bool cs_hodge_edfp_voro_get (const cs_cell_mesh_t *cm, cs_hodge_t *hodge, cs_cell_builder_t *cb)
 Build a local Hodge operator for a given cell using VORONOI algo. Hodge op. from dual edges to primal faces. The discrete Hodge operator is stored in hodge->matrix This function is related to face-based schemes. More...
 
bool cs_hodge_edfp_cost_get (const cs_cell_mesh_t *cm, cs_hodge_t *hodge, cs_cell_builder_t *cb)
 Build a local Hodge operator for a given cell using the COST algo. Hodge op. from dual edges to primal faces. The discrete Hodge operator is stored in hodge->matrix This function is related to face-based schemes. More...
 
bool cs_hodge_edfp_cost_get_opt (const cs_cell_mesh_t *cm, cs_hodge_t *hodge, cs_cell_builder_t *cb)
 Build a local Hodge operator for a given cell using the COST algo. Hodge op. from dual edges to primal faces. This function is related to face-based schemes. More...
 
bool cs_hodge_edfp_bubble_get (const cs_cell_mesh_t *cm, cs_hodge_t *hodge, cs_cell_builder_t *cb)
 Build a local Hodge operator for a given cell using the Bubble algo. Hodge op. from dual edges to primal faces. The discrete Hodge operator is stored in hodge->matrix This function is related to face-based schemes. More...
 
void cs_hodge_matvec (const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_hodge_param_t hodgep, const cs_property_t *pty, const cs_real_t in_vals[], cs_real_t t_eval, cs_real_t result[])
 Compute cellwise a discrete hodge operator and multiple it with a vector. More...
 
void cs_hodge_circulation_from_flux (const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, cs_real_t t_eval, const cs_hodge_param_t hodgep, const cs_property_t *pty, const cs_real_t flux[], cs_real_t circul[])
 Compute cellwise a discrete hodge operator in order to define a circulation array from a flux array. More...
 
void cs_hodge_compute_wbs_surfacic (const cs_face_mesh_t *fm, cs_sdm_t *hf)
 Compute the hodge operator related to a face (i.e. a mass matrix with unity property) using a Whitney Barycentric Subdivision (WBS) algorithm. More...
 

Variables

static const double cs_hodge_vc_coef = 3./20
 
static const char cs_hodge_type_desc [CS_HODGE_N_TYPES][CS_BASE_STRING_LEN]
 
static const char cs_hodge_algo_desc [CS_HODGE_N_ALGOS][CS_BASE_STRING_LEN]
 

Detailed Description

Build discrete Hodge operators.

Function Documentation

◆ cs_hodge_circulation_from_flux()

void cs_hodge_circulation_from_flux ( const cs_cdo_connect_t connect,
const cs_cdo_quantities_t quant,
cs_real_t  t_eval,
const cs_hodge_param_t  hodgep,
const cs_property_t pty,
const cs_real_t  flux[],
cs_real_t  circul[] 
)

Compute cellwise a discrete hodge operator in order to define a circulation array from a flux array.

Parameters
[in]connectpointer to a cs_cdo_connect_t structure
[in]quantpointer to a cs_cdo_quantities_t structure
[in]t_evaltime at which one performs the evaluation
[in]hodgepcs_hodge_param_t structure
[in]ptypointer to a cs_property_t structure or NULL
[in]fluxvector to multiply with the discrete Hodge op.
[in,out]circularray storing the resulting matrix-vector product

◆ cs_hodge_compute_wbs_surfacic()

void cs_hodge_compute_wbs_surfacic ( const cs_face_mesh_t fm,
cs_sdm_t *  hf 
)

Compute the hodge operator related to a face (i.e. a mass matrix with unity property) using a Whitney Barycentric Subdivision (WBS) algorithm.

Parameters
[in]fmpointer to a cs_face_mesh_t structure
[in,out]hfpointer to a cs_sdm_t structure to define

◆ cs_hodge_copy_parameters()

void cs_hodge_copy_parameters ( const cs_hodge_param_t h_ref,
cs_hodge_param_t h_cpy 
)

Copy the set of parameters associated to a discrete Hodge operator to another one.

Parameters
[in]h_refreference set of parameters
[in,out]h_cpyset of parameters to update

◆ cs_hodge_create()

cs_hodge_t* cs_hodge_create ( const cs_cdo_connect_t connect,
const cs_property_t property,
const cs_hodge_param_t hp,
bool  need_tensor,
bool  need_eigen 
)

Create and initialize a pointer to a cs_hodge_t structure.

Parameters
[in]connectpointer to cs_cdo_connect_t structure
[in]propertypointer to a property structure
[in]hppointer to a cs_hodge_param_t structure
[in]need_tensortrue if one needs a tensor otherwise false
[in]need_eigentrue if one needs to compute eigen valuese
Returns
a pointer to the new allocated cs_hodge_t structure

◆ cs_hodge_edfp_bubble_get()

bool cs_hodge_edfp_bubble_get ( const cs_cell_mesh_t cm,
cs_hodge_t hodge,
cs_cell_builder_t cb 
)

Build a local Hodge operator for a given cell using the Bubble algo. Hodge op. from dual edges to primal faces. The discrete Hodge operator is stored in hodge->matrix This function is related to face-based schemes.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
Returns
true if something has been computed or false otherwise

◆ cs_hodge_edfp_cost_get()

bool cs_hodge_edfp_cost_get ( const cs_cell_mesh_t cm,
cs_hodge_t hodge,
cs_cell_builder_t cb 
)

Build a local Hodge operator for a given cell using the COST algo. Hodge op. from dual edges to primal faces. The discrete Hodge operator is stored in hodge->matrix This function is related to face-based schemes.

Build a local Hodge operator for a given cell using the COST algo. Hodge op. from dual edges to primal faces. This function is related to face-based schemes.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
Returns
true if something has been computed or false otherwise

◆ cs_hodge_edfp_cost_get_opt()

bool cs_hodge_edfp_cost_get_opt ( const cs_cell_mesh_t cm,
cs_hodge_t hodge,
cs_cell_builder_t cb 
)

Build a local Hodge operator for a given cell using the COST algo. Hodge op. from dual edges to primal faces. This function is related to face-based schemes.

Parameters
[in]cmpointer to a cs_cell_mesh_t struct.
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
Returns
true if something has been computed or false otherwise

◆ cs_hodge_edfp_voro_get()

bool cs_hodge_edfp_voro_get ( const cs_cell_mesh_t cm,
cs_hodge_t hodge,
cs_cell_builder_t cb 
)

Build a local Hodge operator for a given cell using VORONOI algo. Hodge op. from dual edges to primal faces. The discrete Hodge operator is stored in hodge->matrix This function is related to face-based schemes.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
Returns
true if something has been computed or false otherwise

◆ cs_hodge_epfd_bubble_get()

bool cs_hodge_epfd_bubble_get ( const cs_cell_mesh_t cm,
cs_hodge_t hodge,
cs_cell_builder_t cb 
)

Build a local Hodge operator for a given cell using the COST algo. with a bubble stabilization. The discrete Hodge operator is stored in hodge->matrix Hodge op. from primal edges to dual faces. This function is specific for vertex-based schemes.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
Returns
true if something has been computed or false otherwise

◆ cs_hodge_epfd_cost_get()

bool cs_hodge_epfd_cost_get ( const cs_cell_mesh_t cm,
cs_hodge_t hodge,
cs_cell_builder_t cb 
)

Build a local Hodge operator for a given cell using the COST algo. Hodge op. from primal edges to dual faces. The discrete Hodge operator is stored in hodge->matrix This function is specific for vertex-based schemes.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
Returns
true if something has been computed or false otherwise

◆ cs_hodge_epfd_voro_get()

bool cs_hodge_epfd_voro_get ( const cs_cell_mesh_t cm,
cs_hodge_t hodge,
cs_cell_builder_t cb 
)

Build a local Hodge operator for a given cell using VORONOI algo. Hodge op. from primal edges to dual faces. The discrete Hodge operator is stored in hodge->matrix This function is specific for vertex-based schemes.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
Returns
true if something has been computed or false otherwise

◆ cs_hodge_fb_bubble_get_stiffness()

bool cs_hodge_fb_bubble_get_stiffness ( const cs_cell_mesh_t cm,
cs_hodge_t hodge,
cs_cell_builder_t cb 
)

Build a local stiffness matrix using the generic COST algo. with the usage of bubble stabilization. The computed matrix is stored in cb->loc and the related discrete hodge operator in hodge->matrix Case of CDO face-based schemes.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
Returns
true if something has been computed or false otherwise

◆ cs_hodge_fb_cost_get_stiffness()

bool cs_hodge_fb_cost_get_stiffness ( const cs_cell_mesh_t cm,
cs_hodge_t hodge,
cs_cell_builder_t cb 
)

Build a local stiffness matrix using the generic COST algo. The computed matrix is stored in cb->loc and the related discrete hodge operator in hodge->matrix Case of CDO face-based schemes.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
Returns
true if something has been computed or false otherwise

◆ cs_hodge_fb_get()

bool cs_hodge_fb_get ( const cs_cell_mesh_t cm,
cs_hodge_t hodge,
cs_cell_builder_t cb 
)

Build a local Hodge operator on a given cell which is equivalent of a mass matrix. It relies on a CO+ST algo. and is specific to CDO-Fb schemes. The discrete Hodge operator is stored in hodge->matrix.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
Returns
true if something has been computed or false otherwise

◆ cs_hodge_fb_voro_get_stiffness()

bool cs_hodge_fb_voro_get_stiffness ( const cs_cell_mesh_t cm,
cs_hodge_t hodge,
cs_cell_builder_t cb 
)

Build a local stiffness matrix using the Voronoi algorithm The computed matrix is stored in cb->loc and the related discrete hodge operator in hodge->matrix Case of CDO face-based schemes.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
Returns
true if something has been computed or false otherwise

◆ cs_hodge_fped_bubble_get()

bool cs_hodge_fped_bubble_get ( const cs_cell_mesh_t cm,
cs_hodge_t hodge,
cs_cell_builder_t cb 
)

Build a local Hodge operator for a given cell using the Bubble algo. Hodge op. from primal faces to dual edges. The discrete Hodge operator is stored in hodge->matrix This function is related to cell-based schemes.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
Returns
true if something has been computed or false otherwise

◆ cs_hodge_fped_cost_get()

bool cs_hodge_fped_cost_get ( const cs_cell_mesh_t cm,
cs_hodge_t hodge,
cs_cell_builder_t cb 
)

Build a local Hodge operator for a given cell using the COST algo. Hodge op. from primal faces to dual edges. The discrete Hodge operator is stored in hodge->matrix This function is related to cell-based schemes.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
Returns
true if something has been computed or false otherwise

◆ cs_hodge_fped_voro_get()

bool cs_hodge_fped_voro_get ( const cs_cell_mesh_t cm,
cs_hodge_t hodge,
cs_cell_builder_t cb 
)

Build a local Hodge operator for a given cell using VORONOI algo. Hodge op. from primal faces to dual edges. The discrete Hodge operator is stored in hodge->matrix This function is related to cell-based schemes.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
Returns
true if something has been computed or false otherwise

◆ cs_hodge_free()

void cs_hodge_free ( cs_hodge_t **  p_hodge)

Free a cs_hodge_t structure.

Parameters
[in,out]p_hodgedouble pointer to a cs_hodge_t structure

◆ cs_hodge_free_context()

void cs_hodge_free_context ( cs_hodge_t ***  p_hodges)

Free a set of cs_hodge_t structures.

Parameters
[in,out]p_hodgestriple pointer to cs_hodge_t structures

◆ cs_hodge_get_func()

cs_hodge_compute_t* cs_hodge_get_func ( const char *  calling_func,
const cs_hodge_param_t  hp 
)

Retrieve a function pointer to compute a discrete Hodge operator.

Parameters
[in]calling_funcname of the calling function
[in]hpa cs_hodge_param_t structure
Returns
a pointer to the corresponding function

◆ cs_hodge_init_context()

cs_hodge_t** cs_hodge_init_context ( const cs_cdo_connect_t connect,
const cs_property_t property,
const cs_hodge_param_t hp,
bool  need_tensor,
bool  need_eigen 
)

Create and initialize an array of pointers to a cs_hodge_t structures. This array is of size the number of OpenMP threads. Only the one associated to the current thread is set.

Parameters
[in]connectpointer to cs_cdo_connect_t structure
[in]propertypointer to a property structure
[in]hppointer to a cs_hodge_param_t structure
[in]need_tensortrue if one needs a tensor otherwise false
[in]need_eigentrue if one needs to compute eigen valuese
Returns
an array of pointers of cs_hodge_t structures

◆ cs_hodge_matvec()

void cs_hodge_matvec ( const cs_cdo_connect_t connect,
const cs_cdo_quantities_t quant,
const cs_hodge_param_t  hodgep,
const cs_property_t pty,
const cs_real_t  in_vals[],
cs_real_t  t_eval,
cs_real_t  result[] 
)

Compute cellwise a discrete hodge operator and multiple it with a vector.

Parameters
[in]connectpointer to a cs_cdo_connect_t structure
[in]quantpointer to a cs_cdo_quantities_t structure
[in]hodgepcs_hodge_param_t structure
[in]ptypointer to a cs_property_t structure or NULL
[in]in_valsvector to multiply with the discrete Hodge op.
[in]t_evaltime at which one performs the evaluation
[in,out]resultarray storing the resulting matrix-vector product

◆ cs_hodge_param_log()

void cs_hodge_param_log ( const char *  prefix,
const cs_property_t property,
const cs_hodge_param_t  hp 
)

Output the settings related to a cs_hodge_param_t structure.

Parameters
[in]prefixoptional string
[in]propertyoptional pointer to a property structure
[in]hpa cs_hodge_param_t structure

◆ cs_hodge_set_mass_algo()

cs_hodge_algo_t cs_hodge_set_mass_algo ( const char *  eqname,
cs_hodge_algo_t  reac_algo,
cs_hodge_algo_t  time_algo 
)

Check the consistency of the settings between terms related to a mass matrix and define the common algorithm to use. If a term should not be considered, set the algorithm to CS_HODGE_N_ALGOS.

Parameters
[in]eqnamename of the equation to check
[in]reac_algooptional algo. used for the reaction term
[in]time_algooptional algo. used for the unsteady term
Returns
the common algorithm to use

◆ cs_hodge_set_property_value()

void cs_hodge_set_property_value ( const cs_lnum_t  c_id,
const cs_real_t  t_eval,
const cs_flag_t  c_flag,
cs_hodge_t hodge 
)

Set the property value (scalar- or tensor-valued) related to a discrete Hodge operator inside a cell and if needed other related quantities.

Parameters
[in]c_idid of the cell to deal with
[in]t_evaltime at which one performs the evaluation
[in]c_flagflag related to this cell
[in,out]hodgepointer to a cs_hodge_t structure

◆ cs_hodge_set_property_value_cw()

void cs_hodge_set_property_value_cw ( const cs_cell_mesh_t cm,
const cs_real_t  t_eval,
const cs_flag_t  c_flag,
cs_hodge_t hodge 
)

Set the property value (scalar- or tensor-valued) related to a discrete Hodge operator inside a cell and if needed ohter related quantities. Cell-wise variant (usage of cs_cell_mesh_t structure)

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]t_evaltime at which one performs the evaluation
[in]c_flagflag related to this cell
[in,out]hodgepointer to a cs_hodge_t structure

◆ cs_hodge_vb_bubble_get_aniso_stiffness()

bool cs_hodge_vb_bubble_get_aniso_stiffness ( const cs_cell_mesh_t cm,
cs_hodge_t hodge,
cs_cell_builder_t cb 
)

Build a local stiffness matrix using the generic Bubble algo. The computed matrix is stored in cb->loc and the related discrete hodge operator in hodge->matrix Case of CDO vertex-based schemes and anisotropic material property.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
Returns
true if something has been computed or false otherwise

◆ cs_hodge_vb_bubble_get_iso_stiffness()

bool cs_hodge_vb_bubble_get_iso_stiffness ( const cs_cell_mesh_t cm,
cs_hodge_t hodge,
cs_cell_builder_t cb 
)

Build a local stiffness matrix using the generic Bubble algo. The computed matrix is stored in cb->loc and the related discrete hodge operator in hodge->matrix Case of CDO vertex-based schemes and isotropic material property.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
Returns
true if something has been computed or false otherwise

◆ cs_hodge_vb_cost_get_aniso_stiffness()

bool cs_hodge_vb_cost_get_aniso_stiffness ( const cs_cell_mesh_t cm,
cs_hodge_t hodge,
cs_cell_builder_t cb 
)

Build a local stiffness matrix using the generic COST algo. The computed matrix is stored in cb->loc and the related discrete hodge operator in hodge->matrix Case of CDO vertex-based schemes and an anistropic property.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
Returns
true if something has been computed or false otherwise

◆ cs_hodge_vb_cost_get_iso_stiffness()

bool cs_hodge_vb_cost_get_iso_stiffness ( const cs_cell_mesh_t cm,
cs_hodge_t hodge,
cs_cell_builder_t cb 
)

Build a local stiffness matrix using the generic COST algo. The computed matrix is stored in cb->loc and the related discrete hodge operator in hodge->matrix Case of CDO vertex-based schemes and an isotropic property.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
Returns
true if something has been computed or false otherwise

◆ cs_hodge_vb_cost_get_stiffness()

bool cs_hodge_vb_cost_get_stiffness ( const cs_cell_mesh_t cm,
cs_hodge_t hodge,
cs_cell_builder_t cb 
)

Build a local stiffness matrix using the generic COST algo. The computed matrix is stored in cb->loc and the related discrete hodge operator in hodge->matrix Case of CDO vertex-based schemes.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
Returns
true if something has been computed or false otherwise

◆ cs_hodge_vb_voro_get_stiffness()

bool cs_hodge_vb_voro_get_stiffness ( const cs_cell_mesh_t cm,
cs_hodge_t hodge,
cs_cell_builder_t cb 
)

Build a local stiffness matrix using the Voronoi algorithm The computed matrix is stored in cb->loc and the related discrete hodge operator in hodge->matrix Case of CDO vertex-based schemes.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
Returns
true if something has been computed or false otherwise

◆ cs_hodge_vb_wbs_get_stiffness()

bool cs_hodge_vb_wbs_get_stiffness ( const cs_cell_mesh_t cm,
cs_hodge_t hodge,
cs_cell_builder_t cb 
)

Build a local stiffness matrix using the generic WBS algo. WBS standing for Whitney Barycentric Subdivision (WBS) algo. The computed matrix is stored in cb->loc.

Build a local stiffness matrix using the generic WBS algo. WBS means for Whitney Barycentric Subdivision (WBS) algo. The computed matrix is stored in cb->loc.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
Returns
true if something has been computed or false otherwise

◆ cs_hodge_vcb_get_stiffness()

bool cs_hodge_vcb_get_stiffness ( const cs_cell_mesh_t cm,
cs_hodge_t hodge,
cs_cell_builder_t cb 
)

Build a local stiffness matrix using the generic WBS algo. WBS standing for Whitney Barycentric Subdivision (WBS) algo. The computed matrix is stored in cb->loc.

Build a local stiffness matrix using the generic WBS algo. WBS means Whitney Barycentric Subdivision (WBS) algo. The computed matrix is stored in cb->loc.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
Returns
true if something has been computed or false otherwise

◆ cs_hodge_vcb_voro_get()

bool cs_hodge_vcb_voro_get ( const cs_cell_mesh_t cm,
cs_hodge_t hodge,
cs_cell_builder_t cb 
)

Build a local Hodge operator for a given cell using the Voronoi algo. This leads to a diagonal operator. This function is specific for vertex+cell-based schemes The discrete Hodge operator is stored in hodge->matrix.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
Returns
true if something has been computed or false otherwise

◆ cs_hodge_vcb_wbs_get()

bool cs_hodge_vcb_wbs_get ( const cs_cell_mesh_t cm,
cs_hodge_t hodge,
cs_cell_builder_t cb 
)

Build a local Hodge operator for a given cell using the WBS algo. This function is specific for vertex+cell-based schemes The discrete Hodge operator is stored in hodge->matrix.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
Returns
true if something has been computed or false otherwise

◆ cs_hodge_vpcd_voro_get()

bool cs_hodge_vpcd_voro_get ( const cs_cell_mesh_t cm,
cs_hodge_t hodge,
cs_cell_builder_t cb 
)

Build a local Hodge operator for a given cell using VORONOI algo. Hodge op. from primal vertices to dual cells. This function is specific for vertex-based schemes The discrete Hodge operator is stored in hodge->matrix.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
Returns
true if something has been computed or false otherwise

◆ cs_hodge_vpcd_wbs_get()

bool cs_hodge_vpcd_wbs_get ( const cs_cell_mesh_t cm,
cs_hodge_t hodge,
cs_cell_builder_t cb 
)

Build a local Hodge operator for a given cell using WBS algo. Hodge op. from primal vertices to dual cells. This function is specific for vertex-based schemes The discrete Hodge operator is stored in hodge->matrix.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
Returns
true if something has been computed or false otherwise

Variable Documentation

◆ cs_hodge_algo_desc

const char cs_hodge_algo_desc[CS_HODGE_N_ALGOS][CS_BASE_STRING_LEN]
static
Initial value:
=
{ N_("Voronoi"),
N_("Whitney on the Barycentric Subdivision (WBS)"),
N_("Orthogonal Consistency/Stabilization (OCS)"),
N_("Orthogonal Consistency/Bubble-Stabilization (BUBBLE)"),
N_("Automatic switch") }
#define N_(String)
Definition: cs_defs.h:64

◆ cs_hodge_type_desc

const char cs_hodge_type_desc[CS_HODGE_N_TYPES][CS_BASE_STRING_LEN]
static
Initial value:
=
{ N_("VpCd"),
N_("EpFd"),
N_("FpEd"),
N_("EdFp"),
N_("CpVd"),
N_("VdCp"),
N_("Face-based"),
N_("Vertex+Cell-based"),
}

◆ cs_hodge_vc_coef

const double cs_hodge_vc_coef = 3./20
static