Skip to content

Commit

Permalink
Try to debug NaNs
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskawczynski committed Oct 20, 2023
1 parent a47f0dd commit 29384d3
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions src/Geometry/localgeometry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,32 @@ 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}
end

@inline function LocalGeometry(coordinates, J, WJ, ∂x∂ξ)
∂ξ∂x = inv(∂x∂ξ)
return LocalGeometry(
@inline function LocalGeometry(
coordinates,
J,
WJ,
inv(J),
∂x∂ξ,
∂ξ∂x,
∂ξ∂x * ∂ξ∂x',
∂x∂ξ' * ∂x∂ξ,
)
∂x∂ξ::Axis2Tensor{FT, Tuple{LocalAxis{I}, CovariantAxis{I}}, S},
) where {FT, I, S}
∂ξ∂x = inv(∂x∂ξ)
C = typeof(coordinates)
Jinv = inv(J)
if iszero(J) || iszero(Jinv)
error("oops")
end
return new{I, C, FT, S}(
coordinates,
J,
WJ,
Jinv,
∂x∂ξ,
∂ξ∂x,
∂ξ∂x * ∂ξ∂x',
∂x∂ξ' * ∂x∂ξ,
)
end
end


"""
SurfaceGeometry
Expand Down

0 comments on commit 29384d3

Please sign in to comment.