Subgrid

Subgrids of an ExtendableGrid are again of the same type ExtendableGrid and unse the typed Dict mechanism to store linkage to the parent grid.

grid=simplexgrid([1,2,3], [4,5,6])sub=subgrid(grid,[2],boundary=true, transform=(a,b) -> (a[1]=10*b[2]))println(keys(sub))println(sub[Coordinates])
Type{<:AbstractGridComponent}[CellNodes, ParentGrid, BFaceNodes, Coordinates, CellParents, BFaceGeometries, CellRegions, CoordinateSystem, NodeParents, NumBFaceRegions, CellGeometries, ParentGridRelation, BFaceRegions]
[40 50 60]

Given a vector on the parent grid, one can create a view of this vecotor on the subgrid:

grid=simplexgrid([1,2,3], [4,5,6])sub=subgrid(grid,[2],boundary=true, transform=(a,b) -> (a[1]=10*b[2]))v=[i for i=1:num_nodes(grid)]subv=view(v,sub)println(subv)
[3, 6, 9]

API

ExtendableGrids.EdgeParents — Type
abstract type EdgeParents <: AbstractGridIntegerArray1D

Grid component key type for storing parent edges (only for SubGrid relation when EdgeNodes is instantiated)

source
ExtendableGrids.FaceParents — Type
abstract type FaceParents <: AbstractGridIntegerArray1D

Grid component key type for storing parent faces (only for SubGrid relation when FaceNodes is instantiated)

source
ExtendableGrids.NodeParents — Type
abstract type NodeParents <: AbstractGridIntegerArray1D

Grid component key type for storing node parents (=ids of nodes in ParentGrid) in an array

source
ExtendableGrids.RefinedGrid — Type
abstract type RefinedGrid <: ParentGridRelation

Grid component key type for indicating that grid is a refinement of the parentgrid

source
ExtendableGrids.SubGrid — Type
abstract type SubGrid{support} <: ParentGridRelation

Grid component key type for indicating that grid is a subgrid of the parentgrid

source
ExtendableGrids.subgrid — Method
subgrid(parent,                                                             
        subregions::AbstractArray;                                          
        transform::T = (a, b) -> a .= b[1:length(a)],
        boundary=false,                                                     
        coordinatesystem=codim1_coordinatesystem(parent[CoordinateSystem]), 
        project=true) where T

Create subgrid from list of regions.

  • parent: parent grid
  • subregions: Array of subregions which define the subgrid
  • 'support': support of subgrid, default is ONCELLS but can be also ONFACES or ON_BFACES to create codimension 1 subgrid from face/bfaces region
  • boundary: if true, create codimension 1 subgrid from boundary regions (same as support = ON_BFACES)
  • transform (kw parameter): transformation function between grid and subgrid coordinates acting on one point.
  • coordinatesystem: if boundary==true, specify coordinate system for the boundary. Default: if parent coordinatesystem is cartesian, just the corresponding codim1 coordinatesystem, otherwise: nothing, requiring user specification for use of e.g. CellFinder with the subgrid.
  • project: project coordinates onto subgrid dimension

A subgrid is of type ExtendableGrid and stores two additional components: ParentGrid and NodeParents

source

Deprecated component names