Skip to content

Commit

Permalink
Initialize contravariant_vectors with full type information
Browse files Browse the repository at this point in the history
  • Loading branch information
amrueda committed Dec 8, 2023
1 parent 32b6836 commit d959d77
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/solvers/dgsem_p4est/containers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
#! format: noindent

mutable struct P4estElementContainer{NDIMS, RealT <: Real, uEltype <: Real, NDIMSP1,
NDIMSP2, NDIMSP3} <: AbstractContainer
NDIMSP2, NDIMSP3, R, S, X, O} <: AbstractContainer
# Physical coordinates at each node
node_coordinates::Array{RealT, NDIMSP2} # [orientation, node_i, node_j, node_k, element]
# Jacobian matrix of the transformation
# [jacobian_i, jacobian_j, node_i, node_j, node_k, element] where jacobian_i is the first index of the Jacobian matrix,...
jacobian_matrix::Array{RealT, NDIMSP3}
# Contravariant vectors, scaled by J, in Kopriva's blue book called Ja^i_n (i index, n dimension)
contravariant_vectors::PtrArray{RealT, NDIMSP3} # [dimension, index, node_i, node_j, node_k, element]
contravariant_vectors::PtrArray{RealT, NDIMSP3, R, S, X, O} # [dimension, index, node_i, node_j, node_k, element]
# 1/J where J is the Jacobian determinant (determinant of Jacobian matrix)
inverse_jacobian::Array{RealT, NDIMSP1} # [node_i, node_j, node_k, element]
# Buffer for calculated surface flux
Expand Down Expand Up @@ -125,12 +125,20 @@ function init_elements(mesh::Union{P4estMesh{NDIMS, RealT}, T8codeMesh{NDIMS, Re
NDIMS * 2, nelements))

elements = P4estElementContainer{NDIMS, RealT, uEltype, NDIMS + 1, NDIMS + 2,
NDIMS + 3}(node_coordinates, jacobian_matrix,
contravariant_vectors,
inverse_jacobian, surface_flux_values,
_node_coordinates, _jacobian_matrix,
_contravariant_vectors,
_inverse_jacobian, _surface_flux_values)
NDIMS + 3, ntuple(@inline(i->i), NDIMS + 3),
Tuple{StaticInt{ndims_spa},
ntuple(i -> Int64, NDIMS + 2)...
}, NTuple{NDIMS + 3, Nothing},
NTuple{NDIMS + 3, StaticInt{1}}}(node_coordinates,
jacobian_matrix,
contravariant_vectors,
inverse_jacobian,
surface_flux_values,
_node_coordinates,
_jacobian_matrix,
_contravariant_vectors,
_inverse_jacobian,
_surface_flux_values)

init_elements!(elements, mesh, basis)
return elements
Expand Down

0 comments on commit d959d77

Please sign in to comment.