Skip to content

Commit f76f9a3

Browse files
authored
Specialize 'Proj' for 'SubDomain' (#1154)
1 parent 4dbd2e2 commit f76f9a3

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/transforms/proj.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ applycoord(t::Proj, g::RectilinearGrid) = TransformedGrid(g, t)
7171

7272
applycoord(t::Proj, g::StructuredGrid) = TransformedGrid(g, t)
7373

74+
applycoord(t::Proj, d::SubDomain) = TransformedDomain(d, t)
75+
7476
# -----------
7577
# IO METHODS
7678
# -----------

test/transforms.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,6 +1414,16 @@ end
14141414
r, c = TB.apply(f, d)
14151415
@test r SimpleMesh(f.(vertices(d)), topology(d))
14161416

1417+
# ----------
1418+
# SUBDOMAIN
1419+
# ----------
1420+
1421+
f = Proj(Polar)
1422+
g = CartesianGrid((10, 10), cart(1, 1), T.((1, 1)))
1423+
d = view(g, 1:10)
1424+
r, c = TB.apply(f, d)
1425+
@test r view(SimpleMesh(f.(vertices(g)), topology(g)), 1:10)
1426+
14171427
# --------------
14181428
# SPECIAL CASES
14191429
# --------------

0 commit comments

Comments
 (0)