Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick fix to multithreading issue by refining specialization of contravariant vectors #62

Merged
merged 3 commits into from
Jan 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions src/solvers/dgsem_p4est/containers_2d_manifold_in_3d_cartesian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,22 @@ end
return uEltype
end

# Extract contravariant vector Ja^i (i = index) as SVector
# This function dispatches on the type of contravariant_vectors
static2val(::Trixi.StaticInt{N}) where {N} = Val{N}()
@inline function Trixi.get_contravariant_vector(index, contravariant_vectors::PtrArray,
indices...)
# Extract contravariant vector Ja^i (i = index) as SVector. This function dispatches on the
# type of contravariant_vectors, specializing for NDIMS = 2 and NDIMS_AMBIENT = 3 by using
# the fact that the second type parameter of PtrArray is NDIMS + 3, and the fourth type
# parameter of PtrArray is Tuple{StaticInt{NDIMS_AMBIENT}, Vararg{IntT, NDIMS + 2}}.
@inline function Trixi.get_contravariant_vector(index,
contravariant_vectors::PtrArray{RealT,
5,
<:Any,
Tuple{Trixi.StaticInt{3},
IntT,
IntT,
IntT,
IntT}},
indices...) where {RealT, IntT}
return SVector(ntuple(@inline(dim->contravariant_vectors[dim, index, indices...]),
static2val(static_size(contravariant_vectors,
Trixi.StaticInt(1)))))
3))
end

# Create element container and initialize element data.
Expand Down
Loading