Vlasiator ebf0dd394 on dev (v5.4.0 + 1054 commits)
Loading...
Searching...
No Matches
fs_common.cpp File Reference
Include dependency graph for fs_common.cpp:

Go to the source code of this file.

Functions

Real divideIfNonZero (creal numerator, creal denominator)
 Helper function.
std::array< Real, Rec::N_REC_COEFFICIENTSreconstructionCoefficients (fsgrids::perbspan perb, fsgrids::constdperbspan dperb, const fsgrid::FsStencil &stencil, Real reconstructionOrder)
 Low-level helper function.
std::array< Real, 3 > interpolatePerturbedB (fsgrids::perbspan perb, fsgrids::constdperbspan dperb, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid, std::map< std::array< int, 3 >, std::array< Real, Rec::N_REC_COEFFICIENTS > > &reconstructionCoefficientsCache, cint i, cint j, cint k, const std::array< Real, 3 > x)
std::array< Real, 3 > interpolateCurlB (fsgrids::perbspan perb, fsgrids::constdperbspan dperb, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid, std::map< std::array< int, 3 >, std::array< Real, Rec::N_REC_COEFFICIENTS > > &reconstructionCoefficientsCache, cint i, cint j, cint k, const std::array< Real, 3 > x)

Function Documentation

◆ divideIfNonZero()

Real divideIfNonZero ( creal numerator,
creal denominator )

Helper function.

Divides the first value by the second or returns zero if the denominator is zero.

Parameters
numeratorNumerator
denominatorDenominator

Definition at line 33 of file fs_common.cpp.

Here is the caller graph for this function:

◆ interpolateCurlB()

std::array< Real, 3 > interpolateCurlB ( fsgrids::perbspan perb,
fsgrids::constdperbspan dperb,
fsgrids::technicalspan technical,
FieldSolverGrid & fsgrid,
std::map< std::array< int, 3 >, std::array< Real, Rec::N_REC_COEFFICIENTS > > & reconstructionCoefficientsCache,
cint i,
cint j,
cint k,
const std::array< Real, 3 > x )

Interpolate curl(perturbed B) to arbitrary x,y,z in cell Uses the reconstruction coefficients and equations from Divergence-free reconstruction of magnetic fields and WENO schemes for magnetohydrodynamics D.S. Balsara, J. Comp. Phys., 228, 2009 doi:10.1016/j.jcp.2009.03.038 and the wxMaxima file at doc/fieldsolver/Balsara_curlB_at_arbitrary_xyz.wxmx

Parameters
perbperturbed B fsGrid
dperbperturbed B derivatives fsGrid
technicaltechnical fsGrid
fsgridfsgfrid container
ilocal fsGrid x-index
jlocal fsGrid y-index
klocal fsGrid z-index
x3D global simulation x,y,z coordinates of point to interpolate to

Definition at line 273 of file fs_common.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ interpolatePerturbedB()

std::array< Real, 3 > interpolatePerturbedB ( fsgrids::perbspan perb,
fsgrids::constdperbspan dperb,
fsgrids::technicalspan technical,
FieldSolverGrid & fsgrid,
std::map< std::array< int, 3 >, std::array< Real, Rec::N_REC_COEFFICIENTS > > & reconstructionCoefficientsCache,
cint i,
cint j,
cint k,
const std::array< Real, 3 > x )

Interpolate perturbed B to arbitrary x,y,z in cell Uses the reconstruction coefficients and equations from Divergence-free reconstruction of magnetic fields and WENO schemes for magnetohydrodynamics D.S. Balsara, J. Comp. Phys., 228, 2009 doi:10.1016/j.jcp.2009.03.038

Parameters
perbperturbed B fsGrid
dperbperturbed B derivatives fsGrid
technicaltechnical fsGrid
reconstructionCoefficientsCachemap for cached values
ilocal fsGrid x-index
jlocal fsGrid y-index
klocal fsGrid z-index
x3D global simulation x,y,z coordinates of point to interpolate to

Definition at line 200 of file fs_common.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reconstructionCoefficients()

std::array< Real, Rec::N_REC_COEFFICIENTS > reconstructionCoefficients ( fsgrids::perbspan perb,
fsgrids::constdperbspan dperb,
const fsgrid::FsStencil & stencil,
Real reconstructionOrder )

Low-level helper function.

Computes the reconstruction coefficients used for field component reconstruction. Only implemented for 2nd and 3rd order.

Parameters
perbfsGrid holding the perturbed B quantities
dperbfsGrid holding the derivatives of perturbed B
stencilfsgrid stencil for the current cell
reconstructionOrderReconstruction order of the fields after Balsara 2009, 2 used for BVOL, 3 used for 2nd-order Hall term calculations.

Definition at line 53 of file fs_common.cpp.

Here is the caller graph for this function: