PLUTO  4.0
 All Data Structures Files Functions Variables Enumerations Macros Pages
Functions
vec_pot_diff.c File Reference

Compute magnetic field from vector potential. More...

#include "pluto.h"

Functions

void VectorPotentialDiff (double *b, int i, int j, int k, Grid *grid)
 

Detailed Description

The function VectorPotentialDiff() computes either staggered or cell-center magnetic field components by suitable central differencing of the vector potential, $ \vec{B} = \nabla\times\vec{A} $.

For cell-centered MHD vector potential is compute at the cell-center. In the case of staggered MHD, the position of A is edge-centered and it is shown below:

          ______________________
         /                     /|  
        /                     / |  
       /       z face        /  |
      /                     Ax  |
     /                     /    |
    /                     /     Az
   ----------Ay-----------      |
   |                     |      |
   |                     |   y  |
   |                     | face |
   |                     |     / 
   Az       x face      Az    /  
   |                     |   Ax  
   |                     |  /     
   |                     | /
   |                     |/
   ----------Ay-----------
Authors
A. Mignone (migno.nosp@m.ne@p.nosp@m.h.uni.nosp@m.to.i.nosp@m.t)
P. Tzeferacos (petro.nosp@m.s.tz.nosp@m.efera.nosp@m.cos@.nosp@m.ph.un.nosp@m.ito..nosp@m.it)
Date
Sep 24, 2012

Function Documentation

void VectorPotentialDiff ( double *  b,
int  i,
int  j,
int  k,
Grid grid 
)

Assign face- or cell-centered magnetic field by differentiating the vector potential.

Parameters
[out]barray of magnetic field starting at 0, $ B_{x_1} = b[0]\,, B_{x_2} = b[1]\,, B_{x_3} = b[2] $
[in]ithe cell index in the first coordinate direction
[in]jthe cell index in the first coordinate direction
[in]kthe cell index in the first coordinate direction
[in]gridpointer to an array of Grid structures