<jupyter_start><jupyter_text>Using the Landlab `FractureGridGenerator` component*(<NAME>, University of Colorado Boulder, July 2021)* IntroductionLandlab' `FractureGridGenerator` is a small helper component that generates a grid in which are embedded a set of randomly aligned fractures. A fracture is described by a line of nodes for which the field `fracture_at_node` equals 1. In other words, nodes where `fracture_at_node = 1` contain one or more fractures running through or near them, and nodes where `fracture_at_node = 0` are devoid of fractures. The component was originally written to initialize a cellular automaton model of rock weathering along fracture zones. An example of a gridded fracture network used in this way can be found in [Tucker et al. (2016)](https://doi.org/10.5194/gmd-9-823-2016) Figure 9.  Simple example with a raster grid<jupyter_code>import copy
import numpy as np
import matplotlib as mpl
from landlab import RasterModelGrid, imshow_grid
from landlab.components import FractureGridGenerator
grid = RasterModelGrid((51, 51))
fg = FractureGridGenerator(grid, frac_spacing=20)
fg.run_one_step()
cmap = copy.copy(mpl.cm.get_cmap("pink"))
imshow_grid(grid, grid.at_node["fracture_at_node"], cmap=cmap)<jupyter_output><empty_output><jupyter_text>Example with a hex gridThis example also shows how you can use the optional `seed` parameter to get a different random pattern.<jupyter_code>from landlab import HexModelGrid
grid = HexModelGrid((51, 51), node_layout="rect")
fg = FractureGridGenerator(grid, frac_spacing=10, seed=4)
fg.run_one_step()
cmap = copy.copy(mpl.cm.get_cmap("pink"))
imshow_grid(grid, grid.at_node["fracture_at_node"], cmap=cmap)<jupyter_output><empty_output><jupyter_text>Vertically oriented hex grid<jupyter_code>grid = HexModelGrid((51, 51), node_layout="rect", orientation="vertical")
fg = FractureGridGenerator(grid, frac_spacing=10, seed=3)
fg.run_one_step()
cmap = copy.copy(mpl.cm.get_cmap("pink"))
imshow_grid(grid, grid.at_node["fracture_at_node"], cmap=cmap)<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup