Mercurial > repos > public > sbplib_julia
diff src/Grids/geometry.jl @ 2071:9e9c56f5a656 feature/grids/geometry_functions
Add parameter validation when calling a transfinite interpolation object
| author | Jonatan Werpers <jonatan@werpers.com> |
|---|---|
| date | Tue, 17 Feb 2026 20:37:53 +0100 |
| parents | c68fa6c74477 |
| children | c36812de3f2d |
line wrap: on
line diff
--- a/src/Grids/geometry.jl Tue Feb 17 20:25:13 2026 +0100 +++ b/src/Grids/geometry.jl Tue Feb 17 20:37:53 2026 +0100 @@ -54,7 +54,7 @@ LineSegment(a,b) A line segment, as a callable object, from `a` to `b`. -The parametrization is ``l(s) = (1-s)a + s*b`` where ``s\in(0,1)``. +The parametrization is ``l(s) = (1-s)a + s*b`` where ``s∈(0,1)``. # Example ```julia-repl @@ -250,6 +250,9 @@ end function (s::TransfiniteInterpolationSurface)(u,v) + if (u,v) ∉ unitsquare() + throw(DomainError((u,v), "Transfinite interpolation was called with parameters outside the unit square.")) + end c₁, c₂, c₃, c₄ = s.c₁, s.c₂, s.c₃, s.c₄ P₀₀ = c₁(0) P₁₀ = c₂(0)
