From 76b0945005d83e65f1325626983cd91891246363 Mon Sep 17 00:00:00 2001 From: bennibolm Date: Tue, 27 Feb 2024 18:47:21 +0100 Subject: [PATCH] Clean up RealT and uEltype --- src/solvers/fv_t8code/containers.jl | 12 ++++-------- src/solvers/fv_t8code/fv.jl | 9 ++++++--- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/solvers/fv_t8code/containers.jl b/src/solvers/fv_t8code/containers.jl index f7dce667206..97625a3c8dc 100644 --- a/src/solvers/fv_t8code/containers.jl +++ b/src/solvers/fv_t8code/containers.jl @@ -16,8 +16,8 @@ struct T8codeElementContainer{NDIMS, RealT <: Real, uEltype <: Real, num_faces :: Cint face_midpoints :: NTuple{NDIMS_MAX_NUMBER_FACES, RealT} - face_areas :: NTuple{MAX_NUMBER_FACES, uEltype} - face_normals :: NTuple{NDIMS_MAX_NUMBER_FACES, uEltype} + face_areas :: NTuple{MAX_NUMBER_FACES, RealT} + face_normals :: NTuple{NDIMS_MAX_NUMBER_FACES, RealT} face_connectivity :: NTuple{MAX_NUMBER_FACES, t8_locidx_t} # ids of the face neighbors boundary_name :: NTuple{MAX_NUMBER_FACES, Symbol} neighbor_faces :: NTuple{MAX_NUMBER_FACES, t8_locidx_t} @@ -239,9 +239,7 @@ end # Create interface container and initialize interface data. function init_fv_interfaces(mesh::T8codeMesh, equations, - solver::FV, elements) - uEltype = eltype(elements[1].volume) - + solver::FV, elements, uEltype) # Initialize container n_interfaces = count_required_surfaces(mesh).interfaces if mpi_parallel(mesh) == true @@ -335,9 +333,7 @@ function Base.resize!(boundaries::T8codeFVBoundaryContainer, capacity) end # Create interface container and initialize interface data in `elements`. -function init_fv_boundaries(mesh::T8codeMesh, equations, solver::FV, elements) - uEltype = eltype(elements[1]) - +function init_fv_boundaries(mesh::T8codeMesh, equations, solver::FV, elements, uEltype) # Initialize container n_boundaries = count_required_surfaces(mesh).boundaries diff --git a/src/solvers/fv_t8code/fv.jl b/src/solvers/fv_t8code/fv.jl index 8016878aea0..d9e5435d64e 100644 --- a/src/solvers/fv_t8code/fv.jl +++ b/src/solvers/fv_t8code/fv.jl @@ -127,9 +127,12 @@ function create_cache(mesh::T8codeMesh, equations::AbstractEquations, solver::FV ::Type{uEltype}) where {uEltype <: Real} count_required_surfaces!(mesh) + # After I saved some data (e.g. normal) in the interfaces and boundaries, + # the element data structure is not used anymore after this `create_cache` routine. + # Possible to remove it and directly save the data in interface, boundars (and mortar) data structure? elements = init_fv_elements(mesh, equations, solver, uEltype) - interfaces = init_fv_interfaces(mesh, equations, solver, elements) - boundaries = init_fv_boundaries(mesh, equations, solver, elements) + interfaces = init_fv_interfaces(mesh, equations, solver, elements, uEltype) + boundaries = init_fv_boundaries(mesh, equations, solver, elements, uEltype) # mortars = init_mortars(mesh, equations, basis, elements) # fill_mesh_info!(mesh, interfaces, mortars, boundaries, @@ -175,7 +178,7 @@ function rhs!(du, u, t, mesh::T8codeMesh, equations, equations, solver) end - @trixi_timeit timer() "Jacobian" begin + @trixi_timeit timer() "volume" begin for element in eachelement(mesh, solver, cache) @unpack volume = cache.elements[element] for v in eachvariable(equations)