Main architecture
A central object in WaterWaves1D.jl is the Problem structure, which contains all information on a numerically discretized initial-value problem. In practice, a problem is generated as
problem = Problem( model, initial, times ; solver, label )where
modelis related to the (spatially discretized) equation at stake. Built-in models are typically generated as
model = MyModel( param ; kwargs )where param is a NamedTuple containing relevant parameters of the model and of the spatial grid, and kwargs are some optional arguments allowing some choices in the discretization (for instance dealiasing), and a label for future references.
initalis the couple of initial data. It can be generated for instance using the functionInitas
initial = Init( η, v )where η and v are two functions (representing respectively the surface deformation and the derivative of the trace of the velocity potential at the surface). Alternatively, it can also be built from the values of these functions at equally-spaced collocation points.
timescontains relevant parameters of the time integration: in particular the final timeTand the time-stepdt. It can be aNamedTuplewith these informations or generated via the functionTimes.- optionally, the time-solver
solvercan be provided (built-in solvers are the explicit Euler solver,EulerandEuler_naive, a symplectic Euler solver,EulerSymp, and the explicit Runge-Kutta 4 solver,RK4andRK4_naive). By default the RK4 solver is used. - optionally, a string
labelcan be provided for future reference. It is inferred from the model if not provided.
Once it has been built, problem contains the raw data, data (initially just the initial data), in addition to model, initial, times, solver and label. The initial-value problem is then numerically integrated (filling data) with
solve!(problem)