Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional Functionality for Subgrids #37

Merged
merged 8 commits into from
Feb 5, 2024
Prev Previous commit
Next Next commit
small fix
chmerdon committed Feb 2, 2024
commit 8d59f98182a5db7c3142d3e7c26bd85d7bcc99df
2 changes: 1 addition & 1 deletion src/ExtendableGrids.jl
Original file line number Diff line number Diff line change
@@ -82,7 +82,7 @@ export seemingly_equal, numbers_match
include("subgrid.jl")
export subgrid
export ParentGrid
export NodeInParent, CellParents, FaceParents
export NodeInParent, CellParents, FaceParents, BFaceParents, EdgeParents, BEdgeParents
export ParentGridRelation, SubGrid, BoundarySubGrid, RefinedGrid

include("shape_specs.jl")
6 changes: 6 additions & 0 deletions src/meshrefinements.jl
Original file line number Diff line number Diff line change
@@ -42,6 +42,7 @@ function split_grid_into(source_grid::ExtendableGrid{T,K}, targetgeometry::Type{
itemEG = EG[1]
iEG::Int = 1
split_rule::Array{Int,2} = split_rules[iEG]
xCellParents::Array{K,1} = zeros(K,0)
for cell = 1 : num_sources(oldCellNodes)
if !singleEG
nnodes4item = num_targets(oldCellNodes,cell)
@@ -54,6 +55,7 @@ function split_grid_into(source_grid::ExtendableGrid{T,K}, targetgeometry::Type{
end
for j = 1 : size(split_rule,2)
push!(xCellRegions,oldCellRegions[cell])
push!(xCellParents,cell)
end
ncells += size(split_rule,2)
end
@@ -127,6 +129,10 @@ function split_grid_into(source_grid::ExtendableGrid{T,K}, targetgeometry::Type{
xgrid[BFaceGeometries]=VectorOfConstants{ElementGeometries,Int}(facetype_of_cellface(targetgeometry,1),newnbfaces)
end

xgrid[ParentGrid] = source_grid
xgrid[ParentGridRelation] = RefinedGrid
xgrid[CellParents] = xCellParents

return xgrid
end