![]() |
programmer's documentation
|
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 <bft_printf.h>
#include "cs_cdo_scheme_geometry.h"
#include "cs_math.h"
#include "cs_sort.h"
#include "cs_timer_stats.h"
#include "cs_hodge.h"
Functions | |
static cs_sla_matrix_t * | _init_hodge_vertex (const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant) |
Allocate and initialize by default the matrix related to a discrete Hodge op. based on vertices Note: values are filled in a second step. More... | |
static cs_sla_matrix_t * | _init_hodge_edge (const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant) |
Allocate and initialize by default the matrix related to a discrete Hodge op. based on edges Note: values are filled in a second step. More... | |
static cs_sla_matrix_t * | _init_hodge_face (const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant) |
Allocate and initialize by default the matrix related to a discrete Hodge op. based on faces Note: values are filled in a second step. More... | |
static void | _compute_cost_quant (const int n_ent, const double invcvol, const cs_real_33_t ptymat, const cs_real_3_t *pq, const cs_real_3_t *dq, double *alpha, double *kappa, cs_locmat_t *hloc) |
Compute quantities used for defining the entries of the discrete Hodge for COST algo. Initialize the local discrete Hodge op. with the consistency part. More... | |
static void | _cellwise_build_with_cost (const cs_cell_mesh_t *cm, cs_hodge_builder_t *hb) |
Build a local discrete Hodge operator using the generic COST algo. and cellwise view of the mesh COST means COnsistency + STabilization. More... | |
static void | _build_using_cost (int cid, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, cs_hodge_builder_t *hb) |
Build a local discrete Hodge operator using the generic COST algo. More... | |
static void | _build_stiffness_using_cost (const cs_cell_mesh_t *cm, cs_hodge_builder_t *hb, cs_locmat_t *sloc) |
Build a local stiffness matrix using the generic COST algo. More... | |
static void | _cellwise_build_with_wbs (const cs_cell_mesh_t *cm, cs_hodge_builder_t *hb) |
Build a local discrete Hodge operator using the generic WBS algo. and cellwise view of the mesh WBS means Whitney Barycentric Subdivision. More... | |
static void | _cellwise_build_with_hvc (const cs_cell_mesh_t *cm, cs_hodge_builder_t *hb) |
Build a local discrete Hodge V+C operator using the WBS algorithm and a cellwise view of the mesh WBS means Whitney Barycentric Subdivision. More... | |
static void | _build_stiffness_using_voronoi (const cs_cell_mesh_t *cm, cs_hodge_builder_t *hb, cs_locmat_t *sloc) |
Build a local stiffness matrix using the Voronoi algorithm. More... | |
static void | _cellwise_build_with_voronoi (const cs_cell_mesh_t *cm, cs_hodge_builder_t *hb) |
Build a local discrete Hodge op. using the Voronoi algo. More... | |
static void | _build_using_voronoi (cs_lnum_t c_id, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, cs_hodge_builder_t *hb) |
Build a local discrete Hodge op. using the Voronoi algo. More... | |
void | cs_hodge_set_timer_stats (int level) |
Initialize cs_timer_stats_t structure for monitoring purpose. More... | |
cs_hodge_builder_t * | cs_hodge_builder_init (const cs_cdo_connect_t *connect, cs_param_hodge_t h_info) |
Allocate and initialize a cs_hodge_builder_t structure. More... | |
cs_hodge_builder_t * | cs_hodge_builder_free (cs_hodge_builder_t *hb) |
Free a cs_hodge_builder_t structure. More... | |
bool | cs_hodge_builder_get_setting_flag (cs_hodge_builder_t *hb) |
Get the flag indicating the status of the property. More... | |
void | cs_hodge_builder_unset (cs_hodge_builder_t *hb) |
Set the flag indicating the status of the property to false. More... | |
void | cs_hodge_builder_set_val (cs_hodge_builder_t *hb, cs_real_t ptyval) |
Set the value of the property attached to a hodge builder. More... | |
void | cs_hodge_builder_set_tensor (cs_hodge_builder_t *hb, const cs_real_33_t ptymat) |
Set the value of the property attached to a hodge builder. More... | |
void | cs_hodge_build_local_stiffness (const cs_cell_mesh_t *cm, cs_hodge_builder_t *hb, cs_locmat_t *sloc) |
Build a local stiffness matrix from a local discrete Hodge H and the local discrete gradient and divergence S = Gloc^t * H * Gloc. More... | |
cs_locmat_t * | cs_hodge_build_cellwise (const cs_cell_mesh_t *cm, cs_hodge_builder_t *hb) |
Build a local discrete Hodge using a cell-wise view of the mesh. More... | |
cs_locmat_t * | cs_hodge_build_local (int c_id, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, cs_hodge_builder_t *hb) |
Build a local discrete Hodge. More... | |
cs_sla_matrix_t * | cs_hodge_compute (const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_property_t *pty, const cs_param_hodge_t h_info) |
Build the full matrix related to a discrete Hodge operator. More... | |
Variables | |
static const double | cs_hodge_wbs_const = 1/60. |
static const double | cs_hodge_vc_coef = 3./20 |
Build discrete Hodge operators.
|
static |
Build a local stiffness matrix using the generic COST algo.
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in,out] | hb | pointer to a cs_hodge_builder_t struct. |
[in,out] | sloc | pointer to a local matrix structure |
|
static |
Build a local stiffness matrix using the Voronoi algorithm.
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in,out] | hb | pointer to a cs_hodge_builder_t struct. |
[in,out] | sloc | pointer to a local matrix structure |
|
static |
Build a local discrete Hodge operator using the generic COST algo.
[in] | cid | cell id |
[in] | connect | pointer to a cs_cdo_connect_t struct. |
[in] | quant | pointer to a cs_cdo_quantities_t struct. |
[in,out] | hb | pointer to a cs_hodge_builder_t struct. |
|
static |
Build a local discrete Hodge op. using the Voronoi algo.
[in] | c_id | cell id |
[in] | connect | pointer to a cs_cdo_connect_t struct. |
[in] | quant | pointer to a cs_cdo_quantities_t struct. |
[in,out] | hb | pointer to a cs_hodge_builder_t struct. |
|
static |
Build a local discrete Hodge operator using the generic COST algo. and cellwise view of the mesh COST means COnsistency + STabilization.
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in,out] | hb | pointer to a cs_hodge_builder_t structure |
|
static |
Build a local discrete Hodge V+C operator using the WBS algorithm and a cellwise view of the mesh WBS means Whitney Barycentric Subdivision.
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in,out] | hb | pointer to a cs_hodge_builder_t structure |
|
static |
Build a local discrete Hodge op. using the Voronoi algo.
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in,out] | hb | pointer to a cs_hodge_builder_t struct. |
|
static |
Build a local discrete Hodge operator using the generic WBS algo. and cellwise view of the mesh WBS means Whitney Barycentric Subdivision.
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in,out] | hb | pointer to a cs_hodge_builder_t structure |
|
static |
Compute quantities used for defining the entries of the discrete Hodge for COST algo. Initialize the local discrete Hodge op. with the consistency part.
[in] | n_ent | number of local entities |
[in] | invcvol | 1/|c| |
[in] | ptymat | values of the tensor related to the material pty |
[in] | pq | pointer to the first set of quantities |
[in] | dq | pointer to the second set of quantities |
[in,out] | alpha | geometrical quantity |
[in,out] | kappa | geometrical quantity |
[in,out] | hloc | pointer to a cs_locmat_t struct. |
|
static |
Allocate and initialize by default the matrix related to a discrete Hodge op. based on edges Note: values are filled in a second step.
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | quant | pointer to a cs_cdo_quantities_t structure |
|
static |
Allocate and initialize by default the matrix related to a discrete Hodge op. based on faces Note: values are filled in a second step.
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | quant | pointer to a cs_cdo_quantities_t structure |
|
static |
Allocate and initialize by default the matrix related to a discrete Hodge op. based on vertices Note: values are filled in a second step.
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | quant | pointer to a cs_cdo_quantities_t structure |
cs_locmat_t* cs_hodge_build_cellwise | ( | const cs_cell_mesh_t * | cm, |
cs_hodge_builder_t * | hb | ||
) |
Build a local discrete Hodge using a cell-wise view of the mesh.
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in,out] | hb | pointer to a cs_hodge_builder_t structure |
cs_locmat_t* cs_hodge_build_local | ( | int | c_id, |
const cs_cdo_connect_t * | connect, | ||
const cs_cdo_quantities_t * | quant, | ||
cs_hodge_builder_t * | hb | ||
) |
Build a local discrete Hodge.
[in] | c_id | cell id |
[in] | connect | pointer to a cs_cdo_connect_t struct. |
[in] | quant | pointer to a cs_cdo_quantities_t struct. |
[in,out] | hb | pointer to a cs_hodge_builder_t struct. |
void cs_hodge_build_local_stiffness | ( | const cs_cell_mesh_t * | cm, |
cs_hodge_builder_t * | hb, | ||
cs_locmat_t * | sloc | ||
) |
Build a local stiffness matrix from a local discrete Hodge H and the local discrete gradient and divergence S = Gloc^t * H * Gloc.
[in] | cm | pointer to a cs_cell_mesh_t struct. |
[in,out] | hb | pointer to a cs_hodge_builder_t struct. |
[in,out] | sloc | pointer to a local stiffness matrix struct. |
cs_hodge_builder_t* cs_hodge_builder_free | ( | cs_hodge_builder_t * | hb | ) |
Free a cs_hodge_builder_t structure.
[in] | hb | pointer to the cs_hodge_builder_t struct. to free |
bool cs_hodge_builder_get_setting_flag | ( | cs_hodge_builder_t * | hb | ) |
Get the flag indicating the status of the property.
[in,out] | hb | pointer to a cs_hodge_builder_t structure |
cs_hodge_builder_t* cs_hodge_builder_init | ( | const cs_cdo_connect_t * | connect, |
cs_param_hodge_t | h_info | ||
) |
Allocate and initialize a cs_hodge_builder_t structure.
[in] | connect | pointer to a cs_cdo_connect_t struct. |
[in] | h_info | algorithm used to build the discrete Hodge op. |
void cs_hodge_builder_set_tensor | ( | cs_hodge_builder_t * | hb, |
const cs_real_33_t | ptymat | ||
) |
Set the value of the property attached to a hodge builder.
[in,out] | hb | pointer to a cs_hodge_builder_t structure |
[in] | ptymat | values of the tensor related to a property |
void cs_hodge_builder_set_val | ( | cs_hodge_builder_t * | hb, |
cs_real_t | ptyval | ||
) |
Set the value of the property attached to a hodge builder.
[in,out] | hb | pointer to a cs_hodge_builder_t structure |
[in] | ptyval | value of the property |
void cs_hodge_builder_unset | ( | cs_hodge_builder_t * | hb | ) |
Set the flag indicating the status of the property to false.
[in,out] | hb | pointer to a cs_hodge_builder_t structure |
cs_sla_matrix_t* cs_hodge_compute | ( | const cs_cdo_connect_t * | connect, |
const cs_cdo_quantities_t * | quant, | ||
const cs_property_t * | pty, | ||
const cs_param_hodge_t | h_info | ||
) |
Build the full matrix related to a discrete Hodge operator.
[in] | connect | pointer to a cs_cdo_connect_t struct. |
[in] | quant | pointer to a cs_cdo_quantities_t struct. |
[in] | pty | pointer to a cs_property_t struct. |
[in] | h_info | pointer to a cs_param_hodge_t struct. |
void cs_hodge_set_timer_stats | ( | int | level | ) |
Initialize cs_timer_stats_t structure for monitoring purpose.
[in] | level | level of details requested |
|
static |
|
static |
(end ignore by Doxygen)