porepy.grids.standard_grids.utils module

make_mdg_2d_cartesian(n_cells, fractures, domain)[source]

Construct a grid bucket with Cartesian grid in the 2d domain.

Parameters
  • n_cells (ndarray) – Contains number of cells in x and y direction.

  • fractures (list[numpy.ndarray]) – Each element is an np.array([[x0, x1],[y0,y1]])

  • domain (dict) – Defines the size of the rectangular domain.

Returns

Grid bucket with geometry computation and node ordering performed.

make_mdg_2d_simplex(mesh_args, points, fractures, domain)[source]

Construct a grid bucket with triangle grid in the 2d domain.

Parameters
  • mesh_args (dict) – Contains at least “mesh_size_frac”. If the optional values of “mesh_size_bound” and “mesh_size_min” are not provided, these are set by set_mesh_sizes.

  • points (ndarray) – Fracture endpoints.

  • fractures (ndarray) – Connectivity list of the fractures, pointing to the provided endpoint list.

  • domain (dict) – Defines the size of the rectangular domain.

Returns: Grid bucket with geometry computation and node ordering performed.

set_mesh_sizes(mesh_args)[source]

Checks whether mesh_size_min and mesh_size_bound are present in the mesh_args dictionary. If not, they are set to 1/5 and 2 of the mesh_size_frac value, respectively.

Parameters

mesh_args (dict) –

unit_domain(dimension)[source]

Return a domain of unitary size extending from 0 to 1 in all dimensions.

Parameters

dimension (int) – the dimension of the domain.

Returns

specification of max and min in all dimensions

Return type

dict