Hi,
    I have been trying to develop a parallelized implementation of the 
Schnakenberg reaction-diffusion system using deal.II. This is my first 
implementation using deal.II and I have been learning quite a bit from the 
detailed tutorials and the amazing documentation. I initially implemented 
the serial version using step-23 as the starting point which worked as 
expected. Then I tried the parallel implementation, and the code runs 
successfully on a single processor. When running it in with more than one 
processor I obtain the following error : 

An error occurred in line <1593> of file 
</home/aadi/dealii-9.2.0/include/deal.II/lac/trilinos_vector.h> in 
function                                                    void 
dealii::TrilinosWrappers::MPI::Vector::set(dealii::TrilinosWrappers::MPI::Vector::size_type,
 
const size_type*, const TrilinosScalar*)                      The violated 
condition was:                                                              
                                                                            
   !has_ghost_elements()                                                    
                                                                            
           Additional information:                                          
                                                                            
                           You are trying an operation on a vector that is 
only allowed if the vector has no ghost elements, but the vector you are 
operating on does have ghost elements. Specifically, vectors with ghost 
elements are read-only and cannot appear in operations that write into 
these vectors.   

The above error shows up in the section of the code where I equate the old 
locally relevant solution with the current locally relevant solution after 
the solve step. I have included specific details below :

1) The solution variables are defined in the following manner :

In the class definition -



*LA::MPI::Vector  locally_relevant_solution_u, locally_relevant_solution_v 
                 , locally_relevant_old_solution_u, 
locally_relevant_old_solution_v ;*
In setup_system() -

 *locally_relevant_solution_u.reinit(locally_owned_dofs,*
*      locally_relevant_dofs,*
*                                                            
 mpi_communicator);*
* locally_relevant_old_solution_u.reinit(locally_owned_dofs,*
*                                                             
 locally_relevant_dofs,*
*                                                                    
 mpi_communicator);*
* locally_relevant_solution_v.reinit(locally_owned_dofs,*
*                                                     
 locally_relevant_dofs, *
*                                                            
 mpi_communicator);*
*locally_relevant_old_solution_v.reinit(locally_owned_dofs,*
*    locally_relevant_dofs,*
*                                                                  
mpi_communicator);*

2) Since this is a time-dependent problem, in the *run()* method of the 
class the old solution variables (after the *solve()* step) are updated as :

locally_relevant_old_solution_u = locally_relevant_solution_u;
locally_relevant_old_solution_v = locally_relevant_solution_v;

Since the old and current solution variables are defined as ghost vectors 
the above assignment is invalid and that's where the error shows up. The 
reaction-diffusion system contains a field-dependent forcing term because 
of which when the *cell_rhs* is constructed, the values in 
*locally_relevant_old_solution_u* are interpolated to the Gauss points 
using *get_function_values()*, and then the source term contribution is 
constructed from there. So the old solution vector must itself contain 
values associated with the ghost elements so that it must be a ghost 
vector, and hence the issue with the assignment statement. Is there any way 
to handle this? Thank you.

Best,
Aaditya  



-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/6c5e284a-ee28-4826-818d-5ad968b6bcf4n%40googlegroups.com.

Reply via email to