Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 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
2 changes: 1 addition & 1 deletion src/callbacks_stage/entropy_bounded_limiter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@muladd begin
#! format: noindent

mutable struct EntropyBoundedLimiter{RealT <: Real}
struct EntropyBoundedLimiter{RealT <: Real}
exp_entropy_decrease_max::RealT # < 0
end

Expand Down
4 changes: 2 additions & 2 deletions src/callbacks_step/alive.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ time steps. If `analysis_interval ≂̸ 0`, the output is omitted every
"""
mutable struct AliveCallback
start_time::Float64
alive_interval::Int
analysis_interval::Int
const alive_interval::Int
const analysis_interval::Int
end

function AliveCallback(; analysis_interval = 0,
Expand Down
16 changes: 8 additions & 8 deletions src/callbacks_step/analysis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ mutable struct AnalysisCallback{Analyzer, AnalysisIntegrals, InitialStateIntegra
start_time_last_analysis::Float64
ncalls_rhs_last_analysis::Int
start_gc_time::Float64
interval::Int
save_analysis::Bool
output_directory::String
analysis_filename::String
analyzer::Analyzer
analysis_errors::Vector{Symbol}
analysis_integrals::AnalysisIntegrals
const interval::Int
const save_analysis::Bool
const output_directory::String
const analysis_filename::String
const analyzer::Analyzer
const analysis_errors::Vector{Symbol}
const analysis_integrals::AnalysisIntegrals
initial_state_integrals::InitialStateIntegrals
cache::Cache
const cache::Cache
end

# TODO: Taal bikeshedding, implement a method with less information and the signature
Expand Down
2 changes: 1 addition & 1 deletion src/callbacks_step/save_restart.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

Save the current numerical solution in a restart file every `interval` time steps.
"""
mutable struct SaveRestartCallback
struct SaveRestartCallback
interval::Int
save_final_restart::Bool
output_directory::String
Expand Down
2 changes: 1 addition & 1 deletion src/callbacks_step/steady_state.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Terminates the integration when the [`residual_steady_state(du, equations)`](@ref)
falls below the threshold specified by `abstol, reltol`.
"""
mutable struct SteadyStateCallback{RealT <: Real}
struct SteadyStateCallback{RealT <: Real}
abstol::RealT
reltol::RealT
end
Expand Down
2 changes: 1 addition & 1 deletion src/callbacks_step/stepsize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ diffusive CFL number, or a function of time `t` returning a `Real` number.
By default, the timestep will be adjusted at every step.
For different values of `interval`, the timestep will be adjusted every `interval` steps.
"""
mutable struct StepsizeCallback{CflAdvectiveType, CflDiffusiveType}
struct StepsizeCallback{CflAdvectiveType, CflDiffusiveType}
cfl_advective::CflAdvectiveType
cfl_diffusive::CflDiffusiveType
interval::Int
Expand Down
14 changes: 7 additions & 7 deletions src/callbacks_step/time_series.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ Currently this callback is only implemented for [`TreeMesh`](@ref) and [`Unstruc
"""
mutable struct TimeSeriesCallback{RealT <: Real, uEltype <: Real, SolutionVariables,
VariableNames, Cache}
interval::Int
solution_variables::SolutionVariables
variable_names::VariableNames
output_directory::String
filename::String
point_coordinates::Array{RealT, 2}
const interval::Int
const solution_variables::SolutionVariables
const variable_names::VariableNames
const output_directory::String
const filename::String
const point_coordinates::Array{RealT, 2}
# Point data is stored as a vector of vectors of the solution data type:
# * the "outer" `Vector` contains one vector for each point at which a time_series is recorded
# * the "inner" `Vector` contains the actual time series for a single point,
Expand All @@ -42,7 +42,7 @@ mutable struct TimeSeriesCallback{RealT <: Real, uEltype <: Real, SolutionVariab
point_data::Vector{Vector{uEltype}}
time::Vector{RealT}
step::Vector{Int}
time_series_cache::Cache
const time_series_cache::Cache
end

function Base.show(io::IO, cb::DiscreteCallback{<:Any, <:TimeSeriesCallback})
Expand Down
4 changes: 2 additions & 2 deletions src/callbacks_step/visualization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
@muladd begin
#! format: noindent

mutable struct VisualizationCallback{PlotDataCreator, SolutionVariables, VariableNames,
PlotCreator}
struct VisualizationCallback{PlotDataCreator, SolutionVariables, VariableNames,
PlotCreator}
plot_data_creator::PlotDataCreator
interval::Int
solution_variables::SolutionVariables
Expand Down
6 changes: 3 additions & 3 deletions src/equations/ideal_glm_mhd_multiion_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ References:
In case of more than one ion species, the multi-ion GLM-MHD equations should ALWAYS be used
with [`source_terms_lorentz`](@ref).
"""
mutable struct IdealGlmMhdMultiIonEquations2D{NVARS, NCOMP, RealT <: Real,
ElectronPressure, ElectronTemperature} <:
AbstractIdealGlmMhdMultiIonEquations{2, NVARS, NCOMP}
struct IdealGlmMhdMultiIonEquations2D{NVARS, NCOMP, RealT <: Real,
ElectronPressure, ElectronTemperature} <:
AbstractIdealGlmMhdMultiIonEquations{2, NVARS, NCOMP}
gammas::SVector{NCOMP, RealT} # Heat capacity ratios
charge_to_mass::SVector{NCOMP, RealT} # Charge to mass ratios
gas_constants::SVector{NCOMP, RealT} # Specific gas constants
Expand Down
6 changes: 3 additions & 3 deletions src/equations/ideal_glm_mhd_multiion_3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ References:
In case of more than one ion species, the multi-ion GLM-MHD equations should ALWAYS be used
with [`source_terms_lorentz`](@ref).
"""
mutable struct IdealGlmMhdMultiIonEquations3D{NVARS, NCOMP, RealT <: Real,
ElectronPressure} <:
AbstractIdealGlmMhdMultiIonEquations{3, NVARS, NCOMP}
struct IdealGlmMhdMultiIonEquations3D{NVARS, NCOMP, RealT <: Real,
ElectronPressure} <:
AbstractIdealGlmMhdMultiIonEquations{3, NVARS, NCOMP}
gammas::SVector{NCOMP, RealT} # Heat capacity ratios
charge_to_mass::SVector{NCOMP, RealT} # Charge to mass ratios
electron_pressure::ElectronPressure # Function to compute the electron pressure
Expand Down
4 changes: 2 additions & 2 deletions src/meshes/dgmulti_meshes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ dispatchable type. This is intended to store geometric data and connectivities f
mesh (Cartesian, affine, curved, structured/unstructured).
"""
mutable struct DGMultiMesh{NDIMS, MeshType, MeshDataT <: MeshData{NDIMS}, BoundaryFaceT}
md::MeshDataT
const md::MeshDataT

boundary_faces::BoundaryFaceT
const boundary_faces::BoundaryFaceT

current_filename :: String
unsaved_changes :: Bool
Expand Down
16 changes: 9 additions & 7 deletions src/meshes/p4est_mesh.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,19 @@ mesh for a two-dimensional surface or shell in three-dimensional space.
mutable struct P4estMesh{NDIMS, NDIMS_AMBIENT, RealT <: Real, IsParallel, P, Ghost,
NDIMSP2, NNODES} <:
AbstractMesh{NDIMS}
p4est :: P # Either PointerWrapper{p4est_t} or PointerWrapper{p8est_t}
is_parallel :: IsParallel
ghost :: Ghost # Either PointerWrapper{p4est_ghost_t} or PointerWrapper{p8est_ghost_t}
const p4est::P # Either PointerWrapper{p4est_t} or PointerWrapper{p8est_t}
const is_parallel::IsParallel
# Either `PointerWrapper{p4est_ghost_t}` or `PointerWrapper{p8est_ghost_t}`.
# Required for ghost/halo layers in parallel runs, thus mutable.
ghost::Ghost
# Coordinates at the nodes specified by the tensor product of `nodes` (NDIMS times).
# This specifies the geometry interpolation for each tree.
tree_node_coordinates::Array{RealT, NDIMSP2} # [dimension, i, j, k, tree]
nodes::SVector{NNODES, RealT}
boundary_names::Array{Symbol, 2} # [face direction, tree]
const tree_node_coordinates::Array{RealT, NDIMSP2} # [dimension, i, j, k, tree]
const nodes::SVector{NNODES, RealT}
const boundary_names::Array{Symbol, 2} # [face direction, tree]
current_filename::String
unsaved_changes::Bool
p4est_partition_allow_for_coarsening::Bool
const p4est_partition_allow_for_coarsening::Bool

function P4estMesh{NDIMS}(p4est, tree_node_coordinates, nodes, boundary_names,
current_filename, unsaved_changes,
Expand Down
4 changes: 2 additions & 2 deletions src/meshes/p4est_mesh_view.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ A view on a [`P4estMesh`](@ref).
"""
mutable struct P4estMeshView{NDIMS, NDIMS_AMBIENT, RealT <: Real, Parent} <:
AbstractMesh{NDIMS}
parent::Parent
cell_ids::Vector{Int}
const parent::Parent
const cell_ids::Vector{Int}
unsaved_changes::Bool
current_filename::String
end
Expand Down
8 changes: 4 additions & 4 deletions src/meshes/structured_mesh.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ Different numbers of cells per dimension are possible and arbitrary functions
can be used as domain faces.
"""
mutable struct StructuredMesh{NDIMS, RealT <: Real} <: AbstractMesh{NDIMS}
cells_per_dimension::NTuple{NDIMS, Int}
mapping::Any # Not relevant for performance
mapping_as_string::String
periodicity::NTuple{NDIMS, Bool}
const cells_per_dimension::NTuple{NDIMS, Int}
const mapping::Any # Not relevant for performance
const mapping_as_string::String
const periodicity::NTuple{NDIMS, Bool}
current_filename::String
unsaved_changes::Bool
end
Expand Down
12 changes: 6 additions & 6 deletions src/meshes/structured_mesh_view.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
A view on a structured curved mesh.
"""
mutable struct StructuredMeshView{NDIMS, RealT <: Real} <: AbstractMesh{NDIMS}
parent::StructuredMesh{NDIMS, RealT}
cells_per_dimension::NTuple{NDIMS, Int}
mapping::Any # Not relevant for performance
mapping_as_string::String
const parent::StructuredMesh{NDIMS, RealT}
const cells_per_dimension::NTuple{NDIMS, Int}
const mapping::Any # Not relevant for performance
const mapping_as_string::String
current_filename::String
indices_min::NTuple{NDIMS, Int}
indices_max::NTuple{NDIMS, Int}
const indices_min::NTuple{NDIMS, Int}
const indices_max::NTuple{NDIMS, Int}
unsaved_changes::Bool
end

Expand Down
30 changes: 17 additions & 13 deletions src/meshes/t8code_mesh.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ to manage trees and mesh refinement.
"""
mutable struct T8codeMesh{NDIMS, RealT <: Real, IsParallel, NDIMSP2, NNODES} <:
AbstractMesh{NDIMS}
forest :: T8code.ForestWrapper
is_parallel :: IsParallel
forest::T8code.ForestWrapper
const is_parallel::IsParallel

# This specifies the geometry interpolation for each tree.
tree_node_coordinates::Array{RealT, NDIMSP2} # [dimension, i, j, k, tree]
const tree_node_coordinates::Array{RealT, NDIMSP2} # [dimension, i, j, k, tree]

# Stores the quadrature nodes.
nodes::SVector{NNODES, RealT}
const nodes::SVector{NNODES, RealT}

boundary_names :: Array{Symbol, 2} # [face direction, tree]
current_filename :: String
boundary_names::Array{Symbol, 2} # [face direction, tree]
current_filename::String

ninterfaces :: Int
nmortars :: Int
Expand All @@ -35,13 +35,17 @@ mutable struct T8codeMesh{NDIMS, RealT <: Real, IsParallel, NDIMSP2, NNODES} <:
is_parallel = mpi_isparallel() ? True() : False()

mesh = new{NDIMS, RealT, typeof(is_parallel), NDIMS + 2, length(nodes)}(T8code.ForestWrapper(forest),
is_parallel)

mesh.nodes = nodes
mesh.boundary_names = boundary_names
mesh.current_filename = current_filename
mesh.tree_node_coordinates = tree_node_coordinates
mesh.unsaved_changes = true
is_parallel,
tree_node_coordinates,
nodes,
boundary_names,
current_filename,
-1, # ninterfaces
-1, # nmortars
-1, # nboundaries
-1, # nmpiinterfaces
-1, # nmpimortars
true)

finalizer(mesh) do mesh
# In serial mode we can finalize the forest right away. In parallel
Expand Down
32 changes: 16 additions & 16 deletions src/meshes/unstructured_mesh.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ from a mesh file `filename`.
mutable struct UnstructuredMesh2D{RealT <: Real,
CurvedSurfaceT <: CurvedSurface{RealT}} <:
AbstractMesh{2}
filename :: String
n_corners :: Int
n_surfaces :: Int # total number of surfaces
n_interfaces :: Int # number of interior surfaces
n_boundaries :: Int # number of surfaces on the physical boundary
n_elements :: Int
polydeg :: Int
corners :: Array{RealT, 2} # [ndims, n_corners]
neighbour_information :: Array{Int, 2} # [neighbour node/element/edge ids, n_surfaces]
boundary_names :: Array{Symbol, 2} # [local sides, n_elements]
periodicity :: Bool
element_node_ids :: Array{Int, 2} # [node ids, n_elements]
element_is_curved :: Vector{Bool}
surface_curves :: Array{CurvedSurfaceT, 2} # [local sides, n_elements]
current_filename :: String
unsaved_changes :: Bool # if true, the mesh will be saved for plotting
const filename :: String
const n_corners :: Int
const n_surfaces :: Int # total number of surfaces
const n_interfaces :: Int # number of interior surfaces
const n_boundaries :: Int # number of surfaces on the physical boundary
const n_elements :: Int
const polydeg :: Int
const corners :: Array{RealT, 2} # [ndims, n_corners]
const neighbour_information :: Array{Int, 2} # [neighbour node/element/edge ids, n_surfaces]
const boundary_names :: Array{Symbol, 2} # [local sides, n_elements]
const periodicity :: Bool
const element_node_ids :: Array{Int, 2} # [node ids, n_elements]
const element_is_curved :: Vector{Bool}
const surface_curves :: Array{CurvedSurfaceT, 2} # [local sides, n_elements]
current_filename :: String
unsaved_changes :: Bool # if true, the mesh will be saved for plotting
end

# constructor for an unstructured mesh read in from a file
Expand Down
8 changes: 4 additions & 4 deletions src/semidiscretization/semidiscretization_coupled.jl
Original file line number Diff line number Diff line change
Expand Up @@ -443,10 +443,10 @@ mutable struct BoundaryConditionCoupled{NDIMS,
uEltype <: Real, Indices, CouplingConverter}
# NDIMST2M1 == NDIMS * 2 - 1
# Buffer for boundary values: [variable, nodes_i, nodes_j, cell_i, cell_j]
u_boundary :: Array{uEltype, NDIMST2M1} # NDIMS * 2 - 1
other_orientation :: Int
indices :: Indices
coupling_converter :: CouplingConverter
u_boundary :: Array{uEltype, NDIMST2M1} # NDIMS * 2 - 1
const other_orientation :: Int
const indices :: Indices
const coupling_converter :: CouplingConverter

function BoundaryConditionCoupled(other_semi_index, indices, uEltype,
coupling_converter)
Expand Down
8 changes: 4 additions & 4 deletions src/semidiscretization/semidiscretization_hyperbolic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ mutable struct SemidiscretizationHyperbolic{Mesh, Equations, InitialCondition,

# This guy is a bit messy since we abuse it as some kind of "exact solution"
# although this doesn't really exist...
initial_condition::InitialCondition
const initial_condition::InitialCondition

boundary_conditions::BoundaryConditions
source_terms::SourceTerms
solver::Solver
const boundary_conditions::BoundaryConditions
const source_terms::SourceTerms
const solver::Solver
cache::Cache
performance_counter::PerformanceCounter
end
Expand Down
6 changes: 3 additions & 3 deletions src/solvers/dgsem_unstructured/sort_boundary_conditions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
"""
UnstructuredSortedBoundaryTypes

General container to sort the boundary conditions by type and name for some unstructured meshes/solvers.
General struct to sort the boundary conditions by type and name for some unstructured meshes/solvers.
It stores a set of global indices for each boundary condition type and name to expedite computation
during the call to `calc_boundary_flux!`. The original dictionary form of the boundary conditions
set by the user in the elixir file is also stored for printing.
"""
mutable struct UnstructuredSortedBoundaryTypes{N, BCs <: NTuple{N, Any},
Vec <: AbstractVector{<:Integer}}
boundary_condition_types::BCs # specific boundary condition type(s), e.g. BoundaryConditionDirichlet
const boundary_condition_types::BCs # specific boundary condition type(s), e.g. BoundaryConditionDirichlet
boundary_indices::NTuple{N, Vec} # integer vectors containing global boundary indices
boundary_dictionary::Dict{Symbol, Any} # boundary conditions as set by the user in the elixir file
const boundary_dictionary::Dict{Symbol, Any} # boundary conditions as set by the user in the elixir file
boundary_symbol_indices::Dict{Symbol, Vector{Int}} # integer vectors containing global boundary indices per boundary identifier
end

Expand Down
8 changes: 4 additions & 4 deletions src/time_integration/methods_2N.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ end
# This struct is needed to fake https://github.com/SciML/OrdinaryDiffEq.jl/blob/0c2048a502101647ac35faabd80da8a5645beac7/src/integrators/type.jl#L1
mutable struct SimpleIntegratorOptions{Callback}
callback::Callback # callbacks; used in Trixi.jl
adaptive::Bool # whether the algorithm is adaptive; ignored
const adaptive::Bool # whether the algorithm is adaptive; ignored
dtmax::Float64 # ignored
maxiters::Int # maximal number of time steps
const maxiters::Int # maximal number of time steps
tstops::Vector{Float64} # tstops from https://diffeq.sciml.ai/v6.8/basics/common_solver_opts/#Output-Control-1; ignored
end

Expand All @@ -104,8 +104,8 @@ mutable struct SimpleIntegrator2N{RealT <: Real, uType <: AbstractVector,
iter::Int # current number of time steps (iteration)
p::Params # will be the semidiscretization from Trixi.jl
sol::Sol # faked
f::F # `rhs!` of the semidiscretization
alg::Alg # SimpleAlgorithm2N
const f::F # `rhs!` of the semidiscretization
const alg::Alg # SimpleAlgorithm2N
opts::SimpleIntegratorOptions
finalstep::Bool # added for convenience
end
Expand Down
4 changes: 2 additions & 2 deletions src/time_integration/methods_3Sstar.jl
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ mutable struct SimpleIntegrator3Sstar{RealT <: Real, uType <: AbstractVector,
iter::Int # current number of time step (iteration)
p::Params # will be the semidiscretization from Trixi.jl
sol::Sol # faked
f::F # `rhs!` of the semidiscretization
alg::Alg # SimpleAlgorithm3Sstar
const f::F # `rhs!` of the semidiscretization
const alg::Alg # SimpleAlgorithm3Sstar
opts::SimpleIntegratorOptions
finalstep::Bool # added for convenience
end
Expand Down
Loading
Loading