TimeProjector#154
Conversation
…irksome into rckirby/galerkin_label
…Irksome into rckirby/galerkin_label
rckirby
left a comment
There was a problem hiding this comment.
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.
| Q = o.quadrature | ||
| assert order+1 <= len(self.phi) | ||
|
|
||
| # compute the hierarchical mass matrix (always the identity) |
There was a problem hiding this comment.
If it's the identity why do we compute it?
|
|
||
| # 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)) |
There was a problem hiding this comment.
This seems unclear to me what's actually happening.
…/Irksome into pbrubeck/time-projector
9c20cbe to
88700dd
Compare
| 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) |
There was a problem hiding this comment.
this could be hidden in an if-statement and/or a helper function
| R = VectorFunctionSpace(mesh, "Real", 0, dim=L_test.space_dimension()) | ||
| phi = Coefficient(R) |
There was a problem hiding this comment.
This should be done differently, avoiding the Real space.
| # internal state to be used inside projected expressions | ||
| u1 = Function(u0) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
This should be done differently, avoiding the DG space. Perhaps with a purely-symbolic ufl.FunctionSpace.
Enable projection-in-time of expressions (usually the Gateaux derivative of a conserved quantity). This is useful to eliminate auxiliary variables.