![]() |
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_sort.h"
#include "cs_evaluate.h"
#include "cs_cdo_toolbox.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 struct _cost_quant_t * | _init_cost_quant (int n_max_ent) |
Allocate and initialize a _cost_quant_t structure. More... | |
static struct _cost_quant_t * | _free_cost_quant (struct _cost_quant_t *hq) |
Free a cs_hodge_costq_t structure. More... | |
static void | _compute_cost_quant (int n_loc_ent, const cs_real_33_t ptymat, const cs_nvec3_t *pq, const cs_nvec3_t *dq, struct _cost_quant_t *hq) |
Compute quantities used for defining the entries of the discrete Hodge for COST algo. and edge/face quantities. 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, struct _cost_quant_t *hq) |
Build a local discrete Hodge operator using the generic COST algo. More... | |
static struct _wbs_quant_t * | _init_wbs_quant (int n_ent_max, int aux_bufsize, cs_lnum_t n_vertices) |
Build a structure used to compute a discrete Hodge op. when using WBS algo. More... | |
static struct _wbs_quant_t * | _free_wbs_quant (struct _wbs_quant_t *hq) |
Free a structure used to compute a discrete Hodge op. when using WBS algo. More... | |
static void | _compute_wbs_face_quant (cs_lnum_t f_id, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, struct _wbs_quant_t *hq) |
Compute for each face a weight related to each vertex w_{v,f} This weight is equal to |dc(v) cap f|/|f| so that the sum of the weights is equal to 1. Set also the local and local numbering of the vertices of this face. More... | |
static void | _build_using_wbs (int cid, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, cs_hodge_builder_t *hb, struct _wbs_quant_t *hq) |
Build a local discrete Hodge operator using a conforming algo. based on the barycentric subdivision of a polyhedron. This construction is cellwise. Note: the local matrix is stored inside hb->hloc. 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... | |
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... | |
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... | |
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 a discrete Hodge operator. More... | |
Build discrete Hodge operators.
|
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. |
[in,out] | hq | pointer to a _cost_quant_t structure |
|
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 a conforming algo. based on the barycentric subdivision of a polyhedron. This construction is cellwise. Note: the local matrix is stored inside hb->hloc.
[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. |
[in,out] | hq | pointer to a _wbs_quant_t structure |
|
static |
Compute quantities used for defining the entries of the discrete Hodge for COST algo. and edge/face quantities.
[in] | n_loc_ent | number of local entities |
[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] | hq | pointer to a _cost_quant_t structure |
|
static |
Compute for each face a weight related to each vertex w_{v,f} This weight is equal to |dc(v) cap f|/|f| so that the sum of the weights is equal to 1. Set also the local and local numbering of the vertices of this face.
[in] | f_id | id of the face |
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | quant | pointer to a cs_cdo_quantites_t structure |
[in,out] | hq | pointer to a _wbs_quant_t structure |
|
static |
Free a cs_hodge_costq_t structure.
[in] | hq | pointer to the cs_hodge_costq_t struct. to free |
|
static |
Free a structure used to compute a discrete Hodge op. when using WBS algo.
[in] | hq | pointer to a _wbs_quant_t structure |
|
static |
Allocate and initialize a _cost_quant_t structure.
[in] | n_max_ent | max number of entities by primal cell |
|
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.
(end ignore by Doxygen)
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | quant | pointer to a cs_cdo_quantities_t structure |
|
static |
Build a structure used to compute a discrete Hodge op. when using WBS algo.
[in] | n_ent_max | max number of local entities |
[in] | aux_bufsize | size of the auxiliary buffers |
[in] | n_vertices | number of vertices in this mesh |
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. |
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 |
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 |
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 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. |