H2Lib
3.0
|
Lowest order Raviart-Thomas space on a three-dimensional tetrahedral mesh. More...
Data Structures | |
struct | _tet3drt0 |
Representation of a trial space with lowest order Raviart-Thomas basis functions on a three-dimensional tetrahedral mesh. More... | |
Typedefs | |
typedef struct _tet3drt0 | tet3drt0 |
Representation of a trial space with Raviart-Thomas edge basis functions on a three-dimensional tetrahedral mesh. | |
typedef tet3drt0 * | ptet3drt0 |
Pointer to tet3drt0 object. | |
typedef const tet3drt0 * | pctet3drt0 |
Pointer to a constant tet3drt0 object. | |
Functions | |
ptet3drt0 | new_tet3drt0 (pctet3d gr) |
Create a tet3drt0 object using a tet3d mesh. More... | |
void | update_tet3drt0 (ptet3drt0 rt0) |
Update the numbers of degrees of freedoms and fixed faces after mixed boundary conditions were set. More... | |
void | del_tet3drt0 (ptet3drt0 rt) |
Delete a tet3drt0 object. More... | |
psparsematrix | build_tet3drt0_A_sparsematrix (pctet3drt0 dc) |
Create a sparsematrix with a sparsity pattern matching the lowest order Raviart-Thomas functions and representing the upper left block of the saddle-point problem. More... | |
psparsematrix | build_tet3drt0_B_sparsematrix (pctet3drt0 dc) |
Create a sparsematrix with a sparsity pattern matching the lowest order Raviart-Thomas functions for the flux and piecewise- constant functions for the pressure representing the lower left block of the saddle-point problem. More... | |
psparsematrix | build_tet3drt0_A_interaction_sparsematrix (pctet3drt0 dc) |
Create a sparsematrix with a sparsity pattern matching the lowest order Raviart-Thomas functions and representing the upper left block of the saddle-point problem representing the interaction matrix. More... | |
psparsematrix | build_tet3drt0_B_interaction_sparsematrix (pctet3drt0 dc) |
Create a sparsematrix with a sparsity pattern matching the lowest order Raviart-Thomas functions for the flux and piecewise- constant functions for the pressure representing the lower left block of the saddle-point problem representing the interaction matrix. More... | |
void | assemble_tet3drt0_darcy_A_sparsematrix (pctet3drt0 dc, psparsematrix A, psparsematrix Af, pavector K) |
Assemble the upper left block of the system matrix. More... | |
void | assemble_tet3drt0_darcy_B_sparsematrix (pctet3drt0 dc, psparsematrix A, psparsematrix Af) |
Assemble the lower left block of the system matrix. More... | |
void | assemble_tet3drt0_b_D_avector (pctet3drt0 dc, field(*f)(const real *e, void *fdata), void *fdata, pavector d) |
Discretize Dirichlet boundary values. More... | |
void | assemble_tet3drt0_b_f_avector (ptet3drt0 dc, field(*f)(const real *x, void *fdata), void *fdata, pavector fv) |
Discretize an -functional. More... | |
void | assemble_tet3drt0_g_N_avector (ptet3drt0 dc, field(*f)(const uint *e, void *data), void *data, pavector g) |
Discretize Neumann Boundary values. More... | |
real | norml2_pressure_centroid_tet3drt0 (pctet3drt0 dc, field(*f)(const real *x, void *fdata), void *fdata, pcavector x2) |
Compute the -norm of the discretization error for the pressure using the centroid rule. More... | |
real | norml2_pressure_facemidpoint_tet3drt0 (pctet3drt0 dc, field(*f)(const real *x, void *fdata), void *fdata, pcavector x2) |
Compute the -norm of the discretization error for the pressure using the centroid rule. More... | |
real | norml2_flux_centroid_tet3drt0 (pctet3drt0 dc, void(*q)(const real *x, void *fdata, pavector v), void *fdata, pcavector x1, pcavector g) |
Compute the -norm of the discretization error for the flux using the centroid rule. More... | |
real | norml2_flux_facemidpoint_tet3drt0 (pctet3drt0 dc, void(*q)(const real *x, void *fdata, pavector v), void *fdata, pcavector x1, pcavector g) |
Compute the -norm of the discretization error for the flux using the face midpoint rule. More... | |
pclustergeometry | build_tet3drt0_A_clustergeometry (pctet3drt0 rt, uint *idx) |
Create a clustergeometry object for the clustering ofthe degrees of freedom (edges). More... | |
pclustergeometry | build_tet3drt0_B_clustergeometry (pctet3drt0 rt, uint *idx) |
Create a clustergeometry object for the clustering of the triangles. More... | |
Lowest order Raviart-Thomas space on a three-dimensional tetrahedral mesh.
E.g., this space is useful to discretize darcy's flow(Raviart-Thomas) and conservation of mass (piecewise constant functions), this leads to a saddle-point problem:
void assemble_tet3drt0_b_D_avector | ( | pctet3drt0 | dc, |
field(*)(const real *e, void *fdata) | f, | ||
void * | fdata, | ||
pavector | d | ||
) |
Discretize Dirichlet boundary values.
For each Dirichlet face, the function is evaluated with the face midpoint rule and the result is written to the corresponding entry in the result vector. for each non boundary face the corresponding entry is zero.
dc | tet3drt0 object describing the trial space. |
f | Dirichlet boundary values. |
fdata | Additional data for f . |
d | Target vector of dimension dc->nfix . |
void assemble_tet3drt0_b_f_avector | ( | ptet3drt0 | dc, |
field(*)(const real *x, void *fdata) | f, | ||
void * | fdata, | ||
pavector | fv | ||
) |
Discretize an -functional.
For each tetrahedron the entry of is computed by applying the face-midpoint quadrature. Since is cleared before this step, the result is given by .
dc | tet3drt0 object describing the trial space. |
f | Right-hand side function of the conservation of mass. |
fdata | Additional data for f . |
fv | Target vector of dimension dc->t2->triangles . |
void assemble_tet3drt0_darcy_A_sparsematrix | ( | pctet3drt0 | dc, |
psparsematrix | A, | ||
psparsematrix | Af, | ||
pavector | K | ||
) |
Assemble the upper left block of the system matrix.
Element matrices for all triangles are computed and added to the corresponding entries in A
and Af
.
dc | tet3drt0 object describing the trial space. |
A | Target matrix for degrees of freedom. |
Af | Target matrix for interactions between fixed vertices and degrees of freedom. |
K | Vector of length dc->t3->tetrahedra filled with a (constant) permeability for each element |
void assemble_tet3drt0_darcy_B_sparsematrix | ( | pctet3drt0 | dc, |
psparsematrix | A, | ||
psparsematrix | Af | ||
) |
Assemble the lower left block of the system matrix.
Element matrices for all triangles are computed and added to the corresponding entries in A
and Af
.
dc | tet3drt0 object describing the trial space. |
A | Target matrix for degrees of freedom. |
Af | Target matrix for interactions between fixed vertices and degrees of freedom. |
void assemble_tet3drt0_g_N_avector | ( | ptet3drt0 | dc, |
field(*)(const uint *e, void *data) | f, | ||
void * | data, | ||
pavector | g | ||
) |
Discretize Neumann Boundary values.
Subtracting resp. from the right-hand side of our equation, where resp. is the interaction matrix, yields the right-hand side of the problem with Neumann boundary conditions.
dc | tet3drt0 object describing the trial space. |
f | Neumann Boundary values. |
data | Additional data for f . |
g | Target vector of dimension dc->nfix . |
pclustergeometry build_tet3drt0_A_clustergeometry | ( | pctet3drt0 | rt, |
uint * | idx | ||
) |
Create a clustergeometry object for the clustering ofthe degrees of freedom (edges).
Create a clustergeometry object basing on a triangular tri2d mesh and Raviart-Thomas functions.
rt | tet3drt0 object. |
idx | Array of indices (here: for the degrees of freedoms (edges)). |
psparsematrix build_tet3drt0_A_interaction_sparsematrix | ( | pctet3drt0 | dc | ) |
Create a sparsematrix with a sparsity pattern matching the lowest order Raviart-Thomas functions and representing the upper left block of the saddle-point problem representing the interaction matrix.
Creates a sparse matrix matching the Raviart-Thomas functions: if the supports of basis functions and share one tetrahedron, the entry appears in the graph of the matrix.
Here, only refers to a degree of freedom, while is the index of a fixed edge, i.e. has to be between 0
and nfix-1
.
dc | tet3drt0 object describing the space. |
dc->ndof
rows and dc->nfix
columns. psparsematrix build_tet3drt0_A_sparsematrix | ( | pctet3drt0 | dc | ) |
Create a sparsematrix with a sparsity pattern matching the lowest order Raviart-Thomas functions and representing the upper left block of the saddle-point problem.
Creates a sparse matrix matching the Raviart-Thomas functions: if the supports of basis functions and share at least one tetrahedron, the entry appears in the graph of the matrix.
Here, both and refer to degrees of freedom, i.e., there indices are between 0
and ndof-1
.
dc | tet3drt0 object describing the space. |
dc->ndof
rows and columns. pclustergeometry build_tet3drt0_B_clustergeometry | ( | pctet3drt0 | rt, |
uint * | idx | ||
) |
Create a clustergeometry object for the clustering of the triangles.
Create a clustergeometry object basing on a triangular tri2d mesh and linear nodal basis functions.
rt | tet3drt0 object. |
idx | Array of indices (here: for the triangles). |
psparsematrix build_tet3drt0_B_interaction_sparsematrix | ( | pctet3drt0 | dc | ) |
Create a sparsematrix with a sparsity pattern matching the lowest order Raviart-Thomas functions for the flux and piecewise- constant functions for the pressure representing the lower left block of the saddle-point problem representing the interaction matrix.
Creates a sparse matrix matching the Raviart-Thomas functions for the flux and piecewise-constant functions for the pressure: if the supports of basis functions (pressure) and (flux) share at least one tetrahedron, the entry appears in the graph of the matrix.
refers to the number of tetrahedra in the mesh, i.e., the indices are between 0
and dc->t3->tetrahedra-1
and is the index of a fixed face, i.e. has to be between 0
and nfix-1
.
dc | tri2drt0 object describing the space. |
dc->t3->tetrahedra
rows anddc->nfix
columns. psparsematrix build_tet3drt0_B_sparsematrix | ( | pctet3drt0 | dc | ) |
Create a sparsematrix with a sparsity pattern matching the lowest order Raviart-Thomas functions for the flux and piecewise- constant functions for the pressure representing the lower left block of the saddle-point problem.
Creates a sparse matrix matching the Raviart-Thomas functions for the flux and piecewise-constant functions for the pressure: if the supports of basis functions (pressure) and (flux) share at least one tetrahedron, the entry appears in the graph of the matrix.
refers to the number of triangles in the mesh, i.e., the indices are between 0
and dc->t2->triangles-1
and refers to degrees of freedom,i.e., the indices are between 0
and ndof-1
.
dc | tet3drt0 object describing the space. |
dc->t3->tetrahedra
rows anddc->ndof
columns. real norml2_flux_centroid_tet3drt0 | ( | pctet3drt0 | dc, |
void(*)(const real *x, void *fdata, pavector v) | q, | ||
void * | fdata, | ||
pcavector | x1, | ||
pcavector | g | ||
) |
Compute the -norm of the discretization error for the flux using the centroid rule.
Compare the function f
for the flux to the discrete function for the flux described by the vector x1
(for the degrees of freedom) and g
(for the fixed Neumann edges). Measure the difference in the -norm using the centroid rule for approximation of the integral.
dc | tet3drt0 object describing the trial space. |
f | Function. |
fdata | Additional data for f . |
x1 | Coefficients of the discrete function. |
g | Coefficients of fixed parts of the discrete function. |
real norml2_flux_facemidpoint_tet3drt0 | ( | pctet3drt0 | dc, |
void(*)(const real *x, void *fdata, pavector v) | q, | ||
void * | fdata, | ||
pcavector | x1, | ||
pcavector | g | ||
) |
Compute the -norm of the discretization error for the flux using the face midpoint rule.
Compare the function f
for the flux to the discrete function for the flux described by the vector x1
(for the degrees of freedom) and g
(for the fixed Neumann edges). Measure the difference in the -norm using the face midpoint rule for approximation of the integral.
dc | tri2drt0 object describing the trial space. |
f | Function. |
fdata | Additional data for f . |
x1 | Coefficients of the discrete function. |
g | Coefficients of fixed parts of the discrete function. |
real norml2_pressure_centroid_tet3drt0 | ( | pctet3drt0 | dc, |
field(*)(const real *x, void *fdata) | f, | ||
void * | fdata, | ||
pcavector | x2 | ||
) |
Compute the -norm of the discretization error for the pressure using the centroid rule.
Compare the pressure function f
to the discrete function for the pressure described by the vector x2
. Measure the difference in the -norm using the midpoint rule for approximation of the integral.
dc | tet3drt0 object describing the trial space. |
f | Function. |
fdata | Additional data for f . |
x2 | Coefficients of discrete function. |
real norml2_pressure_facemidpoint_tet3drt0 | ( | pctet3drt0 | dc, |
field(*)(const real *x, void *fdata) | f, | ||
void * | fdata, | ||
pcavector | x2 | ||
) |
Compute the -norm of the discretization error for the pressure using the centroid rule.
Compare the pressure function f
to the discrete function for the pressure described by the vector x2
. Measure the difference in the -norm using the centroid rule for approximation of the integral.
dc | tet3drt0 object describing the trial space. |
f | Function. |
fdata | Additional data for f . |
x2 | Coefficients of discrete function. |
void update_tet3drt0 | ( | ptet3drt0 | rt0 | ) |
Update the numbers of degrees of freedoms and fixed faces after mixed boundary conditions were set.
Set the mixed boundary conditions in another function. Then the call of this functions updates the numbers and the numbering of degrees of freedoms and fixed faces.
rt0 | This structure is updated. |