pygeon.discretizations.vem.h1 module
Module for the discretizations of the H1 space.
- class pygeon.discretizations.vem.h1.VLagrange1(keyword='unitary_data')[source]
Bases:
Lagrange1Discretization class for the virtual Lagrange1 method.
- poly_order = 1
Polynomial degree of the basis functions
- tensor_order = 0
Scalar-valued discretization
- assemble_mass_matrix(sd, data=None)[source]
Assembles and returns the mass matrix.
- Parameters:
sd (pg.Grid) – The grid.
data (dict | None) – Optional data for the assembly process.
- Returns:
The sparse mass matrix obtained from the discretization.
- Return type:
sps.csc_array
- assemble_loc_mass_matrix(sd, cell, diam, nodes)[source]
Computes the local VEM mass matrix on a given cell according to the Hitchhiker’s (6.5)
- Parameters:
- Returns:
The computed local VEM mass matrix.
- Return type:
np.ndarray
- assemble_loc_proj_to_mon(sd, cell, diam, nodes)[source]
Computes the local projection onto the monomials. Returns the coefficients \(\{a_i\}\) in the expansion
\[a_0 + \frac{1}{d}[a_1, a_2] \cdot (x - c)\]for each VL1 basis function.
- Parameters:
- Returns:
The coefficients of the local projection onto the monomials.
- Return type:
np.ndarray
- assemble_loc_L2proj_lhs(sd, cell, diam, nodes)[source]
Returns the system G from the Hitchhiker’s (3.9)
- assemble_loc_L2proj_rhs(sd, cell, diam, nodes)[source]
Returns the righthand side B from the Hitchhiker’s (3.14)
- assemble_loc_monomial_mass(sd, cell, diam)[source]
Computes the inner products of the monomials
\[\left\{1, \frac{x - c}{d}, \frac{y - c}{d}\right\}\]Reference: Hitchhiker’s (5.3)
- assemble_loc_dofs_of_monomials(sd, cell, diam, nodes)[source]
Returns the matrix D from the Hitchhiker’s (3.17)
- assemble_stiff_matrix(sd, data=None)[source]
Assembles and returns the stiffness matrix.
- Parameters:
sd (pg.Grid) – The grid.
data (dict | None) – Optional data for the assembly process.
- Returns:
The stiffness matrix obtained from the discretization.
- Return type:
sps.csc_array
- assemble_loc_stiff_matrix(sd, cell, diam, nodes)[source]
Computes the local VEM stiffness matrix on a given cell according to the Hitchhiker’s (3.25)
- Parameters:
- Returns:
The computed local VEM stiffness matrix.
- Return type:
np.ndarray
- get_range_discr_class(dim)[source]
Returns the range discretization class for the given dimension.
- Parameters:
dim (int) – The dimension of the range.
- Returns:
The range discretization class.
- Return type:
pg.Discretization
- Raises:
NotImplementedError – This method is not implemented and should be overridden in a subclass.