Yiyang, I am not quite sure why, but the code
estimated_error_per_cell = distributed_error_per_cell; generates an incorrect result. You can replace it with for(auto cell = tria.begin_active(); cell != tria.end(); ++cell) if(cell->is_locally_owned()) estimated_error_per_cell(cell->active_cell_index()) = distributed_error_per_cell(cell->active_cell_index()); Can you try if that works for you? I will continue to investigate what is going on. On Sat, Oct 28, 2017 at 1:00 PM, Yiyang Zhang <zyycele...@gmail.com> wrote: > Hello Prof. Bangerth, > > I have attached a test case. > > Best, > Yiyang > > On Friday, October 27, 2017 at 5:12:49 PM UTC-5, Wolfgang Bangerth wrote: >> >> On 10/27/2017 02:13 PM, Yiyang Zhang wrote: >> > >> > Yes I think I am setting them in a way that is exactly same throughout >> > all processes. >> > Since I can check the n_active_cells() before the refinement, and also >> > the refine_flags and coarsen_flags for each process. They are the same >> > for each process. But after the refinement, the number of active_cells >> > suddenly becomes different. >> > >> > I attached the refine_mesh() code. >> >> Can you fabricate a complete testcase that we can run that shows this >> phenomenon? >> >> Best >> W. >> >> -- >> ------------------------------------------------------------------------ >> Wolfgang Bangerth email: bang...@colostate.edu >> www: >> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.math.colostate.edu_-7Ebangerth_&d=DwIBaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw&m=Avq4CtF3shqaTzaJnB2SqcYaMgNDwAkFHlvEyo45f24&s=GT8h1eKbhfid-4BHzYVtaoniDOC2gT0gnXEmZiLsVLY&e= >> > > -- > The deal.II project is located at > https://urldefense.proofpoint.com/v2/url?u=http-3A__www.dealii.org_&d=DwIBaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw&m=Avq4CtF3shqaTzaJnB2SqcYaMgNDwAkFHlvEyo45f24&s=3zUo9GeZ-rDnZ1tlZXSuEvw4gcM279OP2eh_1qCYcZs&e= > > For mailing list/forum options, see > https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_forum_dealii-3Fhl-3Den&d=DwIBaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw&m=Avq4CtF3shqaTzaJnB2SqcYaMgNDwAkFHlvEyo45f24&s=4KjaGXKFUbi23g-CuQL1kAAPFr7IXyw1mGiKnk6eROs&e= > > --- > 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://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_optout&d=DwIBaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw&m=Avq4CtF3shqaTzaJnB2SqcYaMgNDwAkFHlvEyo45f24&s=Vsm-Y6HviYtRxDZP6E1hzM3JP9jGx_a8utwaysqI8a0&e= > . -- Timo Heister http://www.math.clemson.edu/~heister/ -- 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.