Andrew, you solved my problem (without knowing how, probably... ;-) ...).

My fault. I always forget that I automatically set DYLD_LIBRARY_PATH in my 
.bashrc file to point to the latest stable compilation of my deal.II tree 
(which was not the one I was testing for), so step-16 was loading the previous 
version of the library, where, of course, n_levels was not there. 

For reasons beyond my comprehension gdb was giving the correct answer when 
queried (maybe using the right lib files), but was not working properly when 
the program was run alone.

Sorry.

Changing DYLD path solved also this non-issue.

Luca.

--
Luca Heltai <[email protected]>
http://people.sissa.it/~heltai/
Scuola Internazionale Superiore di Studi Avanzati
Phone:  +39 040 3787 449, Office: 255
--
There are no answers, only cross references.






On 24/nov/2009, at 15.23, Andrew McBride wrote:

> Hi Luca
> 
> For interests sake, I don't seem to get the same problem as you do when I'm 
> running step-16 on my mac with what now seems to be a very similar setup to 
> you. Step-16 runs without problem (see below). I'm on revision 20159. I added 
> the line you added but in void LaplaceProblem<dim>::setup_system
> 
> bash-3.2$ make run
> ============================ Remaking Makefile.dep
> ==============debug========= step-16.cc
> ============================ Linking step-16
> ============================ Running step-16
> DEAL::Cycle 0
> DEAL::Number of degrees of freedom: 25, N Levels: 2
> DEAL::   L0: 8   L1: 25
> DEAL:cg::Starting value 0.510691
> DEAL:cg::Convergence step 5 value 8.74703e-14
> DEAL::Cycle 1
> DEAL::Number of degrees of freedom: 89, N Levels: 3
> DEAL::   L0: 8   L1: 25   L2: 89
> DEAL:cg::Starting value 0.320391
> DEAL:cg::Convergence step 8 value 2.08903e-14
> DEAL::Cycle 2
> DEAL::Number of degrees of freedom: 337, N Levels: 4
> DEAL::   L0: 8   L1: 25   L2: 89   L3: 337
> DEAL:cg::Starting value 0.176257
> DEAL:cg::Convergence step 8 value 2.38879e-13
> DEAL::Cycle 3
> DEAL::Number of degrees of freedom: 1313, N Levels: 5
> DEAL::   L0: 8   L1: 25   L2: 89   L3: 337   L4: 1313
> DEAL:cg::Starting value 0.0920444
> DEAL:cg::Convergence step 8 value 5.93597e-13
> DEAL::Cycle 4
> DEAL::Number of degrees of freedom: 5185, N Levels: 6
> DEAL::   L0: 8   L1: 25   L2: 89   L3: 337   L4: 1313   L5: 5185
> DEAL:cg::Starting value 0.0469815
> DEAL:cg::Convergence step 9 value 6.67930e-14
> DEAL::Cycle 5
> DEAL::Number of degrees of freedom: 20609, N Levels: 7
> DEAL::   L0: 8   L1: 25   L2: 89   L3: 337   L4: 1313   L5: 5185   L6: 20609
> DEAL:cg::Starting value 0.0237274
> DEAL:cg::Convergence step 9 value 1.61650e-13
> 
> 
> 
> Andrew
> 
> On 24 Nov 2009, at 1:44 PM, Luca Heltai wrote:
> 
>> This is really weird...
>> 
>> This is what I get by adding to step-16.cc the following line:
>> 
>> deallog << ", N Levels: " << triangulation.n_levels() << std::endl;
>> 
>> I run it in my debugger, i get this output:
>> 
>> DEAL::Number of degrees of freedom: 25, N Levels: 56
>> 
>> It throws an exception (rightfully so) when trying to get the number of dofs 
>> of level 2 (there is no such a level). In the debugger, if I put a break 
>> point up there, the output is the same, but this triangualation.n_levels() 
>> gives me 2:
>> 
>> 
>> Breakpoint 2, LaplaceProblem<2>::setup_system (this=0x7fff5fbfc2c0) at 
>> step-16.cc:139
>> (gdb) print triangulation.n_levels()
>> $5 = 2
>> (gdb) next
>> DEAL::Number of degrees of freedom: 25, N Levels: 56
>> (gdb)
>> 
>> 
>> I'm lost here. Any idea? n_levels is inlined and returns
>> 
>> number_cache.n_levels;
>> 
>> However, in the debugger, If i print triangulation.number_cache, I get:
>> 
>> $7 = {
>> <dealii::internal::Triangulation::NumberCache<1>> = {
>>   n_lines = 56,
>>   n_lines_level = {
>>     <std::_Vector_base<unsigned int, std::allocator<unsigned int> >> = {
>>       _M_impl = {
>>         <std::allocator<unsigned int>> = {
>>           <__gnu_cxx::new_allocator<unsigned int>> = {<No data fields>}, <No 
>> data fields>},
>>         members of std::_Vector_base<unsigned int, std::allocator<unsigned 
>> int> >::_Vector_impl:
>>         _M_start = 0x105d05160,
>>         _M_finish = 0x105d05168,
>>         _M_end_of_storage = 0x105d05168
>>       }
>>     }, <No data fields>},
>>   n_active_lines = 44,
>>   n_active_lines_level = {
>>     <std::_Vector_base<unsigned int, std::allocator<unsigned int> >> = {
>>       _M_impl = {
>>         <std::allocator<unsigned int>> = {
>>           <__gnu_cxx::new_allocator<unsigned int>> = {<No data fields>}, <No 
>> data fields>},
>>         members of std::_Vector_base<unsigned int, std::allocator<unsigned 
>> int> >::_Vector_impl:
>>         _M_start = 0x105d05170,
>>         _M_finish = 0x105d05178,
>>         _M_end_of_storage = 0x105d05178
>>       }
>>     }, <No data fields>}
>> },
>> members of dealii::internal::Triangulation::NumberCache<2>:
>> n_quads = 25,
>> n_quads_level = {
>>   <std::_Vector_base<unsigned int, std::allocator<unsigned int> >> = {
>>     _M_impl = {
>>       <std::allocator<unsigned int>> = {
>>         <__gnu_cxx::new_allocator<unsigned int>> = {<No data fields>}, <No 
>> data fields>},
>>       members of std::_Vector_base<unsigned int, std::allocator<unsigned 
>> int> >::_Vector_impl:
>>       _M_start = 0x105d05020,
>>       _M_finish = 0x105d05028,
>>       _M_end_of_storage = 0x105d05028
>>     }
>>   }, <No data fields>},
>> n_active_quads = 20,
>> n_active_quads_level = {
>>   <std::_Vector_base<unsigned int, std::allocator<unsigned int> >> = {
>>     _M_impl = {
>>       <std::allocator<unsigned int>> = {
>>         <__gnu_cxx::new_allocator<unsigned int>> = {<No data fields>}, <No 
>> data fields>},
>>       members of std::_Vector_base<unsigned int, std::allocator<unsigned 
>> int> >::_Vector_impl:
>>       _M_start = 0x105d05150,
>>       _M_finish = 0x105d05158,
>>       _M_end_of_storage = 0x105d05158
>>     }
>>   }, <No data fields>}
>> }
>> 
>> which does not seem to have a n_levels member...
>> 
>> Any ideas of what could be going on?
>> 
>> Luca.
>> 
>> 
>> On 24/nov/2009, at 00.22, Wolfgang Bangerth wrote:
>> 
>>> 
>>>> ./step-16
>>>> DEAL::Cycle 0
>>>> --------------------------------------------------------
>>>> An error occurred in line <1630> of file
>>>> <source/multigrid/mg_dof_handler.cc> in function unsigned int
>>>> dealii::MGDoFHandler<<anonymous>, <anonymous> >::n_dofs(unsigned int) const
>>>> [with int dim = 2, int spacedim = 2] The violated condition was:
>>>>  level < mg_used_dofs.size()
>>>> The name and call sequence of the exception was:
>>>>  ExcInvalidLevel(level)
>>>> Additional Information:
>>>> The given level 2 is not in the valid range!
>>> 
>>> I don't see this on linux, but the function is called from
>>> void LaplaceProblem<dim>::setup_system ()
>>> {
>>> [...]
>>> for (unsigned int l=0;l<triangulation.n_levels();++l)
>>>  deallog << "   " << 'L' << l << ": "
>>>         << mg_dof_handler.n_dofs(l);
>>> and I have changed Triangulation.n_levels() yesterday. Can you try to see in
>>> gdb what the value of mg_used_dofs.size() is in MGDoFHandler::n_dofs as well
>>> as what n_levels() returns in setup_system()?
>>> 
>>> Thanks
>>> W.
>>> 
>>> 
>>> -------------------------------------------------------------------------
>>> Wolfgang Bangerth                email:            [email protected]
>>>                               www: http://www.math.tamu.edu/~bangerth/
>>> 
>> 
>> _______________________________________________
>> dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii
> 

_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to