Skip to content

Commit

Permalink
Update conversion functions
Browse files Browse the repository at this point in the history
  • Loading branch information
sriharshakandala committed Jul 24, 2023
1 parent 74f768d commit 2a86734
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Geometry/conversions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
ContravariantVector(u::ContravariantVector, ::LocalGeometry) = u
CovariantVector(u::CovariantVector, ::LocalGeometry) = u
LocalVector(u::LocalVector, ::LocalGeometry) = u

# conversions between Covariant/Contravariant vectors and local vectors
ContravariantVector(
u::LocalVector{T, I},
local_geometry::LocalGeometry{I},
Expand All @@ -24,7 +24,15 @@ LocalVector(
u::CovariantVector{T, I},
local_geometry::LocalGeometry{I},
) where {T, I} = local_geometry.∂ξ∂x' * u

# conversions between Covariant and Contravariant vectors
ContravariantVector(
u::CovariantVector{T, I},
local_geometry::LocalGeometry{I},
) where {T, I} = local_geometry.gⁱʲ * u
CovariantVector(
u::ContravariantVector{T, I},
local_geometry::LocalGeometry{I},
) where {T, I} = local_geometry.gᵢⱼ * u
# Converting to specific dimension types
(::Type{<:ContravariantVector{<:Any, I}})(
u::ContravariantVector{<:Any, I},
Expand Down

0 comments on commit 2a86734

Please sign in to comment.