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}[ParentGrid, ParentGridRelation, Coordinates, CoordinateSystem, CellNodes, NumBFaceRegions, BFaceRegions, CellParents, BFaceNodes, NodeParents, CellRegions, CellGeometries, BFaceGeometries]
[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.BEdgeParents — Type
abstract type BEdgeParents <: AbstractGridIntegerArray1DGrid component key type for storing parent bedges
sourceExtendableGrids.BFaceParents — Type
abstract type BFaceParents <: AbstractGridIntegerArray1DGrid component key type for storing parent bfaces
sourceExtendableGrids.CellParents — Type
abstract type CellParents <: AbstractGridIntegerArray1DGrid component key type for storing parent cells
sourceExtendableGrids.EdgeParents — Type
abstract type EdgeParents <: AbstractGridIntegerArray1DGrid component key type for storing parent edges (only for SubGrid relation when EdgeNodes is instantiated)
sourceExtendableGrids.FaceParents — Type
abstract type FaceParents <: AbstractGridIntegerArray1DGrid component key type for storing parent faces (only for SubGrid relation when FaceNodes is instantiated)
sourceExtendableGrids.NodeParents — Type
abstract type NodeParents <: AbstractGridIntegerArray1DGrid component key type for storing node parents (=ids of nodes in ParentGrid) in an array
sourceExtendableGrids.ParentGrid — Type
abstract type ParentGrid <: AbstractGridComponentGrid component key type for storing parent grid
sourceExtendableGrids.ParentGridRelation — Type
abstract type ParentGridRelation <: AbstractGridComponentGrid component key type for storing parent grid relationship
sourceExtendableGrids.RefinedGrid — Type
abstract type RefinedGrid <: ParentGridRelationGrid component key type for indicating that grid is a refinement of the parentgrid
sourceExtendableGrids.SubGrid — Type
abstract type SubGrid{support} <: ParentGridRelationGrid component key type for indicating that grid is a subgrid of the parentgrid
sourceExtendableGrids.SubgridVectorView — Type
struct SubgridVectorView{Tv, Ti} <: AbstractArray{Tv, 1}Vector view on subgrid
sysarray::AbstractVectornode_in_parent::Vector
Base.getindex — Method
getindex(
aview::ExtendableGrids.SubgridVectorView,
inode::Integer
) -> Any
Accessor method for subgrid vector view.
sourceBase.setindex! — Method
setindex!(
aview::ExtendableGrids.SubgridVectorView,
v,
inode::Integer
) -> ExtendableGrids.SubgridVectorView
Accessor method for subgrid vector view.
sourceExtendableGrids._copytransform! — Method
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 TCreate subgrid from list of regions.
parent: parent gridsubregions: 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: ifboundary==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