Skip to content

Commit

Permalink
Merge branch 'PERK_p3_single_ext' of https://github.com/warisa-r/Trix…
Browse files Browse the repository at this point in the history
…i.jl into PERK_p3_single_ext
  • Loading branch information
warisa-r committed Jun 4, 2024
2 parents 7bf717a + 777f28c commit 05853cf
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 29 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ TrixiNLsolveExt = "NLsolve"
[compat]
CodeTracking = "1.0.5"
ConstructionBase = "1.3"
Convex = "0.15.4"
Convex = "0.16"
DataStructures = "0.18.15"
DelimitedFiles = "1"
DiffEqBase = "6 - 6.143"
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,28 @@
<img width="300px" src="https://trixi-framework.github.io/assets/logo.png">
</p>

***
**Trixi.jl at JuliaCon 2024**<br/>
At this year's JuliaCon in Eindhoven, Netherlands, we will be present with several contributions
from the Trixi Framework ecosystem:

* [**Julia for Particle-Based Multiphysics with TrixiParticles.jl**](https://pretalx.com/juliacon2024/talk/TPFF8L/),<br/>
[*Erik Faulhaber*](https://github.com/efaulhaber/), [*Niklas Neher*](https://github.com/lasnikas/),
10th July 2024, 11:30am–12:00pm, Function (4.1)
* [**Towards Aerodynamic Simulations in Julia with Trixi.jl**](https://pretalx.com/juliacon2024/talk/XH8KBG/),<br/>
[*Daniel Doehring*](https://github.com/danieldoehring/),
10th July 2024, 15:00pm–15:30pm, While Loop (4.2)
* [**libtrixi: serving legacy codes in earth system modeling with fresh Julia CFD**](https://pretalx.com/juliacon2024/talk/JBKVGF/),<br/>
[*Benedict Geihe*](https://github.com/benegee/),
12th July 2024, 14:00pm–17:00pm, Function (4.1)

The last talk is part of the
[Julia for High-Performance Computing](https://pretalx.com/juliacon2024/talk/JBKVGF/)
minisymposium, which this year is hosted by our own [*Hendrik Ranocha*](https://github.com/ranocha/).

We are looking forward to seeing you there ♥️
***

**Trixi.jl** is a numerical simulation framework for conservation
laws written in [Julia](https://julialang.org). A key objective for the
framework is to be useful to both scientists and students. Therefore, next to
Expand Down
2 changes: 1 addition & 1 deletion ext/TrixiConvexECOSExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function Trixi.bisect_stability_polynomial(consistency_order, num_eig_vals,
"reltol_inacc" => 5e-5,
"nitref" => 9,
"maxit" => 100,
"verbose" => 3); silent_solver = true)
"verbose" => 3); silent = true)

abs_p = problem.optval

Expand Down
1 change: 0 additions & 1 deletion src/callbacks_step/alive.jl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ function (alive_callback::AliveCallback)(u, t, integrator)
# We need to check the number of accepted steps since callbacks are not
# activated after a rejected step.
return alive_interval > 0 && ((integrator.stats.naccept % alive_interval == 0 &&
!(integrator.stats.naccept == 0 && integrator.iter > 0) &&
(analysis_interval == 0 ||
integrator.stats.naccept % analysis_interval != 0)) ||
isfinished(integrator))
Expand Down
10 changes: 4 additions & 6 deletions src/callbacks_step/analysis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ or `extra_analysis_errors = (:conservation_error,)`.
If you want to omit the computation (to safe compute-time) of the [`default_analysis_errors`](@ref), specify
`analysis_errors = Symbol[]`.
Note: `default_analysis_errors` are `:l2_error` and `:linf_error` for all equations.
If you want to compute `extra_analysis_errors` such as `:conservation_error` solely, i.e.,
without `:l2_error, :linf_error` you need to specify
If you want to compute `extra_analysis_errors` such as `:conservation_error` solely, i.e.,
without `:l2_error, :linf_error` you need to specify
`analysis_errors = [:conservation_error]` instead of `extra_analysis_errors = [:conservation_error]`.
Further scalar functions `func` in `extra_analysis_integrals` are applied to the numerical
Expand Down Expand Up @@ -119,9 +119,7 @@ function AnalysisCallback(mesh, equations::AbstractEquations, solver, cache;
# We need to check the number of accepted steps since callbacks are not
# activated after a rejected step.
condition = (u, t, integrator) -> interval > 0 &&
((integrator.stats.naccept % interval == 0 &&
!(integrator.stats.naccept == 0 && integrator.iter > 0)) ||
isfinished(integrator))
(integrator.stats.naccept % interval == 0 || isfinished(integrator))

analyzer = SolutionAnalyzer(solver; kwargs...)
cache_analysis = create_cache_analysis(analyzer, mesh, equations, solver, cache,
Expand Down Expand Up @@ -696,7 +694,7 @@ include("analysis_dg3d_parallel.jl")

# Special analyze for `SemidiscretizationHyperbolicParabolic` such that
# precomputed gradients are available. Required for `enstrophy` (see above) and viscous forces.
# Note that this needs to be included after `analysis_surface_integral_2d.jl` to
# Note that this needs to be included after `analysis_surface_integral_2d.jl` to
# have `VariableViscous` available.
function analyze(quantity::AnalysisSurfaceIntegral{Variable},
du, u, t,
Expand Down
5 changes: 2 additions & 3 deletions src/callbacks_step/save_restart.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ function (restart_callback::SaveRestartCallback)(u, t, integrator)
# (total #steps) (#accepted steps)
# We need to check the number of accepted steps since callbacks are not
# activated after a rejected step.
return interval > 0 && (((integrator.stats.naccept % interval == 0) &&
!(integrator.stats.naccept == 0 && integrator.iter > 0)) ||
return interval > 0 && (integrator.stats.naccept % interval == 0 ||
(save_final_restart && isfinished(integrator)))
end

Expand Down Expand Up @@ -198,7 +197,7 @@ function load_adaptive_time_integrator!(integrator, restart_file::AbstractString
# Reevaluate integrator.fsal_first on the first step
integrator.reeval_fsal = true
# Load additional parameters for PIDController
if hasproperty(controller, :err) # Distinguish PIDController from PIController
if hasproperty(controller, :err) # Distinguish PIDController from PIController
controller.err[:] = read(attributes(file)["time_integrator_controller_err"])
end
end
Expand Down
3 changes: 1 addition & 2 deletions src/callbacks_step/save_solution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ function (solution_callback::SaveSolutionCallback)(u, t, integrator)
# (total #steps) (#accepted steps)
# We need to check the number of accepted steps since callbacks are not
# activated after a rejected step.
return interval_or_dt > 0 && (((integrator.stats.naccept % interval_or_dt == 0) &&
!(integrator.stats.naccept == 0 && integrator.iter > 0)) ||
return interval_or_dt > 0 && (integrator.stats.naccept % interval_or_dt == 0 ||
(save_final_solution && isfinished(integrator)))
end

Expand Down
3 changes: 1 addition & 2 deletions src/callbacks_step/visualization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ function (visualization_callback::VisualizationCallback)(u, t, integrator)
# (total #steps) (#accepted steps)
# We need to check the number of accepted steps since callbacks are not
# activated after a rejected step.
return interval > 0 && ((integrator.stats.naccept % interval == 0 &&
!(integrator.stats.naccept == 0 && integrator.iter > 0)) ||
return interval > 0 && (integrator.stats.naccept % interval == 0 ||
isfinished(integrator))
end

Expand Down
2 changes: 1 addition & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
[compat]
Aqua = "0.8"
CairoMakie = "0.10"
Convex = "0.15.4"
Convex = "0.16"
DelimitedFiles = "1"
Downloads = "1"
ECOS = "1.1.2"
Expand Down
4 changes: 2 additions & 2 deletions test/test_tree_1d_advection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ end

@trixi_testset "elixir_advection_perk2.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_perk2.jl"),
l2=[0.014139244532882265],
linf=[0.019997568971592217])
l2=[0.014139242834192841],
linf=[0.01999756655819429])
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
let
Expand Down
20 changes: 10 additions & 10 deletions test/test_unit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1666,16 +1666,16 @@ end
ode_algorithm = Trixi.PairedExplicitRK2(12, tspan, vec(eig_vals))

@test isapprox(ode_algorithm.a_matrix,
[0.06453812656705388 0.02637096434203703
0.09470601372266194 0.04165762264097442
0.12332877820057538 0.05848940361760645
0.1498701503275483 0.07740257694517898
0.173421149536068 0.09930612319120471
0.19261978147927503 0.12556203670254315
0.2052334022622969 0.15840296137406676
0.2073489042901963 0.2017420048007128
0.19135142349998963 0.2631940310454649
0.13942836392940833 0.3605716360705917], atol = 1e-13)
[0.06453812656711647 0.02637096434197444
0.09470601372274887 0.041657622640887494
0.12332877820069793 0.058489403617483886
0.14987015032771522 0.07740257694501203
0.1734211495362651 0.0993061231910076
0.19261978147948638 0.1255620367023318
0.20523340226247055 0.1584029613738931
0.20734890429023528 0.20174200480067384
0.1913514234997008 0.26319403104575373
0.13942836392866081 0.3605716360713392], atol = 1e-13)
end

@testset "PERK Single p3 Constructors" begin
Expand Down

0 comments on commit 05853cf

Please sign in to comment.