There is a complication of using LA::distributed::Vector initialized with 
MatrixFree::initialize_dof_vector() in Kelly estimator.
A naïve usage would lead to a problem which obviously has to do with 
locally relevant cells and their dofs:

    Number 
dealii::LinearAlgebra::distributed::Vector<double>::operator()(const 
size_type) const
The violated condition was: 
    partitioner->in_local_range (global_index) || 
partitioner->ghost_indices().is_element(global_index)
Additional information: 
    You tried to access element 4665 of a distributed vector, but this 
element is not stored on the current processor. Note: The range of locally 
owned elements is 0 to 4413, and there are 12 ghost elements that this 
vector can access.


Martin explains 
here https://github.com/dealii/dealii/pull/3329#discussion_r89073738 that 
in this case LA::distributed::Vector 

...holds all locally active DoFs but also some of the locally relevant 
> DoFs. The selection of DoFs stored in a distributed vector initialized 
> through MatrixFreeis such that one can read all degrees of freedom on all 
> locally relevant elements (locally active) plus the degrees of freedom that 
> contraints expand into from the locally owned cells. (Most of the locally 
> relevant but not locally active dofs would never be accessed in 
> matrix-vector products and result in too much data sent around.



I wonder what is the best workaround given the fact that i have quite a 
number of such vectors?

What comes to mind is before doing postprocessing of solution I need to 
change the set of ghost dofs to cover standard locally_relevant_dofs.
Probably the only way is to copy content into a temporary vector, then call 
reinit(locally_owned, locally_relevant, mpi) and assign the content back.
Then i would use such vectors in Kelly and solution transfer. 
However for the core part (solution), the vectors would still be 
initialized with MatrixFree in setup_dofs() or alike after refinement and 
before the solution.

Any better ways to accomplish this? Maybe implement/add 
LA::distributed::Vector::set_ghost_set(const IndexSet &) but not sure it's 
worth the effort.

Regards,
Denis.

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to