Namespace for MHD code.
More...
|
| __global__ void | calculateMagneticDivergence (Real const *dev_conserved, Real *maxDivergence, Real const dx, Real const dy, Real const dz, int const nx, int const ny, int const nz, int const n_cells) |
| | Kernel to compute the maximum divergence of the magnetic field in the grid. Uses reduction_utilities::gridReduceMax and as such should be called with the minimum number of blocks. Recommend using the occupancy API.
|
| |
| Real | checkMagneticDivergence (Grid3D const &G) |
| | Compute the maximum magnetic divergence in the grid and report an error if it exceeds the magnetic divergence limit or is negative. The magnetic divergence limit is 1E-14 as determined by Athena as a reasonable upper bound for correctness.
|
| |
| __global__ void | Update_Magnetic_Field_3D (Real *sourceGrid, Real *destinationGrid, Real *ctElectricFields, int const nx, int const ny, int const nz, int const n_cells, Real const dt, Real const dx, Real const dy, Real const dz) |
| | Update the magnetic field using the CT electric fields.
|
| |
◆ calculateMagneticDivergence()
| __global__ void mhd::calculateMagneticDivergence |
( |
Real const * |
dev_conserved, |
|
|
Real * |
maxDivergence, |
|
|
Real const |
dx, |
|
|
Real const |
dy, |
|
|
Real const |
dz, |
|
|
int const |
nx, |
|
|
int const |
ny, |
|
|
int const |
nz, |
|
|
int const |
n_cells |
|
) |
| |
Kernel to compute the maximum divergence of the magnetic field in the grid. Uses reduction_utilities::gridReduceMax and as such should be called with the minimum number of blocks. Recommend using the occupancy API.
- Parameters
-
| [in] | dev_conserved | The device array of conserved variables |
| [out] | maxDivergence | The device scalar to store the reduced divergence at |
| [in] | dx | Cell size in the X-direction |
| [in] | dy | Cell size in the Y-direction |
| [in] | dz | Cell size in the Z-direction |
| [in] | nx | Number of cells in the X-direction |
| [in] | ny | Number of cells in the Y-direction |
| [in] | nz | Number of cells in the Z-direction |
| [in] | n_cells | Total number of cells |
◆ checkMagneticDivergence()
| Real mhd::checkMagneticDivergence |
( |
Grid3D const & |
G | ) |
|
Compute the maximum magnetic divergence in the grid and report an error if it exceeds the magnetic divergence limit or is negative. The magnetic divergence limit is 1E-14 as determined by Athena as a reasonable upper bound for correctness.
- Parameters
-
- Returns
- Real The maximum magnetic divergence found in the grid. Can usually be ignored since all checking is done in the fucntion, mostly this return is for testing.
◆ Update_Magnetic_Field_3D()
| __global__ void mhd::Update_Magnetic_Field_3D |
( |
Real * |
sourceGrid, |
|
|
Real * |
destinationGrid, |
|
|
Real * |
ctElectricFields, |
|
|
int const |
nx, |
|
|
int const |
ny, |
|
|
int const |
nz, |
|
|
int const |
n_cells, |
|
|
Real const |
dt, |
|
|
Real const |
dx, |
|
|
Real const |
dy, |
|
|
Real const |
dz |
|
) |
| |
Update the magnetic field using the CT electric fields.
- Parameters
-
| [in] | sourceGrid | The array which holds the old values of the magnetic field |
| [out] | destinationGrid | The array to hold the updated values of the magnetic field |
| [in] | ctElectricFields | The array of constrained transport electric fields |
| [in] | nx | The number of cells in the x-direction |
| [in] | ny | The number of cells in the y-direction |
| [in] | nz | The number of cells in the z-direction |
| [in] | n_cells | The total number of cells |
| [in] | dt | The time step. If doing the half time step update make sure to divide it by two when passing the time step to this kernel |
| [in] | dx | The size of each cell in the x-direction |
| [in] | dy | The size of each cell in the y-direction |
| [in] | dz | The size of each cell in the z-direction |