Unverified Commit 5d99181f authored by Stephan Rave's avatar Stephan Rave Committed by GitHub

Merge pull request #1102 from pymor/improve_project_concatenation

Improve projection of ConcatenationOperator
parents 7db8dafa 6db8ed35
Pipeline #65190 passed with stages
in 50 minutes and 25 seconds
......@@ -150,10 +150,19 @@ class ProjectRules(RuleTable):
elif range_basis is not None and last.linear and not last.parametric:
V = last.apply_adjoint(range_basis)
return project(op.with_(operators=op.operators[1:]), V, source_basis)
else:
projected_first = project(first, None, source_basis)
projected_last = project(last, range_basis, None)
return ConcatenationOperator((projected_last,) + op.operators[1:-1] + (projected_first,), name=op.name)
# the concatenation is too complicated to directly project efficiently
# try to simplify the operators in the concatenation by expanding
from pymor.algorithms.simplify import expand
expanded_op = expand(op)
if not isinstance(expanded_op, ConcatenationOperator):
# expanding was successful
return self.apply(expanded_op)
# at least we can try to partially project the outer operators
projected_first = project(first, None, source_basis)
projected_last = project(last, range_basis, None)
return ConcatenationOperator((projected_last,) + op.operators[1:-1] + (projected_first,), name=op.name)
@match_class(AdjointOperator)
def action_AdjointOperator(self, op):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment