[Dune] Help for gradient calculation

Christian Engwer christian.engwer at uni-muenster.de
Thu Jul 14 15:49:05 CEST 2011


On Thu, Jul 14, 2011 at 02:21:04PM +0530, DHIRENDRA VAIDYA wrote:
> I am trying to calculate electric field from -grad(potential). potential is
> obtained from solving poisson's equation by finite element method and node
> values are stored in block vector. possion's equation is solved simillar to
> grid-howto tutorial. now i am stuck in calculating potential gradient with
> these node values of potential. i tried calculating gradient of
> shapefunction at nodes and then multiply it with potential node value, but
> gradient of shapefunction is coming out to be zero at nodes(might be bcoz at
> node gradient is undefined). so how to calculate gradient?

actually you are not asking how to compute the gradient in dune, but
how to obtain the gradient of a Q1-function. If you look into your
favorite FEM-textbook, you can read this in detail. Short answer
is... compute the gradient contributions element-wise and sum up the
contributions from each element.

Cheers
Christian

> On Mon, Jul 11, 2011 at 5:32 PM, Jö Fahlke <jorrit at jorrit.de> wrote:
> 
> > Am Mon, 11. Jul 2011, 10:53:38 +0200 schrieb Oliver Sander:
> > > Please be more specific when writing questions.
> >
> > To make the request to be more specific more specific: what kind of
> > function
> > are you talking about?  For instance, is it a discrete function, and if so,
> > what discretization module are you using?
> >
> > Bye,
> > Jö.
> >
> > --
> > Computers are like air conditioners.  Both stop working, if you open
> > windows.
> > -- Adam Heath
> >
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.10 (GNU/Linux)
> >
> > iQIVAwUBThrmUOmx9CKgc0OWAQgQOg/+K2bHPhqssBSBrP6KhJIX4JppcXMgkYmO
> > Eb7O9xuyu6go/LrDzzjLeiJ9WHHih25t+ccYCyjkJpAYRfES8HOKBNRmZUpbgDS+
> > 6P1v9Rzk8Irka+VIaXvmSJaw8DGotW5+h/kMW3/bU/nxkvkMT7nTV8NCZetNSHPP
> > kRQxwzqw8qf4JXAuoaY3dRV9QZCpokEfqAuSsfjiY6zdHRnSK2epmawc85CxErv8
> > q3X281eJetmi9tp3vMXHJFx3i05qZSMgjRfwDAS1K6A0ZJsoEGqws1xKZ0T9OS7k
> > d9IvjK/HpCGo6VrRjn1KTkS795k9LTB4txWmkeQDoh7MRXW30LeYi2z9YwIcJz0N
> > e9WELHeZDPGeFBkeEFJ6J/SGEK5BkMp2tjvMWh2mfNkG0JPR0CVdkFMMBlFbSfIf
> > 9AvoWvofdSQE09aqSWDG87Pqv1LxSiTKRUYGYl+OVT6ePEwIL1yV0bI0ZMcLeeIW
> > rMnun+AFziiPgVrv6aMs77KyEk77m2wzTq9/+y9omirWHZb+wmPYKhlwRvOxJI8l
> > TSQm45C+WTz69ugpPo6inevSmeQdh8ClU48Pqg3ny1r1rvSujE1JJPiMnCwh2GPm
> > ix+wPcjqdtF2RzKkF+cy8ERrJCsRfH/P/RTAYn+S9ZQAqh6+Gmq/A2FtylZp+TJ3
> > hg3GPB9t4b4=
> > =2wbZ
> > -----END PGP SIGNATURE-----
> >
> >
> 
> 
> -- 
> Warm Regards,
> Dhirendra Vaidya

> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune





More information about the Dune mailing list