EIM for part of a LincombOperator #2199
-
I have a full order model |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes, 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 == 2 else op for i, op in enumerate(fom.operator.operators)]
ei_fom = fom.with_(operator=fom.operator.with_(operators=new_ops)) |
Beta Was this translation helpful? Give feedback.
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: