Problems
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
model
is 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.
inital
is the couple of initial data. It can be generated for instance using the functionInit
as
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.
times
contains relevant parameters of the time integration: in particular the final timeT
and the time-stepdt
. It can be aNamedTuple
with these informations or generated via the functionTimes
.- optionally, the time-solver
solver
can be provided (built-in solvers are the explicit Euler solver,Euler
andEuler_naive
, a symplectic Euler solver,EulerSymp
, and the explicit Runge-Kutta 4 solver,RK4
andRK4_naive
). By default the RK4 solver is used. - optionally, a string
label
can 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)