Thanks to all of you, I can write a small test that seems to be doing what I want following Marc's suggestion. But I have a few questions (the test code is attached)

*  cell->set_dof_values(local_data, m_completely_distributed_solution); Does set_dof_values set entries in m_completely_distributed_solution that are not owned by the current rank?

No. You determine up front upon construction of the vector elements are locally owned, which are ghosted, and which are stored elsewhere. Writing into entries does not change this decision.


  * m_completely_distributed_solution.compress(VectorOperation::insert);

After set_dof_values, if I call compress(VectorOperation::insert) on that PETSc vector, now, does that mean that I now have entries in that distributed vector that are not owned by the current rank?

Same here.


  * m_locally_relevant_solution = m_completely_distributed_solution;

Will this assignment of a distributed vector to a locally relevant vector correctly set the ghost values?

Yes. That's the point :-)


If this test code is correct, it will be great to add this as a test to deal.ii. My current work will be dependent on this part working correctly, and it will be nice to have a test that can alert us if something changes in the future.

We're always happy to add more tests to the test suite!

Best
 W.

--
------------------------------------------------------------------------
Wolfgang Bangerth          email:                 bange...@colostate.edu
                           www: http://www.math.colostate.edu/~bangerth/

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/800a858e-1294-f4d7-cf7a-9deed2de02c9%40colostate.edu.

Reply via email to