Region editing

Tools for editing grid region numbers

ExtendableGrids.bfacemask!Function
bfacemask!(grid::ExtendableGrid,
                maskmin,
                maskmax,
                ireg;
                allow_new=true,
                tol=1.0e-10)

Edit region numbers of grid boundary facets via rectangular mask. If allow_new is true (default), new facets are added.

ireg may be an integer or a function ireg(current_region).

A zero region number removes boundary faces.

Examples: Rectangle-with-multiple-regions

source
ExtendableGrids.rect!Function
rect!(grid,maskmin,maskmax; 
      region=1, 
      bregion=1, 
      bregions=nothing, 
      tol=1.0e-10)

Place a rectangle into a rectangular grid. It places a cellmask according to maskmin and maskmax, and introduces boundary faces via `bfacesmask! at all sides of the mask area. It is checked that the coordinate values in the mask match (with tolerance) corresponding directional coordinates of the grid.

If bregions is given it is assumed to be a vector corresponding to the number of sides, im the sequence w,e in 1D. s,e,n,w in 2D and s,e,n,w,b,t in 3D.

bregion or elements of bregions can be numbers or functions ireg(current_region).

Examples: Subgrid-from-rectangle, Rect2d-with-bregion-function, Cross3d

source
ExtendableGrids.bedgemask!Function
bedgemask!(
    grid::ExtendableGrid,
    xa,
    xb,
    ireg::Int64;
    tol
) -> ExtendableGrid

Edit region numbers of grid boundary edges via line mask. This only works for 3D grids.

source