Skip to content

Commit

Permalink
Add LevelPlaceholderSpace
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisYatunin committed Sep 12, 2024
1 parent 476d93c commit f8e21da
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/Operators/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ end
struct PlaceholderSpace <: Spaces.AbstractSpace end
struct CenterPlaceholderSpace <: Spaces.AbstractSpace end
struct FacePlaceholderSpace <: Spaces.AbstractSpace end
struct LevelPlaceholderSpace <: Spaces.AbstractSpace end


placeholder_space(current_space, parent_space) = current_space
placeholder_space(current_space::T, parent_space::T) where {T} =
PlaceholderSpace()
placeholder_space(current_space, parent_space) = current_space
placeholder_space(
current_space::Spaces.CenterFiniteDifferenceSpace,
parent_space::Spaces.FaceFiniteDifferenceSpace,
Expand All @@ -92,7 +92,15 @@ placeholder_space(
current_space::Spaces.FaceExtrudedFiniteDifferenceSpace,
parent_space::Spaces.CenterExtrudedFiniteDifferenceSpace,
) = FacePlaceholderSpace()
placeholder_space(
current_space::Spaces.AbstractSpectralElementSpace,
parent_space::Spaces.AbstractSpace,
) =
Spaces.issubspace(current_space, parent_space) ? LevelPlaceholderSpace() :
current_space

@inline reconstruct_placeholder_space(current_space, parent_space) =
current_space
@inline reconstruct_placeholder_space(::PlaceholderSpace, parent_space) =
parent_space
@inline reconstruct_placeholder_space(
Expand All @@ -111,9 +119,8 @@ placeholder_space(
::FacePlaceholderSpace,
parent_space::Spaces.CenterExtrudedFiniteDifferenceSpace,
) = Spaces.FaceExtrudedFiniteDifferenceSpace(parent_space)
@inline reconstruct_placeholder_space(current_space, parent_space) =
current_space

@inline reconstruct_placeholder_space(::LevelPlaceholderSpace, parent_space) =
Spaces.level(parent_space, left_idx(parent_space)) # extract any level

strip_space(obj, parent_space) = obj

Expand Down

0 comments on commit f8e21da

Please sign in to comment.