Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
d104ca8
allow Dict and NamedTuple as boundary conditions
JoshuaLampert Jan 26, 2026
0f7a215
unify handling of periodic boundary conditions
JoshuaLampert Jan 26, 2026
bf14cff
add tests for T8codeMesh and UnstructuredMesh2D
JoshuaLampert Jan 26, 2026
3f937c9
test actual boundary conditions
JoshuaLampert Jan 26, 2026
afcc7e4
move new test file to unit tests
JoshuaLampert Jan 26, 2026
53e54d8
format
JoshuaLampert Jan 26, 2026
1241830
enforce SciMLBase.jl v2.134.0
JoshuaLampert Jan 26, 2026
0fdf0b1
revert restriction on SciMLBase.jl
JoshuaLampert Jan 26, 2026
9cbd5ea
also test other dimensions for coverage
JoshuaLampert Jan 26, 2026
41f8f06
coverage
JoshuaLampert Jan 26, 2026
7fe0390
always use NamedTuples instead of Dicts
JoshuaLampert Jan 27, 2026
7be0eec
Merge branch 'main' into unify-bc
JoshuaLampert Jan 27, 2026
a717ac4
use same syntax to for DGMulti to create NamedTuples
JoshuaLampert Jan 27, 2026
cf07be1
fix
JoshuaLampert Jan 27, 2026
8bf3b8a
fix more
JoshuaLampert Jan 27, 2026
cd1b285
format
JoshuaLampert Jan 27, 2026
cdc408d
fixed another one
JoshuaLampert Jan 27, 2026
3afabbf
fix one more
JoshuaLampert Jan 27, 2026
9b65490
consistently use semicolon for NamedTuples
JoshuaLampert Jan 27, 2026
e5a34bb
Add NEWS entry
JoshuaLampert Jan 27, 2026
5befb09
fix structured
JoshuaLampert Jan 27, 2026
dac81d8
use NamedTuple also in UnstructuredSortedBoundaryTypes
JoshuaLampert Jan 27, 2026
4420910
fixes
JoshuaLampert Jan 27, 2026
61cd1e6
remove periodic bcs by default
JoshuaLampert Jan 30, 2026
97d5810
simplify default boundary conditions
JoshuaLampert Jan 30, 2026
92551b2
Apply suggestions from code review
JoshuaLampert Jan 30, 2026
1e11c9c
Merge branch 'main' into unify-bc
JoshuaLampert Feb 4, 2026
552beb3
use NamedTuple for is_on_boundary
JoshuaLampert Feb 6, 2026
66beae6
Merge branch 'main' into unify-bc
JoshuaLampert Feb 6, 2026
6122b3d
Merge branch 'main' into unify-bc
JoshuaLampert Feb 6, 2026
723bae5
add some semicolons for consistency
JoshuaLampert Feb 6, 2026
d84e64b
Apply suggestion from @ranocha
JoshuaLampert Feb 6, 2026
10fb44f
Apply suggestion from @ranocha
JoshuaLampert Feb 6, 2026
0bcc5ed
Merge branch 'main' into unify-bc
JoshuaLampert Feb 6, 2026
e8e717b
improve type stability of UnstructuredSortedBoundaryTypes
ranocha Feb 7, 2026
d35588f
fix order of type parameters
ranocha Feb 7, 2026
603a0a9
Update src/solvers/dgsem_unstructured/sort_boundary_conditions.jl
ranocha Feb 7, 2026
84aecaf
Merge branch 'main' into unify-bc
ranocha Feb 7, 2026
8bf0f1e
No default boundary conditions (#2770)
JoshuaLampert Feb 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 11 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,27 @@ for human readability.
## Changes when updating to v0.15 from v0.14.x

#### Changed

- Boundary conditions are now passed as a `NamedTuple` consistently across all mesh types, i.e., boundary conditions, which
were previously passed as a `Dict` for the `P4estMesh`, `T8codeMesh`, and `UnstructuredMesh2D` mesh types have to be converted to `NamedTuple`s. Also passing boundary conditions as a `Tuple` is no longer supported. This change also makes `boundary_condition_default` obsolete, which is why it was removed ([#2761]).
- The `TreeMesh`, `StructuredMesh` as well as the hypercube constructors of `P4estMesh` and `T8codeMesh` are now non-periodic by default, i.e., you need to
explicitly set the `periodicity` keyword argument to `true` to obtain periodic meshes. This change was made to be consistent with other mesh types and to avoid confusion ([#2770]).
- There are no default boundary conditions anymore in `SemidiscretizationHyperbolic` and `SemidiscretizationHyperbolicParabolic`.
Users now have to explicitly provide boundary conditions via the `boundary_conditions` keyword argument, which were periodic by default before ([#2770]).
- Renamed `energy_internal` for `NonIdealCompressibleEulerEquations1D` to `energy_internal_specific` ([#2762]). This makes `energy_internal` for `NonIdealCompressibleEulerEquations1D` consistent with the rest of Trixi.jl, where `energy_internal` refers to the specific internal energy scaled by density.
- Changed `cons2prim(u, ::NonIdealCompressibleEulerEquations1D)` so that it returns `rho, v1, p`. Previously, `cons2prim` returned `V, v1, T`; this functionalityis now provided by the non-exported function `cons2thermo` ([#2769]).
- Changed `cons2prim(u, ::NonIdealCompressibleEulerEquations1D)` so that it returns `rho, v1, p`. Previously, `cons2prim` returned `V, v1, T`; this functionality is now provided by the non-exported function `cons2thermo` ([#2769]).
- The variable name (printed to the screen and files) of the total energy in the compressible Euler equations has been changed from `rho_e` to `rho_e_total` to avoid confusion with the internal energy `rho_e_internal` ([#2778]).
- `convergence_test` now returns the complete convergence orders and the full errors matrix. To obtain the mean convergence rates, use `Trixi.calc_mean_convergence` on the convergence orders ([#2753]).
- The serial and parallel mesh types have been renamed from `SerialTreeMesh`, `ParallelTreeMesh`, `SerialP4estMesh`, `ParallelP4estMesh`, `SerialT8codeMesh`, and `ParallelT8codeMesh` to `TreeMeshSerial`, `TreeMeshParallel`, `P4estMeshSerial`, `P4estMeshParallel`, `T8codeMeshSerial`, and `T8codeMeshParallel`, respectively ([#2787]).

#### Added

- Added `PengRobinson` equation of state ([#2769]).

## Changes in the v0.14 lifecycle

#### Added

- Added `NonIdealCompressibleEulerEquations1D`, which allows users to specify a non-ideal equation of state. Currently `IdealGas` and `VanDerWaals` are supported ([#2739]).
- Added the APEC (approximate pressure equilibrium preserving with conservation) fluxes of `flux_terashima_etal` and `flux_central_terashima_etal` from [Terashima, Ly, Ihme (2025)](https://doi.org/10.1016/j.jcp.2024.113701) ([#2756]).
- Support for second-order finite volume subcell volume integral (`VolumeIntegralPureLGLFiniteVolumeO2`) and
Expand All @@ -41,6 +50,7 @@ for human readability.
## Changes in the v0.13 lifecycle

#### Added

- Initial 3D support for subcell limiting with `P4estMesh` was added ([#2582], [#2647], [#2688], [#2722]).
In the new version, IDP positivity limiting for conservative variables (using
the keyword `positivity_variables_cons` in `SubcellLimiterIDP()`) and nonlinear
Expand Down
4 changes: 2 additions & 2 deletions docs/literate/src/files/DGMulti_1.jl
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ meshIO = StartUpDG.triangulate_domain(StartUpDG.RectangularDomainWithHole());
mesh = DGMultiMesh(dg, meshIO, Dict(:outer_boundary => 1, :inner_boundary => 2))
#-
boundary_condition_convergence_test = BoundaryConditionDirichlet(initial_condition)
boundary_conditions = (; :outer_boundary => boundary_condition_convergence_test,
:inner_boundary => boundary_condition_convergence_test)
boundary_conditions = (; outer_boundary = boundary_condition_convergence_test,
inner_boundary = boundary_condition_convergence_test)

semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, dg,
source_terms = source_terms,
Expand Down
6 changes: 4 additions & 2 deletions docs/literate/src/files/adaptive_mesh_refinement.jl
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,11 @@ coordinates_min = (-5.0, -5.0)
coordinates_max = (5.0, 5.0)
mesh = TreeMesh(coordinates_min, coordinates_max,
initial_refinement_level = 4,
n_cells_max = 30_000)
n_cells_max = 30_000,
periodicity = true)

semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver)
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver;
boundary_conditions = boundary_condition_periodic)

tspan = (0.0, 10.0)
ode = semidiscretize(semi, tspan);
Expand Down
18 changes: 12 additions & 6 deletions docs/literate/src/files/adding_new_scalar_equations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@ initial_condition_sine(x, t, equation::CubicEquation) = SVector(sinpi(x[1]))

mesh = TreeMesh(-1.0, 1.0, # min/max coordinates
initial_refinement_level = 4,
n_cells_max = 10^4)
n_cells_max = 10^4,
periodicity = true)

solver = DGSEM(3, flux_central) # set polynomial degree to 3

semi = SemidiscretizationHyperbolic(mesh, equation, initial_condition_sine, solver)
semi = SemidiscretizationHyperbolic(mesh, equation, initial_condition_sine, solver;
boundary_conditions = boundary_condition_periodic)

# We wrap the return value of the `initial_condition_sine` inside an `SVector` since that's the approach
# used in Trixi.jl also for systems of equations. We need to index the spatial coordinate `x[1]`,
Expand Down Expand Up @@ -103,7 +105,8 @@ plot!(sol)

## A larger final time: Nonclassical shocks develop (you can even increase the refinement to 12)
semi = remake(semi,
mesh = TreeMesh(-1.0, 1.0, initial_refinement_level = 8, n_cells_max = 10^5))
mesh = TreeMesh(-1.0, 1.0, initial_refinement_level = 8, n_cells_max = 10^5,
periodicity = true))
ode = semidiscretize(semi, (0.0, 0.5)) # set tspan to (0.0, 0.5)
sol = solve(ode, SSPRK43(); ode_default_options()...)
plot(sol)
Expand Down Expand Up @@ -184,11 +187,13 @@ end

mesh = TreeMesh(-1.0, 1.0, # min/max coordinates
initial_refinement_level = 4,
n_cells_max = 10^4)
n_cells_max = 10^4,
periodicity = true)

solver = DGSEM(3, flux_central) # set polynomial degree to 3

semi = SemidiscretizationHyperbolic(mesh, equation, initial_condition_sine, solver)
semi = SemidiscretizationHyperbolic(mesh, equation, initial_condition_sine, solver;
boundary_conditions = boundary_condition_periodic)

## Create ODE problem with given time span
tspan = (0.0, 0.1)
Expand All @@ -206,7 +211,8 @@ plot!(sol)

## A larger final time: Nonclassical shocks develop (you can even increase the refinement to 12)
semi = remake(semi,
mesh = TreeMesh(-1.0, 1.0, initial_refinement_level = 8, n_cells_max = 10^5))
mesh = TreeMesh(-1.0, 1.0, initial_refinement_level = 8, n_cells_max = 10^5,
periodicity = true))
ode = semidiscretize(semi, (0.0, 0.5))
sol = solve(ode, SSPRK43(); ode_default_options()...)
plot(sol)
Expand Down
15 changes: 9 additions & 6 deletions docs/literate/src/files/adding_nonconservative_equation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ end

## Create a uniform mesh in 1D in the interval [-π, π] with periodic boundaries
mesh = TreeMesh(-Float64(π), Float64(π), # min/max coordinates
initial_refinement_level = 4, n_cells_max = 10^4)
initial_refinement_level = 4, n_cells_max = 10^4, periodicity = true)

## Create a DGSEM solver with polynomials of degree `polydeg`
## Remember to pass a tuple of the form `(conservative_flux, nonconservative_flux)`
Expand All @@ -117,7 +117,8 @@ solver = DGSEM(polydeg = 3, surface_flux = surface_flux,
volume_integral = VolumeIntegralFluxDifferencing(volume_flux))

## Setup the spatial semidiscretization containing all ingredients
semi = SemidiscretizationHyperbolic(mesh, equation, initial_condition_sine, solver)
semi = SemidiscretizationHyperbolic(mesh, equation, initial_condition_sine, solver;
boundary_conditions = boundary_condition_periodic)

## Create an ODE problem with given time span
tspan = (0.0, 1.0)
Expand Down Expand Up @@ -150,9 +151,10 @@ error_1 = analysis_callback(sol).l2 |> first
# simulation again.

mesh = TreeMesh(-Float64(π), Float64(π), # min/max coordinates
initial_refinement_level = 5, n_cells_max = 10^4)
initial_refinement_level = 5, n_cells_max = 10^4, periodicity = true)

semi = SemidiscretizationHyperbolic(mesh, equation, initial_condition_sine, solver)
semi = SemidiscretizationHyperbolic(mesh, equation, initial_condition_sine, solver;
boundary_conditions = boundary_condition_periodic)

tspan = (0.0, 1.0)
ode = semidiscretize(semi, tspan);
Expand Down Expand Up @@ -254,7 +256,7 @@ end

## Create a uniform mesh in 1D in the interval [-π, π] with periodic boundaries
mesh = TreeMesh(-Float64(π), Float64(π), # min/max coordinates
initial_refinement_level = 4, n_cells_max = 10^4)
initial_refinement_level = 4, n_cells_max = 10^4, periodicity = true)

## Create a DGSEM solver with polynomials of degree `polydeg`
## Remember to pass a tuple of the form `(conservative_flux, nonconservative_flux)`
Expand All @@ -265,7 +267,8 @@ solver = DGSEM(polydeg = 3, surface_flux = surface_flux,
volume_integral = VolumeIntegralFluxDifferencing(volume_flux))

## Setup the spatial semidiscretization containing all ingredients
semi = SemidiscretizationHyperbolic(mesh, equation, initial_condition_sine, solver)
semi = SemidiscretizationHyperbolic(mesh, equation, initial_condition_sine, solver;
boundary_conditions = boundary_condition_periodic)

## Create an ODE problem with given time span
tspan = (0.0, 1.0)
Expand Down
6 changes: 4 additions & 2 deletions docs/literate/src/files/behind_the_scenes_simulation_setup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ coarsening_patches = ((type = "box", coordinates_min = [0.0, -2.0],

mesh = TreeMesh(coordinates_min, coordinates_max, initial_refinement_level = 2,
n_cells_max = 30_000,
coarsening_patches = coarsening_patches)
coarsening_patches = coarsening_patches,
periodicity = true)

# The created `TreeMesh` looks like the following:

Expand All @@ -58,7 +59,8 @@ solver = DGSEM(polydeg = 3)
# comes into play.

semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_convergence_test,
solver)
solver;
boundary_conditions = boundary_condition_periodic)

# The constructor for the `SemidiscretizationHyperbolic` object calls numerous sub-functions to
# perform the necessary initialization steps. A brief description of the key sub-functions is
Expand Down
1 change: 1 addition & 0 deletions docs/literate/src/files/custom_semidiscretization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ end

semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition,
solver;
boundary_conditions = boundary_condition_periodic,
source_terms = source_terms_standard)

# Now, we can create the `ODEProblem`, solve the resulting ODE
Expand Down
Loading
Loading