Skip to content

Commit

Permalink
Applied updated autoformatter.
Browse files Browse the repository at this point in the history
  • Loading branch information
iomsn committed Mar 12, 2024
1 parent 7e32f7a commit ad94584
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 21 deletions.
31 changes: 18 additions & 13 deletions examples/structured_2d_dgsem/elixir_advection_smview.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,18 @@ coupling_function = (x, u, equations_other, equations_own) -> u
# Define the coupled boundary conditions
boundary_conditions1 = (
# Connect left boundary with right boundary of left mesh
x_neg = BoundaryConditionCoupled(2, (:end, :i_forward), Float64, coupling_function),
x_pos = BoundaryConditionCoupled(2, (:begin, :i_forward), Float64, coupling_function),
x_neg = BoundaryConditionCoupled(2, (:end, :i_forward), Float64,
coupling_function),
x_pos = BoundaryConditionCoupled(2, (:begin, :i_forward), Float64,
coupling_function),
y_neg = boundary_condition_periodic,
y_pos = boundary_condition_periodic)
boundary_conditions2 = (
# Connect left boundary with right boundary of left mesh
x_neg = BoundaryConditionCoupled(1, (:end, :i_forward), Float64, coupling_function),
x_pos = BoundaryConditionCoupled(1, (:begin, :i_forward), Float64, coupling_function),
x_neg = BoundaryConditionCoupled(1, (:end, :i_forward), Float64,
coupling_function),
x_pos = BoundaryConditionCoupled(1, (:begin, :i_forward), Float64,
coupling_function),
y_neg = boundary_condition_periodic,
y_pos = boundary_condition_periodic)

Expand All @@ -84,24 +88,25 @@ ode = semidiscretize(semi, (0.0, 1.0));
summary_callback = SummaryCallback()

# The AnalysisCallback allows to analyse the solution in regular intervals and prints the results
analysis_callback1 = AnalysisCallback(semi1, interval=100)
analysis_callback2 = AnalysisCallback(semi2, interval=100)
analysis_callback1 = AnalysisCallback(semi1, interval = 100)
analysis_callback2 = AnalysisCallback(semi2, interval = 100)
analysis_callback = AnalysisCallbackCoupled(semi, analysis_callback1, analysis_callback2)

analysis_interval = 100
alive_callback = AliveCallback(analysis_interval=analysis_interval)
alive_callback = AliveCallback(analysis_interval = analysis_interval)

# The SaveSolutionCallback allows to save the solution to a file in regular intervals
save_solution = SaveSolutionCallback(interval=100,
save_initial_solution=true,
save_final_solution=true,
solution_variables=cons2prim)
save_solution = SaveSolutionCallback(interval = 100,
save_initial_solution = true,
save_final_solution = true,
solution_variables = cons2prim)

# The StepsizeCallback handles the re-calculation of the maximum Δt after each time step
stepsize_callback = StepsizeCallback(cfl=1.6)
stepsize_callback = StepsizeCallback(cfl = 1.6)

# Create a CallbackSet to collect all callbacks such that they can be passed to the ODE solver
callbacks = CallbackSet(summary_callback, analysis_callback, save_solution, stepsize_callback)
callbacks = CallbackSet(summary_callback, analysis_callback, save_solution,
stepsize_callback)

###############################################################################
# run the simulation
Expand Down
6 changes: 2 additions & 4 deletions src/callbacks_step/save_solution_dg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ function save_solution_file(u, time, dt, timestep,
# compute the solution variables via broadcasting, and reinterpret the
# result as a plain array of floating point numbers
data = Array(reinterpret(eltype(u),
solution_variables.(reinterpret(SVector{
nvariables(equations),
solution_variables.(reinterpret(SVector{nvariables(equations),
eltype(u)}, u),
Ref(equations))))

Expand Down Expand Up @@ -117,8 +116,7 @@ function save_solution_file(u, time, dt, timestep,
# compute the solution variables via broadcasting, and reinterpret the
# result as a plain array of floating point numbers
data = Array(reinterpret(eltype(u),
solution_variables.(reinterpret(SVector{
nvariables(equations),
solution_variables.(reinterpret(SVector{nvariables(equations),
eltype(u)}, u),
Ref(equations))))

Expand Down
4 changes: 1 addition & 3 deletions src/semidiscretization/semidiscretization_coupled.jl
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,7 @@ function allocate_coupled_boundary_condition(boundary_condition, direction, mesh
end

# In 2D
function allocate_coupled_boundary_condition(boundary_condition::BoundaryConditionCoupled{
2
},
function allocate_coupled_boundary_condition(boundary_condition::BoundaryConditionCoupled{2},
direction, mesh, equations, dg::DGSEM)
if direction in (1, 2)
cell_size = size(mesh, 2)
Expand Down
2 changes: 1 addition & 1 deletion src/semidiscretization/semidiscretization_hyperbolic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ end

function check_periodicity_mesh_boundary_conditions(mesh::Union{TreeMesh{2},
StructuredMesh{2},
StructuredMeshView{2}},
StructuredMeshView{2}},
boundary_conditions::Union{NamedTuple,
Tuple})
check_periodicity_mesh_boundary_conditions_x(mesh, boundary_conditions[1],
Expand Down

0 comments on commit ad94584

Please sign in to comment.