Solving
Time-stepping
ImmersedBodies.solve
— Functionsolve([f], prob::Problem; t, [save], [solver_kw])
Solve the problem from time 0 to t
. See solve!
.
ImmersedBodies.solve!
— Functionsolve!([f], solver::AbstractSolver; t, save=SaveNothing(), log=true)
Solve for the state up to time t
, calling the function f(state, i, n)
at each timestep i
from 1:n
. save
is a SolutionSaver
that determins how to write the solution.
ImmersedBodies.advance!
— Functionadvance!(::AbstractSolver)
Compute the state at the next time step in place.
ImmersedBodies.AbstractSolver
— TypeAbstractSolver
Solves a Problem
.
Input/Output
ImmersedBodies.save_state
— Functionsave_state(filename, state::State)
save_state(io, state::State)
Write the contents of a State
to a file or IO stream. The result can be loaded with load_state
.
ImmersedBodies.load_state
— Functionload_state(filename, prob::Problem)
load_state(io, prob::Problem)
Read the contents of a State
from a file or IO stream. The state can be written with save_state
.
ImmersedBodies.load_state!
— Functionload_state!(filename, state::State)
load_state!(io, state::State)
load_state
, but update state
in place.
ImmersedBodies.Timesteps
— TypeTimesteps
Specifies timesteps to save the solution at.
ImmersedBodies.TimestepRange
— TypeTimestepRange(; start, step, [length]) :: Timesteps
Specifies every step
th timestep starting at start
. If specified, only include length
timesteps.
ImmersedBodies.SolutionValues
— TypeSolutionValues(times::Timesteps, vals)
SolutionValues(times::Timesteps, vals...)
Specifies to save certain values at each time in times
. vals
is a collection of name => value
mapping a name string to a SolutionValue
.
ImmersedBodies.SolutionValue
— TypeImmersedBodies.ArrayValue
— TypeArrayValue(f!, T, dims) :: SolutionValue
A function f!(y, state)
that sets an array y
with size dims
.
ImmersedBodies.MultiDomainValue
— TypeMultiDomainValue(f!, coords::AbstractVector)
A function f!(y, state)
that sets a 3D array y
with corresponding coordinates coords
. array[i,j,level]
should be at coordinate (x[i], y[j])
where (x, y) = coords[level]
.
See also coords
.
ImmersedBodies.SolutionSaver
— TypeSolutionSaver
A backend for saving SolutionValue
s at certain Timesteps
.
ImmersedBodies.SaveNothing
— TypeSaveNothing() :: SolutionSaver
Do not save anything.
ImmersedBodies.SaveHDF5
— TypeHDF5Saver(file, paths...; [mode])
Saves to the HDF5 file, filename, or group file
. paths
is pairs of path => val
that specifies to save a representation of val
at path
in the HDF5 file. If file
is a filename, open the file with mode
. val
can be an instance of: