PLUTO  4.4-patch2
Functions
vec_pot_diff.c File Reference

Compute magnetic field from vector potential. More...

#include "pluto.h"

Functions

void VectorPotentialDiff (double *b, Data *d, 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 staggered MHD the convention is the following:

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-----------

change D. Mukherjee, A. Mignone (dipan.nosp@m.jan..nosp@m.mukhe.nosp@m.rjee.nosp@m.@unit.nosp@m.o.it)

Date
Jul 26, 2019

Function Documentation

◆ VectorPotentialDiff()

void VectorPotentialDiff ( double *  b,
Data d,
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/out]Data structure
[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