pygeon.grids.create_grid module
Create grids from various sources.
- pygeon.grids.create_grid.grid_from_domain(domain, mesh_size, as_mdg=True, **kwargs)[source]
Create a grid from a domain with a specified mesh size.
- Parameters:
domain (pp.Domain) – The domain of the grid.
mesh_size (float) – The desired mesh size for the grid.
as_mdg (bool) – Return the grid as a mixed-dimensional grid. Default True.
**kwargs –
Additional options for creating the grid:
mesh_size_min (float): The minimum mesh size. Default is mesh_size / 10.
- Returns:
Either a pg.MixedDimensionalGrid or a pg.Grid, depending on the value of as_mdg.
- pygeon.grids.create_grid.grid_from_boundary_pts(pts, mesh_size, as_mdg=True, **kwargs)[source]
Create a 2D grid from a set of nodes, where portions of the boundary of the grid are constructed from subsequent nodes, with a given mesh size.
- Parameters:
- Returns:
Either a pg.MixedDimensionalGrid or a pg.Grid.
- pygeon.grids.create_grid.unit_grid(dim, mesh_size, as_mdg=True, **kwargs)[source]
Create a unit square or cube grid with a given mesh size.
- Parameters:
dim (int) – The dimension of the grid.
mesh_size (float) – The desired mesh size.
as_mdg (bool) – Return the grid as a mixed-dimensional grid. Default True.
kwargs –
Additional options:
mesh_size_min (float): The minimum mesh size. Default is the same as mesh_size.
structured (bool): If True, create a structured grid.
- Returns:
Either a pg.MixedDimensionalGrid or a pg.Grid.