On 4/22/19 6:33 AM, [email protected] wrote: > > > As you can see, in the above function, I use "std::cout<<" to check where the > segmentation error happens. > > In the result, "It must be here!!!! 1" is printed before the segmentation > error happens, but ""It must be here!!!! 2" is not printed since the > segmentation erorr happens.
An easier way to find these sorts of things is to run a program in a debugger. First, you don't have to recompile the program to figure out where the segmentation fault is, and second you can then inspect the program's local variables such as 'min_grid_level', 'cell', etc. You should really learn how to use a debugger -- you will be *much* more productive with this skill. There are several video lectures that show how to do this. > So, I think the segmentation error happens due to "cell->clear_coarsen_flag > ();" , but I don't know why... > > FYI, in the above function, I set min_grid_level=0 and max_grid_level=3. > > Is there anyone who can help me...? There is little we can guess the problem might be without having access to the whole program. I suspect it is worth asking: Are you running in debug mode? 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]. For more options, visit https://groups.google.com/d/optout.
