[Dune] error in grid-howto.pdf FEM example poissons equation

DHIRENDRA VAIDYA dhirendra22121987 at gmail.com
Sun Apr 22 02:51:21 CEST 2012


In FEM example dune-grid-howto/finiteelements.cc
described on page 56 in grid-howto.pdf,

In assembling procedure of block vector b on page 59 line 177, there is
some error/mistake.
the code looks like

Loop over element iterator
{
const Dune :: QuadratureRule < ctype , dim >& rule2 = Dune ::
QuadratureRules < ctype , dim >:: rule (
gt ,2) ;
for ( typename Dune :: QuadratureRule < ctype , dim >:: const_iterator r =
rule2 . begin () ;
r != rule2 . end () ; ++ r )
{
ctype weight = r - > weight () ;
ctype detjac = it - > geometry () . i n t e g r a t i o n E l e m e n t (r
- > position () ) ;
for ( int i = 0 ; i < vertexsize ; i ++)
{
// 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
ctype fval = basis [ i ]. e v a l u a t e F u n c t i o n ( *it - >
geometry () . global (r - > position () *) )
* f ( it - > geometry () . global (r - > position () ) ) ;
b [ set . subIndex (* it ,i , dim ) ] += fval * weight * detjac ;
}
}
}

I used similar procedure to solve eigenvalue problem and I was getting
wrong eigenvalues.
I studied shapefunctions.hh file which suggested me to replace *it - >
geometry () . global (r - > position () )* by *r->position()* and I got
correct eigenvalues

I checked poisson equation with above modification and got same solution
with *it - > geometry () . global (r - > position () )* and *r->position()*.
but in eigenvalue problem both obtained different solutions.
-- 
Warm Regards,
Dhirendra Vaidya
VNIT Nagpur
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20120422/75bb6926/attachment.htm>


More information about the Dune mailing list