My Project
programmer's documentation
Functions | Variables
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

void cs_hodge_fb_cost_get_stiffness (const cs_param_hodge_t h_info, const cs_cell_mesh_t *cm, cs_cell_builder_t *cb)
 Build a local stiffness matrix using the generic COST algo. The computed matrix is stored in cb->loc Case of CDO face-based schemes. More...
 
void cs_hodge_fb_voro_get_stiffness (const cs_param_hodge_t h_info, const cs_cell_mesh_t *cm, cs_cell_builder_t *cb)
 Build a local stiffness matrix using the Voronoi algorithm The computed matrix is stored in cb->loc Case of CDO face-based schemes. More...
 
void cs_hodge_vb_cost_get_iso_stiffness (const cs_param_hodge_t h_info, const cs_cell_mesh_t *cm, cs_cell_builder_t *cb)
 Build a local stiffness matrix using the generic COST algo. Case of CDO vertex-based schemes and isotropic property. More...
 
void cs_hodge_vb_cost_get_aniso_stiffness (const cs_param_hodge_t h_info, const cs_cell_mesh_t *cm, cs_cell_builder_t *cb)
 Build a local stiffness matrix using the generic COST algo. Case of CDO vertex-based schemes. More...
 
void cs_hodge_vb_cost_get_stiffness (const cs_param_hodge_t h_info, const cs_cell_mesh_t *cm, cs_cell_builder_t *cb)
 Build a local stiffness matrix using the generic COST algo. Case of CDO vertex-based schemes. More...
 
void cs_hodge_vb_voro_get_stiffness (const cs_param_hodge_t h_info, const cs_cell_mesh_t *cm, cs_cell_builder_t *cb)
 Build a local stiffness matrix using the Voronoi algorithm The computed matrix is stored in cb->loc Case of CDO vertex-based schemes. More...
 
void cs_hodge_vb_wbs_get_stiffness (const cs_param_hodge_t h_info, const cs_cell_mesh_t *cm, cs_cell_builder_t *cb)
 Build a local stiffness matrix using the generic WBS algo. WBS standing for Whitney Barycentric Subdivision (WBS) algo. More...
 
