8.3
general documentation
cs_hodge.h File Reference
#include "cs_cdo_connect.h"
#include "cs_cdo_local.h"
#include "cs_cdo_quantities.h"
#include "cs_param_cdo.h"
#include "cs_property.h"
#include "cs_sdm.h"
+ Include dependency graph for cs_hodge.h:

Go to the source code of this file.

Data Structures

struct  cs_hodge_param_t
 Structure storing all metadata/parameters related to the usage of a discrete Hodge operator. More...
 
struct  cs_hodge_t
 Structure associated to a discrete Hodge operator *. More...
 

Typedefs

typedef bool() cs_hodge_compute_t(const cs_cell_mesh_t *cm, cs_hodge_t *hodge, cs_cell_builder_t *cb)
 Build a discrete Hodge operator or a related operator (such as the stiffmess matrix) for a given cell. The discrete Hodge operator is stored in hodge->matrix whereas the associated operator is stored in cb->loc One checks if something has to be computed. One skips the computation if the value of the associated property is equal to zero. More...
 

Enumerations

enum  cs_hodge_type_t {
  CS_HODGE_TYPE_VPCD , CS_HODGE_TYPE_EPFD , CS_HODGE_TYPE_FPED , CS_HODGE_TYPE_EDFP ,
  CS_HODGE_TYPE_CPVD , CS_HODGE_TYPE_VDCP , CS_HODGE_TYPE_FB , CS_HODGE_TYPE_VC ,
  CS_HODGE_N_TYPES
}
 Type of discrete Hodge operators. More...
 
enum  cs_hodge_algo_t {
  CS_HODGE_ALGO_VORONOI , CS_HODGE_ALGO_WBS , CS_HODGE_ALGO_COST , CS_HODGE_ALGO_BUBBLE ,
  CS_HODGE_ALGO_AUTO , CS_HODGE_N_ALGOS
}
 Type of algorithm to build a discrete Hodge operator. More...
 

Functions

static bool cs_hodge_param_is_similar (const cs_hodge_param_t h1_info, const cs_hodge_param_t h2_info)
 Check if two sets of parameters related to how build a discrete Hodge operator are similar. More...
 
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_evaluate_property (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_evaluate_property_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 means 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 means 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. 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...
 
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...
 
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...
 

Typedef Documentation

◆ cs_hodge_compute_t

typedef bool() cs_hodge_compute_t(const cs_cell_mesh_t *cm, cs_hodge_t *hodge, cs_cell_builder_t *cb)

Build a discrete Hodge operator or a related operator (such as the stiffmess matrix) for a given cell. The discrete Hodge operator is stored in hodge->matrix whereas the associated operator is stored in cb->loc One checks if something has to be computed. One skips the computation if the value of the associated property is equal to zero.

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.

Enumeration Type Documentation

◆ cs_hodge_algo_t

Type of algorithm to build a discrete Hodge operator.

Enumerator
CS_HODGE_ALGO_VORONOI 

This algorithm assumes that an orthogonality condition holds between geometrical entities (e.g. the face normal/dual edge or the primal edge/dual face normal). This algorithm leads to a diagonal discrete Hodge operator (and is related to a two-point flux approximation). Be aware that using this technique on a non-orthogonal mesh leads to a consistency error which does not decrease when refining the mesh.

CS_HODGE_ALGO_WBS 

WBS means "Whitney Barycentric Subdivision". This algorithm relies on a subdivision into tetrahedra of each polyhedral cell and then applies algorithms on this subdivision shape functions close to what exists in the Finite Element litterature

CS_HODGE_ALGO_COST 

Orthogonal decomposition between the consistency (CO) and the stabilization (ST) parts. Several discretizations share this way to build discrete Hodge operators like SUSHI, DGA and GCR (these discretizations only differ from the scaling coefficient in front of the stabilization term)

CS_HODGE_ALGO_BUBBLE 

This algorithm also relies on an orthogonal decomposition between the consistency (CO) and the stabilization (ST) parts but the stabilization part relies on a bubble function (similar to what can be found in the Finite Element literature)

CS_HODGE_ALGO_AUTO 

Automatic switch between the above-mentioned algorithms (not used for the moment).

CS_HODGE_N_ALGOS 

◆ cs_hodge_type_t

Type of discrete Hodge operators.

Enumerator
CS_HODGE_TYPE_VPCD 

Hodge operator from primal vertices to dual cells. This operator is also equivalent to a mass matrix for vertex-based schemes

CS_HODGE_TYPE_EPFD 

Hodge operator from primal edges to dual faces

CS_HODGE_TYPE_FPED 

Hodge operator from primal faces to dual edges

CS_HODGE_TYPE_EDFP 

Hodge operator from dual edges to primal faces

CS_HODGE_TYPE_CPVD 

Hodge operator from primal cells to dual vertices

CS_HODGE_TYPE_VDCP 

Hodge operator from dual vertices to primal cells

CS_HODGE_TYPE_FB 

Hodge operator playing the role of mass matrix for face-based schemes. This operator deals with a hybrid space of degrees of freedom (faces and cells)

CS_HODGE_TYPE_VC 

Hodge operator playing the role of mass matrix for vertex+cell-based schemes. This operator deals with a hybrid space of degrees of freedom (vertices and cells)

CS_HODGE_N_TYPES 

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
[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 nullptr
[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. 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

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_evaluate_property()

void cs_hodge_evaluate_property ( 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_evaluate_property_cw()

void cs_hodge_evaluate_property_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_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
[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 nullptr
[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_is_similar()

static bool cs_hodge_param_is_similar ( const cs_hodge_param_t  h1_info,
const cs_hodge_param_t  h2_info 
)
inlinestatic

Check if two sets of parameters related to how build a discrete Hodge operator are similar.

Parameters
[in]h1_infopointer to a first cs_hodge_param_t structure
[in]h2_infopointer to a second cs_hodge_param_t structure
Returns
true or false

◆ 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_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 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

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 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

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