Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion irksome/base_time_stepper.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def get_stage_bounds(self, bounds=None):
if upper is None:
sub = Function(Vbig).assign(PETSc.INFINITY)

if bounds_type == "stage":
if (bounds_type == "stage") or (bounds_type == "galerkin"):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what bounds_type should read for Galerkin and DiscontinuousGalerkin. Maybe stage is fine tag, as there could be multiple ways of imposing Galerkin bounds (e.g. at all the dofs in time or just the last one).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

collocation?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really wasn't sure about this one. We could add a new tag or just work with what we already have. The tags stage and last_stage still make sense and seem to work as one would expect.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

last_stage is only going to make sense if you're in a basis nodal w.r.t. to the end points. But stage surely makes sense -- just apply the bounds to all the degrees of freedom.

if lower is not None:
dats = [lower.dat] * (self.num_stages)
slb = Function(Vbig, val=flatten_dats(dats))
Expand Down
8 changes: 6 additions & 2 deletions irksome/discontinuous_galerkin_stepper.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,10 @@ class DiscontinuousGalerkinTimeStepper(StageCoupledTimeStepper):
instance to be passed to a
`firedrake.MixedVectorSpaceBasis` over the larger space
associated with the Runge-Kutta method
:arg bounds: An optional kwarg used in certain bounds-constrained methods.
"""
def __init__(self, F, order, t, dt, u0, bcs=None, basis_type=None,
quadrature=None, **kwargs):
quadrature=None, bounds=None, **kwargs):
assert order >= 0
self.order = order
self.basis_type = basis_type
Expand All @@ -198,7 +199,10 @@ def __init__(self, F, order, t, dt, u0, bcs=None, basis_type=None,

self.update_b = vecconst(self.el.tabulate(0, (1.0,))[(0,)])

super().__init__(F, t, dt, u0, num_stages, bcs=bcs, **kwargs)
if bounds is not None:
assert (basis_type is None) or (basis_type == "Lagrange") or (basis_type == "Bernstein")
Comment thread
rckirby marked this conversation as resolved.
Outdated

super().__init__(F, t, dt, u0, num_stages, bcs=bcs, bounds=bounds, **kwargs)

def get_form_and_bcs(self, stages, basis_type=None, order=None, quadrature=None, F=None):
if basis_type is None:
Expand Down
8 changes: 6 additions & 2 deletions irksome/galerkin_stepper.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,10 @@ class GalerkinTimeStepper(StageCoupledTimeStepper):
instance to be passed to a
`firedrake.MixedVectorSpaceBasis` over the larger space
associated with the Runge-Kutta method
:arg bounds: An optional kwarg used in certain bounds-constrained methods.
"""
def __init__(self, F, order, t, dt, u0, bcs=None, basis_type=None,
quadrature=None, **kwargs):
quadrature=None, bounds=None, **kwargs):
assert order >= 1
self.order = order
self.basis_type = basis_type
Expand All @@ -186,7 +187,10 @@ def __init__(self, F, order, t, dt, u0, bcs=None, basis_type=None,
self.quadrature = quadrature
assert np.size(quadrature.get_points()) >= order

super().__init__(F, t, dt, u0, order, bcs=bcs, **kwargs)
if bounds is not None:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above discussion in DG stepper for how this logic should go. Once we resolve that, make this the same.

assert (basis_type is None) or (basis_type == "Lagrange") or (basis_type == "Bernstein")

super().__init__(F, t, dt, u0, order, bcs=bcs, bounds=bounds, **kwargs)

def get_form_and_bcs(self, stages, basis_type=None, order=None, quadrature=None, F=None):
if basis_type is None:
Expand Down