|
Vlasiator ebf0dd394 on dev (v5.4.0 + 1054 commits)
|
#include <cstdlib>#include <iostream>#include <cmath>#include <vector>#include <map>#include <list>#include <set>#include <stdint.h>#include <fsgrid.hpp>#include <phiprof.hpp>#include "../definitions.h"#include "../common.h"#include "../parameters.h"#include "../projects/project.h"#include "../sysboundary/sysboundary.h"#include "../sysboundary/sysboundarycondition.h"

Go to the source code of this file.
Namespaces | |
| namespace | Rec |
Enumerations | |
| enum | Rec::Rec { Rec::a_0 , Rec::a_x , Rec::a_y , Rec::a_z , Rec::a_xx , Rec::a_yy , Rec::a_zz , Rec::a_xy , Rec::a_xz , Rec::a_yz , Rec::a_xxx , Rec::a_xxy , Rec::a_xyy , Rec::a_xxz , Rec::a_xzz , Rec::a_xyz , Rec::b_0 , Rec::b_x , Rec::b_y , Rec::b_z , Rec::b_xx , Rec::b_yy , Rec::b_zz , Rec::b_xy , Rec::b_xz , Rec::b_yz , Rec::b_xxy , Rec::b_xyy , Rec::b_yyy , Rec::b_yyz , Rec::b_yzz , Rec::b_xyz , Rec::c_0 , Rec::c_x , Rec::c_y , Rec::c_z , Rec::c_xx , Rec::c_yy , Rec::c_zz , Rec::c_xy , Rec::c_xz , Rec::c_yz , Rec::c_xxz , Rec::c_xzz , Rec::c_yyz , Rec::c_yzz , Rec::c_xyz , Rec::c_zzz , Rec::N_REC_COEFFICIENTS } |
Variables | |
| const Real | HALF = 0.5 |
| const Real | MINUS = -1.0 |
| const Real | PLUS = +1.0 |
| const Real | THIRD = 1.0/3.0 |
| const Real | FOURTH = 1.0/4.0 |
| const Real | SIXTH = 1.0/6.0 |
| const Real | EIGTH = 1.0/8.0 |
| const Real | TENTH = 1.0/10.0 |
| const Real | TWELWTH = 1.0/12.0 |
| const Real | TWO = 2.0 |
| const Real | ZERO = 0.0 |
| static creal | EPS = 1.0e-30 |
Helper function.
Divides the first value by the second or returns zero if the denominator is zero.
| numerator | Numerator |
| denominator | Denominator |
Definition at line 33 of file fs_common.cpp.

| 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
| perb | perturbed B fsGrid |
| dperb | perturbed B derivatives fsGrid |
| technical | technical fsGrid |
| fsgrid | fsgfrid container |
| i | local fsGrid x-index |
| j | local fsGrid y-index |
| k | local fsGrid z-index |
| x | 3D global simulation x,y,z coordinates of point to interpolate to |
Definition at line 273 of file fs_common.cpp.


| 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
| perb | perturbed B fsGrid |
| dperb | perturbed B derivatives fsGrid |
| technical | technical fsGrid |
| reconstructionCoefficientsCache | map for cached values |
| i | local fsGrid x-index |
| j | local fsGrid y-index |
| k | local fsGrid z-index |
| x | 3D global simulation x,y,z coordinates of point to interpolate to |
Definition at line 200 of file fs_common.cpp.


| bool propagateFields | ( | fsgrids::perbspan | perb, |
| fsgrids::perbspan | perbdt2, | ||
| fsgrids::efieldspan | e, | ||
| fsgrids::efieldspan | edt2, | ||
| fsgrids::ehallspan | ehall, | ||
| fsgrids::egradpespan | egradpe, | ||
| fsgrids::egradpespan | egradpedt2, | ||
| fsgrids::momentsspan | moments, | ||
| fsgrids::momentsspan | momentsdt2, | ||
| fsgrids::dperbspan | dperb, | ||
| fsgrids::dmomentsspan | dmoments, | ||
| fsgrids::dmomentsspan | dmomentsdt2, | ||
| fsgrids::bgbspan | bgb, | ||
| fsgrids::volspan | vol, | ||
| fsgrids::technicalspan | technical, | ||
| FieldSolverGrid & | fsgrid, | ||
| SysBoundary & | sysBoundaries, | ||
| creal & | dt, | ||
| cuint | subcycles ) |
Top-level field propagation function.
Propagates the magnetic field, computes the derivatives and the upwinded electric field, then computes the volume-averaged field values. Takes care of the Runge-Kutta iteration at the top level, the functions called get as an argument the element from the enum defining the current stage and handle their job correspondingly.
| perb | fsgrid holding perturbed magnetic field |
| perbdt2 | fsgrid holding perturbed magnetic field at Runge-Kutta half-step |
| e | fsgrid holding electric field |
| edt2 | fsgrid holding electric field |
| ehall | fsgrid holding Hall term electric field |
| egradpe | fsgrid holding gradient of electron pressure electric field |
| egradpedt2 | fsgrid holding gradient of electron pressure electric field at Runge-Kutta half-step |
| moments | fsgrid holding moments |
| momentsdt2 | fsgrid holding moments at Runge-Kutta half-step |
| dperb | fsgrid holding perturbed magnetic field derivatives |
| dmoments | fsgrid holding moments derivatives |
| dmomentsdt2 | fsgrid holding moments derivatives at Runge-Kutta half-step |
| bgb | fsgrid holding background magnetic field |
| vol | fsgrid holding volume magnetic field |
| technical | fsgrid holding technical parameters |
| fsgrid | fsgrids container |
| sysBoundaries | Container of existing system boundaries |
| dt | Length of the time step |
| subcycles | Number of subcycles to compute. |
Definition at line 91 of file ldz_main.cpp.


| 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.
| perb | fsGrid holding the perturbed B quantities |
| dperb | fsGrid holding the derivatives of perturbed B |
| stencil | fsgrid stencil for the current cell |
| reconstructionOrder | Reconstruction 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.

| const Real EIGTH = 1.0/8.0 |
Definition at line 55 of file fs_common.h.
|
static |
Definition at line 61 of file fs_common.h.
| const Real FOURTH = 1.0/4.0 |
Definition at line 53 of file fs_common.h.
| const Real HALF = 0.5 |
Definition at line 49 of file fs_common.h.
| const Real MINUS = -1.0 |
Definition at line 50 of file fs_common.h.
| const Real PLUS = +1.0 |
Definition at line 51 of file fs_common.h.
| const Real SIXTH = 1.0/6.0 |
Definition at line 54 of file fs_common.h.
| const Real TENTH = 1.0/10.0 |
Definition at line 56 of file fs_common.h.
| const Real THIRD = 1.0/3.0 |
Definition at line 52 of file fs_common.h.
| const Real TWELWTH = 1.0/12.0 |
Definition at line 57 of file fs_common.h.
| const Real TWO = 2.0 |
Definition at line 58 of file fs_common.h.
| const Real ZERO = 0.0 |
Definition at line 59 of file fs_common.h.