void cs_hodge_vcb_get_stiffness (const cs_param_hodge_t h_info, const cs_cell_mesh_t *cm, 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...
 
void cs_hodge_fb_get_mass (const cs_param_hodge_t h_info, const cs_cell_mesh_t *cm, 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. More...
 
void cs_hodge_vcb_wbs_get (const cs_param_hodge_t h_info, const cs_cell_mesh_t *cm, 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. More...
 
void cs_hodge_vpcd_wbs_get (const cs_param_hodge_t h_info, const cs_cell_mesh_t *cm, 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. More...
 
void cs_hodge_vpcd_voro_get (const cs_param_hodge_t h_info, const cs_cell_mesh_t *cm, 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. More...
 
void cs_hodge_epfd_voro_get (const cs_param_hodge_t h_info, const cs_cell_mesh_t *cm, 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. This function is specific for vertex-based schemes. More...
 
void cs_hodge_epfd_cost_get (const cs_param_hodge_t h_info, const cs_cell_mesh_t *cm, 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. This function is specific for vertex-based schemes. More...
 
void cs_hodge_fped_voro_get (const cs_param_hodge_t h_info, const cs_cell_mesh_t *cm, 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. This function is related to cell-based schemes. More...
 
void cs_hodge_fped_cost_get (const cs_param_hodge_t h_info, const cs_cell_mesh_t *cm, 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. This function is related to cell-based schemes. More...
 
void cs_hodge_edfp_voro_get (const cs_param_hodge_t h_info, const cs_cell_mesh_t *cm, 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. This function is related to face-based schemes. More...
 
void cs_hodge_edfp_cost_get (const cs_param_hodge_t h_info, const cs_cell_mesh_t *cm, 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_edfp_cost_get_opt (const cs_param_hodge_t h_info, const cs_cell_mesh_t *cm, 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_param_hodge_t h_info, const cs_property_t *pty, const double in_vals[], cs_real_t t_eval, double result[])
 Compute cellwise a discrete hodge operator and multiple it with a vector. 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
 

Detailed Description

Build discrete Hodge operators.

Function Documentation

◆ 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_edfp_cost_get()

void cs_hodge_edfp_cost_get ( const cs_param_hodge_t  h_info,
const cs_cell_mesh_t cm,
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]h_infopointer to a cs_param_hodge_t structure
[in]cmpointer to a cs_cell_mesh_t struct.
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_hodge_edfp_cost_get_opt()

void cs_hodge_edfp_cost_get_opt ( const cs_param_hodge_t  h_info,
const cs_cell_mesh_t cm,
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]h_infopointer to a cs_param_hodge_t structure
[in]cmpointer to a cs_cell_mesh_t struct.
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_hodge_edfp_voro_get()

void cs_hodge_edfp_voro_get ( const cs_param_hodge_t  h_info,
const cs_cell_mesh_t cm,
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. This function is related to face-based schemes.

Parameters
[in]h_infopointer to a cs_param_hodge_t structure
[in]cmpointer to a cs_cell_mesh_t struct.
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_hodge_epfd_cost_get()

void cs_hodge_epfd_cost_get ( const cs_param_hodge_t  h_info,
const cs_cell_mesh_t cm,
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. This function is specific for vertex-based schemes.

Parameters
[in]h_infopointer to a cs_param_hodge_t structure
[in]cmpointer to a cs_cell_mesh_t struct.
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_hodge_epfd_voro_get()

void cs_hodge_epfd_voro_get ( const cs_param_hodge_t  h_info,
const cs_cell_mesh_t cm,
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. This function is specific for vertex-based schemes.

Parameters
[in]h_infopointer to a cs_param_hodge_t structure
[in]cmpointer to a cs_cell_mesh_t struct.
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_hodge_fb_cost_get_stiffness()

void cs_hodge_fb_cost_get_stiffness ( const cs_param_hodge_t  h_info,
const cs_cell_mesh_t cm,
cs_cell_builder_t cb 
)

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

Parameters
[in]h_infopointer to a cs_param_hodge_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_hodge_fb_get_mass()

void cs_hodge_fb_get_mass ( const cs_param_hodge_t  h_info,
const cs_cell_mesh_t cm,
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.

Parameters
[in]h_infopointer to a cs_param_hodge_t structure
[in]cmpointer to a cs_cell_mesh_t struct.
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_hodge_fb_voro_get_stiffness()

void cs_hodge_fb_voro_get_stiffness ( const cs_param_hodge_t  h_info,
const cs_cell_mesh_t cm,
cs_cell_builder_t cb 
)

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

Parameters
[in]h_infopointer to a cs_param_hodge_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_hodge_fped_cost_get()

void cs_hodge_fped_cost_get ( const cs_param_hodge_t  h_info,
const cs_cell_mesh_t cm,
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. This function is related to cell-based schemes.

Parameters
[in]h_infopointer to a cs_param_hodge_t structure
[in]cmpointer to a cs_cell_mesh_t struct.
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_hodge_fped_voro_get()

void cs_hodge_fped_voro_get ( const cs_param_hodge_t  h_info,
const cs_cell_mesh_t cm,
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. This function is related to cell-based schemes.

Parameters
[in]h_infopointer to a cs_param_hodge_t structure
[in]cmpointer to a cs_cell_mesh_t struct.
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_hodge_matvec()

void cs_hodge_matvec ( const cs_cdo_connect_t connect,
const cs_cdo_quantities_t quant,
const cs_param_hodge_t  h_info,
const cs_property_t pty,
const double  in_vals[],
cs_real_t  t_eval,
double  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]h_infocs_param_hodge_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_vb_cost_get_aniso_stiffness()

void cs_hodge_vb_cost_get_aniso_stiffness ( const cs_param_hodge_t  h_info,
const cs_cell_mesh_t cm,
cs_cell_builder_t cb 
)

Build a local stiffness matrix using the generic COST algo. Case of CDO vertex-based schemes.

Parameters
[in]h_infopointer to a cs_param_hodge_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_hodge_vb_cost_get_iso_stiffness()

void cs_hodge_vb_cost_get_iso_stiffness ( const cs_param_hodge_t  h_info,
const cs_cell_mesh_t cm,
cs_cell_builder_t cb 
)

Build a local stiffness matrix using the generic COST algo. Case of CDO vertex-based schemes and isotropic property.

Parameters
[in]h_infopointer to a cs_param_hodge_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_hodge_vb_cost_get_stiffness()

void cs_hodge_vb_cost_get_stiffness ( const cs_param_hodge_t  h_info,
const cs_cell_mesh_t cm,
cs_cell_builder_t cb 
)

Build a local stiffness matrix using the generic COST algo. Case of CDO vertex-based schemes.

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

Parameters
[in]h_infopointer to a cs_param_hodge_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_hodge_vb_voro_get_stiffness()

void cs_hodge_vb_voro_get_stiffness ( const cs_param_hodge_t  h_info,
const cs_cell_mesh_t cm,
cs_cell_builder_t cb 
)

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

Parameters
[in]h_infopointer to a cs_param_hodge_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_hodge_vb_wbs_get_stiffness()

void cs_hodge_vb_wbs_get_stiffness ( const cs_param_hodge_t  h_info,
const cs_cell_mesh_t cm,
cs_cell_builder_t cb 
)

Build a local stiffness matrix using the generic WBS algo. WBS standing for Whitney Barycentric Subdivision (WBS) algo.

Parameters
[in]h_infopointer to a cs_param_hodge_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_hodge_vcb_get_stiffness()

void cs_hodge_vcb_get_stiffness ( const cs_param_hodge_t  h_info,
const cs_cell_mesh_t cm,
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.

Parameters
[in]h_infopointer to a cs_param_hodge_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_hodge_vcb_wbs_get()

void cs_hodge_vcb_wbs_get ( const cs_param_hodge_t  h_info,
const cs_cell_mesh_t cm,
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.

Parameters
[in]h_infopointer to a cs_param_hodge_t structure
[in]cmpointer to a cs_cell_mesh_t struct.
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_hodge_vpcd_voro_get()

void cs_hodge_vpcd_voro_get ( const cs_param_hodge_t  h_info,
const cs_cell_mesh_t cm,
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.

Parameters
[in]h_infopointer to a cs_param_hodge_t structure
[in]cmpointer to a cs_cell_mesh_t struct.
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_hodge_vpcd_wbs_get()

void cs_hodge_vpcd_wbs_get ( const cs_param_hodge_t  h_info,
const cs_cell_mesh_t cm,
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.

Parameters
[in]h_infopointer to a cs_param_hodge_t structure
[in]cmpointer to a cs_cell_mesh_t struct.
[in,out]cbpointer to a cs_cell_builder_t structure

Variable Documentation

◆ cs_hodge_vc_coef

const double cs_hodge_vc_coef = 3./20
static