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

Compute the electric current. More...

#include "pluto.h"

Functions

void GetCurrent (Data_Arr V, double **curlB, Grid *grid)
 

Detailed Description

Compute the curl of magnetic field at the cell interfaces in the direction given by g_dir. It returns a 1D array containing two of the three components (J_x, J_y, J_z). For instance, during the IDIR sweep, we compute (0, J_y, J_z) at interface (i+1/2,j,k). We do NOT compute the x-component (for g_dir == IDIR) since any differential operator successively applied to J will not need it. For instance:

      div(J)  = 0  (by definition)
      curl(J) at i+1/2 does not need Jx;

The same argument applies to other directions by cyclic permutation of indexes.

Attention
Do NOT use this function to compute terms like (curl V)^2 !!
Authors
T. Matsakos
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
Aug 16, 2012

Function Documentation

void GetCurrent ( Data_Arr  V,
double **  curlB,
Grid grid 
)
Parameters
[in]VA 3D array of cell-centered primitive quantities
[out]curlBA 1D array containing two components of the current in a the direction set by g_dir
[in]grida pointer to an array of Grid structures