Trixi.jl icon indicating copy to clipboard operation
Trixi.jl copied to clipboard

Error: boundaries object missing from cache object using a DGMultMesh from Triangulate.jl and StartUpDG.jl

Open jwscook opened this issue 9 months ago • 1 comments

I've been trying to use Triangulate and StartUpDG to create my own mesh to pass to Trixi and a DGMultiMesh. It's essentially a mixture of the confunctionality of the two examples; euler brown minion vortex and forward facing step.

However, the code errors when the cache object doesn't have a boundaries object with name and neighbors_ids on it. I've created a MWE repo that errors with this message:

ERROR: LoadError: type Tuple has no field name
Stacktrace:
 [1] getproperty(x::Tuple{}, f::Symbol)
   @ Base ./Base.jl:37
 [2] initialize!(boundary_types_container::Trixi.UnstructuredSortedBoundaryTypes{3, Tuple{BoundaryConditionDirichlet{typeof(initial_condition_mach_flow)}, typeof(boundary_condition_outflow), typeof(boundary_condition_slip_wall)}}, cache::@NamedTuple{boundaries::Tuple{}, md::MeshData{2, StartUpDG.VertexMappedMesh{Tri, Tuple{Vector{Float64}, Vector{Float64}}, Matrix{Int32}}, Matrix{Float64}, Matrix{Float64}, Matrix{Float64}, Matrix{Int64}, Matrix{Float64}, StaticArraysCore.SMatrix{2, 2, Matrix{Float64}, 4}, Matrix{Float64}, Matrix{Int64}, Matrix{Int64}, Vector{Int64}}, Qrst_skew::Tuple{LinearAlgebra.Adjoint{Float64, SparseArrays.SparseMatrixCSC{Float64, Int64}}, LinearAlgebra.Adjoint{Float64, SparseArrays.SparseMatrixCSC{Float64, Int64}}}, VhP::Matrix{Float64}, Ph::Matrix{Float64}, invJ::Matrix{Float64}, dxidxhatj::StaticArraysCore.SMatrix{2, 2, Matrix{Float64}, 4}, entropy_var_values::StructArray{SVector{4, Float64}, 2, NTuple{4, Matrix{Float64}}, Int64}, projected_entropy_var_values::StructArray{SVector{4, Float64}, 2, NTuple{4, Matrix{Float64}}, Int64}, entropy_projected_u_values::StructArray{SVector{4, Float64}, 2, NTuple{4, Matrix{Float64}}, Int64}, u_values::StructArray{SVector{4, Float64}, 2, NTuple{4, Matrix{Float64}}, Int64}, u_face_values::StructArray{SVector{4, Float64}, 2, NTuple{4, SubArray{Float64, 2, Matrix{Float64}, Tuple{UnitRange{Int64}, Base.Slice{Base.OneTo{Int64}}}, false}}, CartesianIndex{2}}, flux_face_values::StructArray{SVector{4, Float64}, 2, NTuple{4, Matrix{Float64}}, Int64}, local_values_threaded::Vector{StructArrays.StructVector{SVector{4, Float64}, NTuple{4, Vector{Float64}}, Int64}}, fluxdiff_local_threaded::Vector{Vector{SVector{4, Float64}}}, rhs_local_threaded::Vector{StructArrays.StructVector{SVector{4, Float64}, NTuple{4, Vector{Float64}}, Int64}}})
   @ Trixi ~/.julia/packages/Trixi/J5oxT/src/solvers/dgsem_unstructured/sort_boundary_conditions.jl:48
 [3] Trixi.UnstructuredSortedBoundaryTypes(boundary_conditions::Dict{Symbol, Any}, cache::@NamedTuple{boundaries::Tuple{}, md::MeshData{2, StartUpDG.VertexMappedMesh{Tri, Tuple{Vector{Float64}, Vector{Float64}}, Matrix{Int32}}, Matrix{Float64}, Matrix{Float64}, Matrix{Float64}, Matrix{Int64}, Matrix{Float64}, StaticArraysCore.SMatrix{2, 2, Matrix{Float64}, 4}, Matrix{Float64}, Matrix{Int64}, Matrix{Int64}, Vector{Int64}}, Qrst_skew::Tuple{LinearAlgebra.Adjoint{Float64, SparseArrays.SparseMatrixCSC{Float64, Int64}}, LinearAlgebra.Adjoint{Float64, SparseArrays.SparseMatrixCSC{Float64, Int64}}}, VhP::Matrix{Float64}, Ph::Matrix{Float64}, invJ::Matrix{Float64}, dxidxhatj::StaticArraysCore.SMatrix{2, 2, Matrix{Float64}, 4}, entropy_var_values::StructArray{SVector{4, Float64}, 2, NTuple{4, Matrix{Float64}}, Int64}, projected_entropy_var_values::StructArray{SVector{4, Float64}, 2, NTuple{4, Matrix{Float64}}, Int64}, entropy_projected_u_values::StructArray{SVector{4, Float64}, 2, NTuple{4, Matrix{Float64}}, Int64}, u_values::StructArray{SVector{4, Float64}, 2, NTuple{4, Matrix{Float64}}, Int64}, u_face_values::StructArray{SVector{4, Float64}, 2, NTuple{4, SubArray{Float64, 2, Matrix{Float64}, Tuple{UnitRange{Int64}, Base.Slice{Base.OneTo{Int64}}}, false}}, CartesianIndex{2}}, flux_face_values::StructArray{SVector{4, Float64}, 2, NTuple{4, Matrix{Float64}}, Int64}, local_values_threaded::Vector{StructArrays.StructVector{SVector{4, Float64}, NTuple{4, Vector{Float64}}, Int64}}, fluxdiff_local_threaded::Vector{Vector{SVector{4, Float64}}}, rhs_local_threaded::Vector{StructArrays.StructVector{SVector{4, Float64}, NTuple{4, Vector{Float64}}, Int64}}})
   @ Trixi ~/.julia/packages/Trixi/J5oxT/src/solvers/dgsem_unstructured/sort_boundary_conditions.jl:41
 [4] digest_boundary_conditions(boundary_conditions::Dict{Symbol, Any}, mesh::DGMultiMesh{2, Trixi.Affine, MeshData{2, StartUpDG.VertexMappedMesh{Tri, Tuple{Vector{Float64}, Vector{Float64}}, Matrix{Int32}}, Matrix{Float64}, Matrix{Float64}, Matrix{Float64}, Matrix{Int64}, Matrix{Float64}, StaticArraysCore.SMatrix{2, 2, Matrix{Float64}, 4}, Matrix{Float64}, Matrix{Int64}, Matrix{Int64}, Vector{Int64}}, Dict{Symbol, Vector{Int64}}}, solver::DGMulti{2, Tri, Polynomial{MultidimensionalQuadrature}, SurfaceIntegralWeakForm{FluxLaxFriedrichs{typeof(max_abs_speed_naive)}}, VolumeIntegralFluxDifferencing{typeof(flux_ranocha)}, Nothing, RefElemData{2, Tri, Polynomial{MultidimensionalQuadrature}, Int64, Tuple{Vector{Int64}, Vector{Int64}, Vector{Int64}}, Tuple{Vector{Float64}, Vector{Float64}}, Tuple{Vector{Float64}, Vector{Float64}}, Tuple{Vector{Float64}, Vector{Float64}}, Tuple{Vector{Float64}, Vector{Float64}}, Tuple{Vector{Float64}, Vector{Float64}}, Vector{Int64}, Matrix{Float64}, Matrix{Float64}, Matrix{Float64}, Matrix{Float64}, Matrix{Float64}, Tuple{Matrix{Float64}, Matrix{Float64}}, Matrix{Float64}, Matrix{Float64}, Matrix{Float64}, Vector{Float64}, Vector{Float64}}}, cache::@NamedTuple{boundaries::Tuple{}, md::MeshData{2, StartUpDG.VertexMappedMesh{Tri, Tuple{Vector{Float64}, Vector{Float64}}, Matrix{Int32}}, Matrix{Float64}, Matrix{Float64}, Matrix{Float64}, Matrix{Int64}, Matrix{Float64}, StaticArraysCore.SMatrix{2, 2, Matrix{Float64}, 4}, Matrix{Float64}, Matrix{Int64}, Matrix{Int64}, Vector{Int64}}, Qrst_skew::Tuple{LinearAlgebra.Adjoint{Float64, SparseArrays.SparseMatrixCSC{Float64, Int64}}, LinearAlgebra.Adjoint{Float64, SparseArrays.SparseMatrixCSC{Float64, Int64}}}, VhP::Matrix{Float64}, Ph::Matrix{Float64}, invJ::Matrix{Float64}, dxidxhatj::StaticArraysCore.SMatrix{2, 2, Matrix{Float64}, 4}, entropy_var_values::StructArray{SVector{4, Float64}, 2, NTuple{4, Matrix{Float64}}, Int64}, projected_entropy_var_values::StructArray{SVector{4, Float64}, 2, NTuple{4, Matrix{Float64}}, Int64}, entropy_projected_u_values::StructArray{SVector{4, Float64}, 2, NTuple{4, Matrix{Float64}}, Int64}, u_values::StructArray{SVector{4, Float64}, 2, NTuple{4, Matrix{Float64}}, Int64}, u_face_values::StructArray{SVector{4, Float64}, 2, NTuple{4, SubArray{Float64, 2, Matrix{Float64}, Tuple{UnitRange{Int64}, Base.Slice{Base.OneTo{Int64}}}, false}}, CartesianIndex{2}}, flux_face_values::StructArray{SVector{4, Float64}, 2, NTuple{4, Matrix{Float64}}, Int64}, local_values_threaded::Vector{StructArrays.StructVector{SVector{4, Float64}, NTuple{4, Vector{Float64}}, Int64}}, fluxdiff_local_threaded::Vector{Vector{SVector{4, Float64}}}, rhs_local_threaded::Vector{StructArrays.StructVector{SVector{4, Float64}, NTuple{4, Vector{Float64}}, Int64}}})
   @ Trixi ~/.julia/packages/Trixi/J5oxT/src/semidiscretization/semidiscretization_hyperbolic.jl:207
 [5] top-level scope
   @ ~/code/DGMultMeshMWE.jl/src/DGMultMeshMWE.jl:182
in expression starting at ~/code/DGMultMeshMWE.jl/src/DGMultMeshMWE.jl:182

jwscook avatar Mar 24 '25 10:03 jwscook

Hi @jwscook, I think the specification of boundary conditions in DGMulti is done a little differently from the forward facing step example. See for example this elixir for an example of how BCs are specified on various different boundaries.

jlchan avatar Mar 24 '25 13:03 jlchan