From ad94584c32c551ab9990fceebad3d1303c84d5ad Mon Sep 17 00:00:00 2001 From: iomsn Date: Tue, 12 Mar 2024 11:37:47 +0000 Subject: [PATCH] Applied updated autoformatter. --- .../elixir_advection_smview.jl | 31 +++++++++++-------- src/callbacks_step/save_solution_dg.jl | 6 ++-- .../semidiscretization_coupled.jl | 4 +-- .../semidiscretization_hyperbolic.jl | 2 +- 4 files changed, 22 insertions(+), 21 deletions(-) diff --git a/examples/structured_2d_dgsem/elixir_advection_smview.jl b/examples/structured_2d_dgsem/elixir_advection_smview.jl index 6ae569e0550..121dc9946cf 100644 --- a/examples/structured_2d_dgsem/elixir_advection_smview.jl +++ b/examples/structured_2d_dgsem/elixir_advection_smview.jl @@ -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) @@ -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 diff --git a/src/callbacks_step/save_solution_dg.jl b/src/callbacks_step/save_solution_dg.jl index 424821e6b33..7367886ca94 100644 --- a/src/callbacks_step/save_solution_dg.jl +++ b/src/callbacks_step/save_solution_dg.jl @@ -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)))) @@ -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)))) diff --git a/src/semidiscretization/semidiscretization_coupled.jl b/src/semidiscretization/semidiscretization_coupled.jl index 1bd05a2dd19..b8116d3cbd3 100644 --- a/src/semidiscretization/semidiscretization_coupled.jl +++ b/src/semidiscretization/semidiscretization_coupled.jl @@ -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) diff --git a/src/semidiscretization/semidiscretization_hyperbolic.jl b/src/semidiscretization/semidiscretization_hyperbolic.jl index 883f86c4b6e..dcd211671c8 100644 --- a/src/semidiscretization/semidiscretization_hyperbolic.jl +++ b/src/semidiscretization/semidiscretization_hyperbolic.jl @@ -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],