JoshuaLampert / DispersiveShallowWater.jl

Structure-preserving numerical methods for dispersive shallow water models
https://joshualampert.github.io/DispersiveShallowWater.jl/
MIT License
15 stars 3 forks source link

Include different types of bathymetries #130

Closed JoshuaLampert closed 2 months ago

JoshuaLampert commented 2 months ago

In #127 we decided to define different types of bathymetries (flat, variable, mild slope) as structs, which are used to dispatch. In any case, we keep the bathymetry as variable in the equation to be able to possibly extend the package in the future to also deal with time-dependent bathymetries. This concept should also be used for the existing equations:

ranocha commented 2 months ago

Another question, which just came into my mind: What do we do if you pass bathymetry_flat to the equation, but then set a non-constant bathymetry in the initial condition. I haven't thought about that before. Should this raise a warning or an error or nothing?

Where could we add such a check? My first idea was to look at create_cache, but that doesn't have the initial condition

It could live in Semidiscretization, but then I would only add such a check when all equations have a field bathymetry (or bathymetry_type), i.e. after finishing #130.

Originally posted by @JoshuaLampert in https://github.com/JoshuaLampert/DispersiveShallowWater.jl/issues/135#issuecomment-2293798516

JoshuaLampert commented 2 months ago

When all AbstractShallowWaterEquations1D have a bathymetry_type and have $\eta$, $v$ and $b$ as variables in the ODE, we can also make more functions dispatch on AbstractShallowWaterEquations1D rather than on the different equations, e.g., varnames, initial_condition_dingemans, initial_condition_well_balancedness, and all the conversion functions like prim2cons, cons2prim etc.

JoshuaLampert commented 2 months ago

We could think of making bathymetry_variable the default for all equations.

ranocha commented 2 months ago

Closed by #147