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

Oliver Sander sander at mi.fu-berlin.de
Sun Apr 22 18:39:15 CEST 2012


Hi,
good catch.  This does indeed look like a bug to me: a shape function is
evaluated with world-coordinates, whereas it expects element-local 
coordinates.
I fixed it on the trunk.
Thanks,
Oliver

Am 22.04.2012 02:51, schrieb DHIRENDRA VAIDYA:
> 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
>
>
>
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune




More information about the Dune mailing list