Hi,
Let’s assume I have given a dolfin::Function f. I would like to find all indices and values at which f > 1. How can I do this using the c++ interface?
Any help is very much appreciated.
Best,
Moerni
Hi,
Let’s assume I have given a dolfin::Function f. I would like to find all indices and values at which f > 1. How can I do this using the c++ interface?
Any help is very much appreciated.
Best,
Moerni
Get the vector as an std::vector using https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecGetValues.html
Then, you can use something like https://stackoverflow.com/questions/25846235/finding-the-indexes-of-all-occurrences-of-an-element-in-a-vector .
In your previous post you say that you don’t think this strategy is reasonable. Please elaborate on why you think so.