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

Fill normal staggered component in the ghost zones. More...

#include "pluto.h"

Functions

void FillMagneticField (const Data *d, int side, Grid *grid)
 Assign the normal component of the staggered magnetic field in the ghost zone-faces.
 

Function Documentation

void FillMagneticField ( const Data d,
int  side,
Grid grid 
)

Using the div.B = 0 condition in staggered MHD, this function computes the staggered component of magnetic field lying on the zone-face parallel to the boundary specified by "side". This is preformed by solving the div.B = 0 condition for one variable only which in 2-D requires the knowledge of the other 3 components while in 3-D required the knowledge of the other 5 staggered components.

Note that this operation is performed in the outermost ghost zones only since the face value at IBEG-1 or IEND is supposed to be part of the solution and is not changed during this function. Therefore, only nghost-1 faces are assigned:

*  +-----+-----+-----+-----+-----+--
*  |     |     |     |     |     |
*  |     X     X     |     |     |
*  |     |     |     |     |     |
*  +-----+-----+-----+-----+-----+--
*                    |
*  <-----------------> BEG
*   Physical boundary     
*
*   X = components assigned in this function.
* 
Parameters
[in,out]dpointer to PLUTO Data structure
[in]sidethe side
[in]gridpointer to PLUTO Grid structure
Todo:
replace the loops with more compact macro, such as X1_BEG_LOOP()...
Author
A. Mignone (migno.nosp@m.ne@p.nosp@m.h.uni.nosp@m.to.i.nosp@m.t)
Date
Aug 16, 2012