Thanks a lot professor Bangerth. It's my pleasure to get back from you. I have read about the ghost element which is related to the locally_owned_dofs and locally_relevant_dofs. I was confused if we need to create block vector for each of the vectors that are used in the computation later. Like in solve we have created completely_distributed_solution for locally_owned_dofs only and then passed it to locally_relevant_solution which we used to compute output results later. In my case, I have present_mean_solution which I computed inside run so I need to create a block vector for locally_owned_dofs to compute it and then pass it to present mean solution. Please correct me if I am wrong.
And thank you again for creating such a nice community. Best regards, Md Mahmudul Islam On Thu, Jul 10, 2025, 2:08 AM 'Wolfgang Bangerth' via deal.II User Group < [email protected]> wrote: > On 7/9/25 23:40, Md Mahmudul Islam wrote: > > Hope this email finds you all well. I am working on NSE flow. I wrote my > code > > in parallel following step-55. I could compile the code, but when I run > the > > code I get this following error of ghost elements: > > > > An error occurred in line <941> of file > > </usr/src/dealii-v9.6.0/include/deal.II/lac/petsc_vector_base.h> in > function > > > > const dealii::PETScWrappers::internal::VectorReference& > > dealii::PETScWrappers::internal::VectorReference::operator+=(const > > PetscScalar&) const > > > > The violated condition was: > > > > !vector.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, there are two kinds of operations that are typically not > > > > allowed on vectors with ghost elements. First, vectors with ghost > > > > elements are read-only and cannot appear in operations that write into > > > > these vectors. Second, reduction operations (such as computing the > > > > norm of a vector, or taking dot products between vectors) are not > > > > allowed to ensure that each vector element is counted only once (as > > > > opposed to once for the owner of the element plus once for each > > > > process on which the element is stored as a ghost copy). > > I think that the error message is actually quite clear. It explains what > the > problem is, and at the top it also says which function causes trouble. > Which > part is not clear to you, and what stops you from fixing the issue > yourself? > > Best > W. > > -- > ------------------------------------------------------------------------ > Wolfgang Bangerth email: [email protected] > 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 [email protected]. > To view this discussion visit > https://groups.google.com/d/msgid/dealii/f27e9cb4-be79-429c-a98f-a059ca094114%40colostate.edu > . > -- 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 visit https://groups.google.com/d/msgid/dealii/CAFAJfA1Lq_pDs%2B%2BWN7b9_OUvZseaDsy44oDZQma5pBM1yiOTrA%40mail.gmail.com.
