Skip to content

Commit

Permalink
metric terms for shell of radius != 1
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanmontoya committed Aug 20, 2024
1 parent 7de998a commit 317033a
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/solvers/dgsem_p4est/containers_2d_manifold_in_3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ function calc_node_coordinates_2d_shell!(node_coordinates,
return node_coordinates
end

# This only works for a sphere
function calc_contravariant_vectors_2d_shell!(contravariant_vectors::AbstractArray{<:Any,
5},
element,
Expand All @@ -215,6 +216,10 @@ function calc_contravariant_vectors_2d_shell!(contravariant_vectors::AbstractArr
@unpack derivative_matrix = basis

for j in eachnode(basis), i in eachnode(basis)
radius = sqrt(node_coordinates[1, i, j, element]^2 +
node_coordinates[2, i, j, element]^2 +
node_coordinates[3, i, j, element]^2)

for n in 1:3
# (n, m, l) cyclic
m = (n % 3) + 1
Expand All @@ -228,7 +233,8 @@ function calc_contravariant_vectors_2d_shell!(contravariant_vectors::AbstractArr
jacobian_matrix[l, 2, i, j,
element] *
node_coordinates[m, i, j,
element])
element]) /
radius

contravariant_vectors[n, 2, i, j, element] = (jacobian_matrix[l, 1, i, j,
element] *
Expand All @@ -238,7 +244,8 @@ function calc_contravariant_vectors_2d_shell!(contravariant_vectors::AbstractArr
jacobian_matrix[m, 1, i, j,
element] *
node_coordinates[l, i, j,
element])
element]) /
radius

contravariant_vectors[n, 3, i, j, element] = (jacobian_matrix[m, 1, i, j,
element] *
Expand All @@ -248,7 +255,8 @@ function calc_contravariant_vectors_2d_shell!(contravariant_vectors::AbstractArr
jacobian_matrix[m, 2, i, j,
element] *
jacobian_matrix[l, 1, i, j,
element])
element]) /
radius
end
end

Expand Down

0 comments on commit 317033a

Please sign in to comment.