Thanks a lot for your reply. I tried to take constraints into account in the sparsity pattern, but I don't know how to do it for a rectangular matrix such in my case. I have rows equal to the number of velocity dofs and columns equal to pressure dofs. I didn't found any function for sparsity pattern in the documentation that take in account different constraints (in my case velocity and pressure constraints).
Maybe I didn't looking for enough, but I actually stuck in this problem. Thanks Il giorno lun 21 ott 2019 alle ore 04:18 Wolfgang Bangerth < bange...@colostate.edu> ha scritto: > On 10/15/19 1:55 AM, Mauro Murer wrote: > > s in the system matrices. > > All went well until I tried to implement a mesh refinement. > > In particular, when I assemble the gradient operator after the > refinement of > > the mesh (increasing the dof of the problem), this error occurs when > > "distribute_local_to_global" function is called: > > > > *The violated condition was: > > (this_cols[counter] == col_indices[i]) || (values[i] == number2()) > > Additional information: > > You are trying to access the matrix entry with index <35518,4519>, but > this > > entry does not exist in the sparsity pattern of this matrix. > > > > The most common cause for this problem is that you used a method to > build the > > sparsity pattern that did not (completely) take into account all of the > > entries you will later try to write into. An example would be building a > > sparsity pattern that does not include the entries you will write into > due to > > constraints on degrees of freedom such as hanging nodes or periodic > boundary > > conditions. In such cases, building the sparsity pattern will succeed, > but you > > will get errors such as the current one at one point or other when > trying to > > write into the entries of the matrix.* > > > > > > I found in the documentation the "add_entries" command, in such a way to > add > > the matrix entry in the sparsity pattern, but I don't know if it is the > right > > way to proceed. Any suggestions??? > > You need to take constraints into account when you build the sparsity > pattern > but I believe from your screen shot that you don't. Take a look at step-6, > for > example: > > https://github.com/dealii/dealii/blob/master/examples/step-6/step-6.cc#L225 > > Best > W. > > -- > ------------------------------------------------------------------------ > Wolfgang Bangerth email: bange...@colostate.edu > 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 dealii+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/dealii/3efefd13-6554-9fb3-fd7e-b6bf230d4b00%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 dealii+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/CAK3LiWd5gJC4o7Kj_S2UJ-7yHaTwd2Pgpz_QdMgOSff4s8J9FQ%40mail.gmail.com.