porepy.numerics.vem.mvem module

Module with implementation of the mixed virtual element method.

The main class is MVEM.

class MVEM(keyword)[source]

Bases: DualElliptic

Implementation of the lowest order mixed virtual element method for scalar elliptic equations.

Parameters

keyword (str) –

static check_conservation(sd, u)[source]

Return the local conservation of mass in the cells. Parameters ———- sd: grid, or a subclass. u : array (sd.num_faces) velocity at each face.

Parameters
Return type

ndarray

discretize(sd, data)[source]

Discretize a second order elliptic equation using a dual virtual element method.

We assume the following two sub-dictionaries to be present in the data dictionary:

parameter_dictionary, storing all parameters.

Stored in data[pp.PARAMETERS][self.keyword].

matrix_dictionary, for storage of discretization matrices.

Stored in data[pp.DISCRETIZATION_MATRICES][self.keyword]

deviation_from_plane_tol: The geometrical tolerance, used in the check to

rotate 2d and 1d grids

parameter_dictionary contains the entries:
second_order_tensor: (pp.SecondOrderTensor) Permeability defined

cell-wise. This is the effective permeability, including any aperture scalings etc.

matrix_dictionary will be updated with the following entries:

mass: sps.csc_matrix (sd.num_faces, sd.num_faces) The mass matrix. div: sps.csc_matrix (sd.num_cells, sd.num_faces) The divergence matrix.

Optional parameter:

is_tangential: Whether the lower-dimensional permeability tensor has been

rotated to the fracture plane. Defaults to False. Stored in the data dictionary.

Parameters
Return type

None

static massHdiv(K, inv_K, c_center, c_volume, f_centers, normals, sign, diam, weight=0.0)[source]

Compute the local mass Hdiv matrix using the mixed vem approach.

Parameters

Kndarray (sd.dim, sd.dim)

Permeability of the cell.

c_centerarray (sd.dim)

Cell center.

c_volumescalar

Cell volume.

f_centersndarray (sd.dim, num_faces_of_cell)

Center of the cell faces.

normalsndarray (sd.dim, num_faces_of_cell)

Normal of the cell faces weighted by the face areas.

signarray (num_faces_of_cell)

+1 or -1 if the normal is inward or outward to the cell.

diamscalar

Diameter of the cell.

weightscalar

weight for the stabilization term. Optional, default = 0.

Return

out: ndarray (num_faces_of_cell, num_faces_of_cell)

Local mass Hdiv matrix.

Parameters
Return type

tuple[numpy.ndarray, numpy.ndarray]