Skip to content

Commit

Permalink
renamed NodeInParent to NodeParents, added a deprecated warning on this
Browse files Browse the repository at this point in the history
  • Loading branch information
chmerdon authored and j-fu committed Feb 5, 2024
1 parent 1bccec7 commit 7699c8c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ExtendableGrids"
uuid = "cfc395e8-590f-11e8-1f13-43a2532b2fa8"
authors = ["Juergen Fuhrmann <[email protected]>", "Christian Merdon <[email protected]>", "Johannes Taraz <[email protected]>"]
version = "1.2.3"
version = "1.3.0"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand Down
4 changes: 3 additions & 1 deletion src/ExtendableGrids.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export seemingly_equal, numbers_match
include("subgrid.jl")
export subgrid
export ParentGrid
export NodeInParent, CellParents, FaceParents, BFaceParents, EdgeParents, BEdgeParents
export NodeParents, CellParents, FaceParents, BFaceParents, EdgeParents, BEdgeParents
export ParentGridRelation, SubGrid, BoundarySubGrid, RefinedGrid

include("shape_specs.jl")
Expand Down Expand Up @@ -177,6 +177,8 @@ export writeVTK

include("seal.jl")

include("deprecated.jl")

@static if !isdefined(Base, :get_extension)
function __init__()
@require Gmsh="705231aa-382f-11e9-3f0c-b7cb4346fdeb" begin
Expand Down
8 changes: 8 additions & 0 deletions src/deprecated.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## NodeInParent was renamed to NodeParents in v1.3
abstract type NodeInParent <: AbstractGridIntegerArray1D end
export NodeInParent

function ExtendableGrids.instantiate(xgrid::ExtendableGrid, ::Type{NodeInParent})
@warn "NodeInParents is deprecated, use NodeParents instead"
xgrid[NodeParents]
end
2 changes: 1 addition & 1 deletion src/derived.jl
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ function ExtendableGrids.instantiate(xgrid::ExtendableGrid{Tc,Ti}, ::Type{FaceNo
if xgrid[ParentGridRelation] === SubGrid
## get FaceNodes from ParentGrid to keep ordering and orientation
pgrid = xgrid[ParentGrid]
pnodes = xgrid[NodeInParent]
pnodes = xgrid[NodeParents]
nscells = num_cells(xgrid)
PFaceNodes = pgrid[FaceNodes]
PCellFaces = deepcopy(pgrid[CellFaces])
Expand Down
12 changes: 6 additions & 6 deletions src/subgrid.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""
$(TYPEDEF)
Grid component key type for storing node in parent array
Grid component key type for storing node parents (=ids of nodes in ParentGrid) in an array
"""
abstract type NodeInParent <: AbstractGridIntegerArray1D end
abstract type NodeParents <: AbstractGridIntegerArray1D end

"""
$(TYPEDEF)
Expand Down Expand Up @@ -98,7 +98,7 @@ Create subgrid from list of regions.
- `project`: project coordinates onto subgrid dimension
A subgrid is of type `ExtendableGrid` and stores two additional components:
[`ParentGrid`](@ref) and [`NodeInParent`](@ref)
[`ParentGrid`](@ref) and [`NodeParents`](@ref)
"""
function subgrid(parent,
Expand Down Expand Up @@ -195,7 +195,7 @@ function subgrid(parent,
subgrid[CellGeometries]=sub_ct
subgrid[CellNodes]=tryfix(sub_xnodes)
subgrid[ParentGrid]=parent
subgrid[NodeInParent]=sub_nip
subgrid[NodeParents]=sub_nip
subgrid[CellParents]=cellparents
subgrid[ParentGridRelation]=boundary ? BoundarySubGrid : SubGrid

Expand Down Expand Up @@ -265,7 +265,7 @@ function subgrid(parent,
# Sort nodes of grid for easy plotting
X=view(subgrid[Coordinates],1,:)
nx=length(X)
I=subgrid[NodeInParent]
I=subgrid[NodeParents]
xipairs=[XIPair{Tc,Ti}(X[i],I[i]) for i=1:nx]
sort!(xipairs, 1,nx, Base.QuickSort, Base.Forward)
for i=1:nx
Expand Down Expand Up @@ -297,7 +297,7 @@ $(TYPEDSIGNATURES)
Create a view of the vector on a subgrid.
"""
Base.view(a::AbstractVector,subgrid::ExtendableGrid) = SubgridVectorView(a,subgrid[NodeInParent])
Base.view(a::AbstractVector,subgrid::ExtendableGrid) = SubgridVectorView(a,subgrid[NodeParents])


##############################################################################
Expand Down

0 comments on commit 7699c8c

Please sign in to comment.