diff --git a/src/Geometry/localgeometry.jl b/src/Geometry/localgeometry.jl index 98010215c6..2196f749ea 100644 --- a/src/Geometry/localgeometry.jl +++ b/src/Geometry/localgeometry.jl @@ -21,21 +21,25 @@ struct LocalGeometry{I, C <: AbstractPoint, FT, S} gⁱʲ::Axis2Tensor{FT, Tuple{ContravariantAxis{I}, ContravariantAxis{I}}, S} "Covariant metric tensor (gᵢⱼ), transforms contravariant to covariant vector components" gᵢⱼ::Axis2Tensor{FT, Tuple{CovariantAxis{I}, CovariantAxis{I}}, S} + @inline function LocalGeometry(coordinates, J, WJ, ∂x∂ξ) + ∂ξ∂x = inv(∂x∂ξ) + Jinv = inv(J) + if iszero(J) || iszero(Jinv) + error("oops") + end + return new( + coordinates, + J, + WJ, + Jinv, + ∂x∂ξ, + ∂ξ∂x, + ∂ξ∂x * ∂ξ∂x', + ∂x∂ξ' * ∂x∂ξ, + ) + end end -@inline function LocalGeometry(coordinates, J, WJ, ∂x∂ξ) - ∂ξ∂x = inv(∂x∂ξ) - return LocalGeometry( - coordinates, - J, - WJ, - inv(J), - ∂x∂ξ, - ∂ξ∂x, - ∂ξ∂x * ∂ξ∂x', - ∂x∂ξ' * ∂x∂ξ, - ) -end """ SurfaceGeometry