Skip to content

EIM for part of a LincombOperator #2199

Answered by sdrave
niklasreich asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, interpolate_operators is not smart enough to only treat parts of operators. I'm not sure if it's worth the effort to add that feature. If you strip the features that you don't need, interpolate_operators reduces to like 10 lines of code. So I would recommend to copy-paste the relevant parts and adapt them to handle the desired operator.

Something like:

op = fom.operator.operators[2]
evaluations = op.range.empty()
for mu in parameter_sample:
    U = fom.solve(mu)
    evaluations.append(op.apply(U, mu=mu)
dofs, basis, data = ei_greedy(evaluations, copy=False, **further_options)
ei_op = EmpiricalInterpolatedOperator(op, dofs, basis, triangular=True)  #False for DEIM
new_ops = [ei_op if i 

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@niklasreich
Comment options

Answer selected by niklasreich
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants