How to subtract one cellFunction/meshFunction from another without iterating
Asked by
Swarbhanu Chatterjee
Is it possible to do something like, result = a - b , where a, b and result are cellFunctions or meshFunctions? The way I have implemented the same is by iterating over the cells,
for cell in cells(mesh):
result[cell] = a[cell] - b[cell]
But, I want to know if there is a more generic way of doing it, i.e. result = a - b, and whether the dolfin framework can possibly optimize such a computation.
Thanks,
S.
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
This question was reopened
Can you help with this problem?
Provide an answer of your own, or ask Swarbhanu Chatterjee for more information if necessary.
To post a message you must log in.