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