I realized my vector is not an MPI Vector and I am trying to use the 
compress function. This won't work I assume. So I changed my global 
variable to

LA::MPI::Vector configurational_forces;

This means I have to initialize it by the following command:

configurational_forces.reinit(locally_owned_dofs, mpi_com);


Now I have a problem. If I use the above approach and synchronize. 
Everything works, but when I try to output or store, I think something goes 
wrong. In my opinion, I just need to initialize the configurational_forces 
vector with a larger IndexSet and not just to a locally owned one. Is that 
possible?

When I run the problem I receive the following error:

----------------------------------------------------
Exception on processing: 

--------------------------------------------------------
An error occurred in line <131> of file 
</home/seyedali/programming/c++/projects/dealii/source/lac/petsc_vector_base.cc>
 
in function
    dealii::PETScWrappers::internal::VectorReference::operator double() 
const
The violated condition was: 
    (index >= static_cast<size_type>(begin)) && (index < 
static_cast<size_type>(end))
Additional information: 
    You tried to access element 18 of a distributed vector, but only 
elements 0 through 17 are stored locally and can be accessed.
--------------------------------------------------------

Aborting!
----------------------------------------------------


Any ideas?

Kind regards,
S. A. Mohseni

-- 
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