Soon Hoe,
Hi. I am a beginner in deal.II. I plan to solve a 2d time dependent heat
conduction equation using local adaptive refinement with every few time
steps using deal.II. I modified example 23 of the tutorial to do so. The
domain used is [0,1]x[0,1]. The initial condition is 1 on [0.4,0.6]^2 and 0
elsewhere, whereas the boundary condition is set to 0 on all boundaries of
the domain.
So far my codes work well with adaptive refinement every cycles but when I
switched to local adaptive refinement with every time steps (with
KellyErrorEstimator), I kept getting error messages. I have been debugging
for a long time but I still cannot figure it out. I suspect it has
something to do with SolutionTransfer... or I missed something. Attached
are my codes (goto "remark" to see the problem). Any help would be much
appreciated.
I assume you mean this error:
Time step #2; advancing to t = 0.004.
--------------------------------------------------------
An error occurred in line <1322> of file
</home/people/wolf/p/deal.II/ultra450/deal.II/include/deal.II/lac/vector.h>
in function
Number& dealii::Vector<number>::operator()(unsigned int) [with
Number = double]
The violated condition was:
i<vec_size
The name and call sequence of the exception was:
ExcIndexRange(i,0,vec_size)
Additional Information:
Index 81 is not in [0,81[
----------------------------------------------------------
The error is a result of the fact that you access element 81 of a vector
(system_rhs) that only has elements 0..80. To avoid this you need to
make sure that whenever you change the mesh and call
dof_handler.distribute_dofs that *all* vectors (including the right hand
side vector) are set to the correct size, namely dof_handler.n_dofs().
Best
WB
------------------------------------------------------------------------
Wolfgang Bangerth email: [email protected]
www: http://www.math.tamu.edu/~bangerth/
_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii