> On 22 Nov 2016, at 13:16, Martin Kronbichler <kronbichler.mar...@gmail.com> > wrote: > > > Wouldn't it be easier to just create a copy of the vector by > > ghosted_vector.reinit(locally_owned_set, locally_relevant_set, comm); > ghosted_vector = solution; > ghosted_vector.update_ghost_values();
not in my case, because i have a lot of vectors and if I can avoid, i would prefer not to create a ghost equivalent for each one of them. But you are right, if there is only a single solution vector, your approach makes more sense and is also consistent with what we normally do with Trilinos/Petsc, i.e. step-40. > > The reason why there is a VectorView in the MatrixFreeOperators::Base class > is that I want to modify the original vector which I don't assume you need in > your code. (It would actually be dangerous if you used a vector with the > locally relevant dofs as ghosts because that gets the local indices wrong as > compared to the storage of MatrixFree-compatible vectors.) Thanks for the heads up, i don’t use those vectors with any matrix-free operators after the change. The logic is: SETUP -> SOLVE -> CHANGE_GHOST -> MARK -> REFINE -> SETUP -> TRANSFER_SOLUTION -> SOLVE ->... so once i get the solution and fiddle with the ghost sets, i only use it in Kelly and solution transfer. SETUP will use MatrixFree::initialize_dof_vector() to setup new vectors for solution. There should be no problems with that, as far as i can tell. 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.