comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Curl, Gradient and Divergence
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Curl, Gradient and Divergence [message #59658] Fri, 04 April 2008 03:49 Go to next message
AleDiPappa is currently offline  AleDiPappa
Messages: 1
Registered: April 2008
Junior Member
I am new idl user and I would like to know if there is any easy way or
direct function for computing the curl, gradient and divergence of
vectorial fields.

Regards
Re: Curl, Gradient and Divergence [message #59720 is a reply to message #59658] Fri, 04 April 2008 06:33 Go to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article
<833f085f-3c70-41c3-aa28-7a1927e44d0c@m73g2000hsh.googlegroups.com>,
AleDiPappa@gmail.com wrote:

> I am new idl user and I would like to know if there is any easy way or
> direct function for computing the curl, gradient and divergence of
> vectorial fields.
>
> Regards

To my knowledge there are no general built-in routines to do this;
you need to roll your own. But, it is relatively easy to do by using
the SHIFT operator, e.g., the gradient of a 2-D scalar field psi using
centered differences on a regular Cartesian grid is

grad_x = (SHIFT(psi, -1, 0) - SHIFT(psi, 1, 0))/(2 * dx)
grad_y = (SHIFT(psi, 0, -1) - SHIFT(psi, 0, 1))/(2 * dy)

Don't forget to clean up the boundaries.

Ken Bowman
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How to save an iTools procedure?
Next Topic: pollyfillv, area of a blob, etc...

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:53:31 PDT 2025

Total time taken to generate the page: 0.00519 seconds