pmgbergen / porepy

Python Simulation Tool for Fractured and Deformable Porous Media

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cell size smaller than domain size

IvarStefansson opened this issue · comments

For tensor_grid, passing a cell_size smaller than the domain size to create_mdg produces a grid without cells. Suggested fix: Add check to argument validation functions and either raise error or set cell_size = domain_size.
Cartesian grids were not tested.

Partial MVE:

Add following to any model and run prepare_simulation.

from porepy.applications.md_grids.model_geometries import (
    SquareDomainOrthogonalFractures,
)
class GeometryMixin(SquareDomainOrthogonalFractures):
    def grid_type(self) -> Literal["simplex", "cartesian", "tensor_grid"]:
        """Grid type for the mixed-dimensional grid.

        Returns:
            Grid type for the mixed-dimensional grid.

        """
        return "grid_type", "tensor_grid"

    def meshing_arguments(self) -> dict[str, float]:
        """Meshing arguments for mixed-dimensional grid generation.

        """
        meshing_args: dict[str, float] = {"cell_size": self.domain_size * 5}
        meshing_args["x_pts"] = np.linspace(0, self.domain_size, 3)
        return meshing_args