Skip to content

Commit

Permalink
Merge pull request #80 from firedrakeproject/smaclachlan/NoDomain
Browse files Browse the repository at this point in the history
Updating docstrings about t and dt
  • Loading branch information
rckirby authored Jan 29, 2024
2 parents 8cf521e + a0b8f83 commit 8dcaecf
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 26 deletions.
16 changes: 9 additions & 7 deletions irksome/getForm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from operator import mul

import numpy
from firedrake import (Constant, DirichletBC, Function, TestFunction,
from firedrake import (DirichletBC, Function, TestFunction,
assemble, project, split)
from firedrake.__future__ import interpolate
from ufl import diff
Expand Down Expand Up @@ -65,10 +65,11 @@ def getForm(F, butch, t, dt, u0, bcs=None, bc_type=None, splitting=AI,
:arg F: UFL form for the semidiscrete ODE/DAE
:arg butch: the :class:`ButcherTableau` for the RK method being used to
advance in time.
:arg t: a :class:`Constant` referring to the current time level.
Any explicit time-dependence in F is included
:arg dt: a :class:`Constant` referring to the size of the current
time step.
:arg t: a :class:`Function` on the Real space over the same mesh as
`u0`. This serves as a variable referring to the current time.
:arg dt: a :class:`Function` on the Real space over the same mesh as
`u0`. This serves as a variable referring to the current time step.
The user may adjust this value between time steps.
:arg splitting: a callable that maps the (floating point) Butcher matrix
a to a pair of matrices `A1, A2` such that `butch.A = A1 A2`. This is used
to vary between the classical RK formulation and Butcher's reformulation
Expand Down Expand Up @@ -120,12 +121,13 @@ def getForm(F, butch, t, dt, u0, bcs=None, bc_type=None, splitting=AI,
msh = V.mesh()
assert V == u0.function_space()

c = numpy.array([Constant(ci) for ci in butch.c],
MC = MeshConstant(msh)

c = numpy.array([MC.Constant(ci) for ci in butch.c],
dtype=object)

bA1, bA2 = splitting(butch.A)

MC = MeshConstant(msh)
try:
bA1inv = numpy.linalg.inv(bA1)
except numpy.linalg.LinAlgError:
Expand Down
10 changes: 5 additions & 5 deletions irksome/imex.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ class RadauIIAIMEXMethod:
:arg butcher_tableau: A :class:`ButcherTableau` instance giving
the Runge-Kutta method to be used for time marching.
Only RadauIIA is allowed here (but it can be any number of stages).
:arg t: A :class:`firedrake.Constant` instance that always
contains the time value at the beginning of a time step
:arg dt: A :class:`firedrake.Constant` containing the size of the
current time step. The user may adjust this value between
time steps.
:arg t: a :class:`Function` on the Real space over the same mesh as
`u0`. This serves as a variable referring to the current time.
:arg dt: a :class:`Function` on the Real space over the same mesh as
`u0`. This serves as a variable referring to the current time step.
The user may adjust this value between time steps.
:arg u0: A :class:`firedrake.Function` containing the current
state of the problem to be solved.
:arg bcs: An iterable of :class:`firedrake.DirichletBC` containing
Expand Down
9 changes: 5 additions & 4 deletions irksome/stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ def getFormStage(F, butch, u0, t, dt, bcs=None, splitting=None,
advance in time.
:arg u0: a :class:`Function` referring to the state of
the PDE system at time `t`
:arg t: a :class:`Constant` referring to the current time level.
Any explicit time-dependence in F is included
:arg dt: a :class:`Constant` referring to the size of the current
time step.
:arg t: a :class:`Function` on the Real space over the same mesh as
`u0`. This serves as a variable referring to the current time.
:arg dt: a :class:`Function` on the Real space over the same mesh as
`u0`. This serves as a variable referring to the current time step.
The user may adjust this value between time steps.
:arg splitting: a callable that maps the (floating point) Butcher matrix
a to a pair of matrices `A1, A2` such that `butch.A = A1 A2`. This is used
to vary between the classical RK formulation and Butcher's reformulation
Expand Down
20 changes: 10 additions & 10 deletions irksome/stepper.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ def TimeStepper(F, butcher_tableau, t, dt, u0, **kwargs):
:class:firedrake.TestFunction`.
:arg butcher_tableau: A :class:`ButcherTableau` instance giving
the Runge-Kutta method to be used for time marching.
:arg t: A :class:`firedrake.Constant` instance that always
contains the time value at the beginning of a time step
:arg dt: A :class:`firedrake.Constant` containing the size of the
current time step. The user may adjust this value between
time steps.
:arg t: a :class:`Function` on the Real space over the same mesh as
`u0`. This serves as a variable referring to the current time.
:arg dt: a :class:`Function` on the Real space over the same mesh as
`u0`. This serves as a variable referring to the current time step.
The user may adjust this value between time steps.
:arg u0: A :class:`firedrake.Function` containing the current
state of the problem to be solved.
:arg bcs: An iterable of :class:`firedrake.DirichletBC` containing
Expand Down Expand Up @@ -126,11 +126,11 @@ class StageDerivativeTimeStepper:
:class:firedrake.TestFunction`.
:arg butcher_tableau: A :class:`ButcherTableau` instance giving
the Runge-Kutta method to be used for time marching.
:arg t: A :class:`firedrake.Constant` instance that always
contains the time value at the beginning of a time step
:arg dt: A :class:`firedrake.Constant` containing the size of the
current time step. The user may adjust this value between
time steps.
:arg t: a :class:`Function` on the Real space over the same mesh as
`u0`. This serves as a variable referring to the current time.
:arg dt: a :class:`Function` on the Real space over the same mesh as
`u0`. This serves as a variable referring to the current time step.
The user may adjust this value between time steps.
:arg u0: A :class:`firedrake.Function` containing the current
state of the problem to be solved.
:arg bcs: An iterable of :class:`firedrake.DirichletBC` containing
Expand Down

0 comments on commit 8dcaecf

Please sign in to comment.