Skip to content

Commit

Permalink
Clean up RealT and uEltype
Browse files Browse the repository at this point in the history
  • Loading branch information
bennibolm committed Feb 27, 2024
1 parent dbc5dc8 commit 76b0945
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
12 changes: 4 additions & 8 deletions src/solvers/fv_t8code/containers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
9 changes: 6 additions & 3 deletions src/solvers/fv_t8code/fv.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 76b0945

Please sign in to comment.