Skip to content

TimeProjector#154

Open
pbrubeck wants to merge 31 commits into
masterfrom
pbrubeck/time-projector
Open

TimeProjector#154
pbrubeck wants to merge 31 commits into
masterfrom
pbrubeck/time-projector

Conversation

@pbrubeck
Copy link
Copy Markdown
Collaborator

@pbrubeck pbrubeck commented May 28, 2025

Enable projection-in-time of expressions (usually the Gateaux derivative of a conserved quantity). This is useful to eliminate auxiliary variables.

Copy link
Copy Markdown
Collaborator

@rckirby rckirby left a comment

Choose a reason for hiding this comment

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

Mostly good (I think).

  • Do we know that the approach being used here doesn't explode the complexity when we use projectors? How would we check?
  • Can we get a demo before merging.

Comment thread irksome/galerkin_stepper.py
Comment thread irksome/galerkin_stepper.py Outdated
Q = o.quadrature
assert order+1 <= len(self.phi)

# compute the hierarchical mass matrix (always the identity)
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.

If it's the identity why do we compute it?

Comment thread irksome/galerkin_stepper.py Outdated

# compute the L2-Riesz representation by undoing the integral against the test coefficient
fc = sum(it.integrand() for it in Fc.integrals())
fproj = expand_derivatives(diff(fc, c))
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.

This seems unclear to me what's actually happening.

Comment thread irksome/galerkin_stepper.py Outdated
@pbrubeck pbrubeck force-pushed the rckirby/galerkin_label branch from 9c20cbe to 88700dd Compare October 22, 2025 11:18
Base automatically changed from rckirby/galerkin_label to master October 24, 2025 03:41
Comment thread irksome/galerkin_stepper.py Outdated
Comment thread irksome/galerkin_stepper.py Outdated
Comment thread irksome/galerkin_stepper.py Outdated
Comment on lines +71 to +84
qpts = Q.get_points()
qwts = Q.get_weights()

# internal state to be used inside projected expressions
u1 = Function(u0)
# symbolic Coefficient with the temporal test function
mesh = as_domain(u0.function_space().mesh())
R = VectorFunctionSpace(mesh, "Real", 0, dim=L_test.space_dimension())
phi = Coefficient(R)
# apply time projectors
F = expand_time_projectors(F, L_trial, t, dt, u0, u1, stages, phi)
# tabulate the temporal test function
ref_el = L_test.get_reference_element()
phisub = vecconst(Legendre(ref_el, L_test.degree()).tabulate(0, qpts)[(0,)].T)
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.

this could be hidden in an if-statement and/or a helper function

Comment on lines +78 to +79
R = VectorFunctionSpace(mesh, "Real", 0, dim=L_test.space_dimension())
phi = Coefficient(R)
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.

This should be done differently, avoiding the Real space.

Comment on lines +74 to +75
# internal state to be used inside projected expressions
u1 = Function(u0)
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.

Maybe we can use ufl.Variable + ufl.Label to lag the internal state within the already expanded TimeProjector.

This was suggested in #221

assert order+1 <= len(self.phi)
f, = o.ufl_operands
mesh = as_domain(self.u0.function_space().mesh())
R = TensorFunctionSpace(mesh, "DG", 0, shape=f.ufl_shape)
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.

This should be done differently, avoiding the DG space. Perhaps with a purely-symbolic ufl.FunctionSpace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants