Coordinates of Each Component of a solution Vector
Hi
For a solution vector from a Function, i.e.,
Function solution(V);
*solution.vector()
Is there a way to obtain the coordinates of each component in 'exactly' the order in which they are set in the vector.
This is because I need to create objects based on coordinates of each component, carry out some manipulations and set the solution vector in exactly the correct(same) order.
Prior to the 1.1 release, I was able to do the following:
<START>
for (VertexIterator vertex(mesh); !vertex.end(); ++vertex) {
// create objects based on vertex coordinates
// store objects in a std::vector
}
// Manipulate objects here
//Store solution values in correct order
double block[mesh.
dolfin::uint rows[mesh.
for (unsigned int i = 0; i < mesh.num_
rows[i] = i;
// Iterate through objects
for (...)
{
//store solution in appropriate location
block[i] = some_function();
}
Function new_solution(V)
new_solution.
</END>
Granted, this works only for P1 elements but now all my code is broken and I've been trying to fix it to no avail.
Is there a way I can do this?
Many thanks
Pietro
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Pietro Maximoff for more information if necessary.