In FEM example dune-grid-howto/finiteelements.cc<br>described on page 56 in grid-howto.pdf,<br><br>In assembling procedure of block vector b on page 59 line 177, there is some error/mistake.<br>the code looks like<br><br>Loop over element iterator<br>
{<br>const Dune :: QuadratureRule < ctype , dim >& rule2 = Dune :: QuadratureRules < ctype , dim >:: rule (<br>gt ,2) ;<br>for ( typename Dune :: QuadratureRule < ctype , dim >:: const_iterator r = rule2 . begin () ;<br>
r != rule2 . end () ; ++ r )<br>{<br>ctype weight = r - > weight () ;<br>ctype detjac = it - > geometry () . i n t e g r a t i o n E l e m e n t (r - > position () ) ;<br>for ( int i = 0 ; i < vertexsize ; i ++)<br>
{<br>// e v a l u a t e t h e i n t e g r a n d o f t h e r i g h t s i d e<br>ctype fval = basis [ i ]. e v a l u a t e F u n c t i o n ( <b>it - > geometry () . global (r - > position () </b>) )<br>* f ( it - > geometry () . global (r - > position () ) ) ;<br>
b [ set . subIndex (* it ,i , dim ) ] += fval * weight * detjac ;<br>}<br>}<br>}<br><br>I used similar procedure to solve eigenvalue problem and I was getting wrong eigenvalues.<br>I studied shapefunctions.hh file which suggested me to replace <b>it - > geometry () . global (r - > position () )</b> by <b>r->position()</b> and I got correct eigenvalues<br>
<br>I checked poisson equation with above modification and got same solution with <b>it - > geometry () . global (r - > position () )</b> and <b>r->position()</b>. but in eigenvalue problem both obtained different solutions.<br>
-- <br>Warm Regards,<br>Dhirendra Vaidya<br>VNIT Nagpur<br><br>