comparison src/Grids/geometry.jl @ 1973:8e9575b518a1 feature/grids/geometry_functions

Add tests for TransfiniteInterpolationSurface and implemnet check_tranfiniteinterpolation
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 14 Feb 2025 22:19:06 +0100
parents 9e89084cbba4
children 3ed7ca1f60c4
comparison
equal deleted inserted replaced
1971:9e89084cbba4 1973:8e9575b518a1
81 81
82 function (s::TransfiniteInterpolationSurface)(ξ̄::AbstractArray) 82 function (s::TransfiniteInterpolationSurface)(ξ̄::AbstractArray)
83 s(ξ̄...) 83 s(ξ̄...)
84 end 84 end
85 85
86 function check_transfiniteinterpolation(s::TransfiniteInterpolationSurface)
87 if check_transfiniteinterpolation(Bool, s)
88 return nothing
89 else
90 error("The end of each curve in the transfinite interpolation should be the same as the beginning of the next curve.")
91 end
92 end
93
94 function check_transfiniteinterpolation(::Type{Bool}, s::TransfiniteInterpolationSurface)
95 if !isapprox(s.c₁(1), s.c₂(0))
96 return false
97 end
98
99 if !isapprox(s.c₂(1), s.c₃(0))
100 return false
101 end
102
103 if !isapprox(s.c₃(1), s.c₄(0))
104 return false
105 end
106
107 if !isapprox(s.c₄(1), s.c₁(0))
108 return false
109 end
110
111 return true
112 end
113
86 # TODO: Implement jacobian() for the different mapping helpers 114 # TODO: Implement jacobian() for the different mapping helpers
87 # TODO: Implement a check function for transfinite interpolations
88 # TODO: Add doc strings 115 # TODO: Add doc strings