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 1156432
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions src/Geometry/localgeometry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1156432

Please sign in to comment.