Skip to contents

PDEProblem(prob, extrapolation, space) wraps a problem obtained from a PDE with the extrapolation and spatial domain data a discretization produced. discretize(sys, discretizer, ...) turns a PDESystem() into a solver ready problem and symbolic_discretize(sys, discretizer, ...) into its discretized system; both are generic functions that dispatch on the class of discretizer, for discretization packages to extend (as the methods of MethodOfLines or NeuralPDE extend SciMLBase). modelcompR itself has no PDE discretizer, so the default methods stop with an error.

Usage

PDEProblem(prob, extrapolation = NULL, space = NULL)

discretize(sys, discretizer, ...)

# Default S3 method
discretize(sys, discretizer, ...)

symbolic_discretize(sys, discretizer, ...)

# Default S3 method
symbolic_discretize(sys, discretizer, ...)

Arguments

prob

The problem of the discretized PDE.

extrapolation, space

Extrapolation and spatial domain data.

sys

A PDE system.

discretizer

A discretization algorithm.

...

Options of the discretizer.

Value

A PDEProblem, or what the method of the discretizer returns.

Examples

prob <- PDEProblem(ODEProblem(function(u, p, t) -u, c(1, 2), c(0, 1)), space = list(x = c(0, 1)))
class(prob)
#> [1] "PDEProblem"   "SciMLProblem"
discretize.MyGrid <- function(sys, discretizer, ...) "discretized"
discretize(NULL, structure(list(), class = "MyGrid"))
#> [1] "discretized"