|
Vlasiator ebf0dd394 on dev (v5.4.0 + 1054 commits)
|
#include <cstdlib>#include "fs_common.h"#include "derivatives.hpp"#include "fs_limiters.h"#include <Eigen/Geometry>
Go to the source code of this file.
Classes | |
| struct | DerivativesData< T, N > |
Functions | |
| void | computeMomentsDerivatives (fsgrids::constmomentsspan moments, fsgrids::dmomentsspan dmoments, const fsgrid::FsStencil &stencil, const bool atSysBoundary) |
| void | computePerbDerivatives (fsgrids::perbspan perb, fsgrids::dperbspan dperb, const fsgrid::FsStencil &stencil, bool dontCompute2ndDerivatives, bool atSysBoundary, cuint sysBoundaryFlag) |
| void | calculateDerivatives (fsgrids::perbspan perb, fsgrids::constmomentsspan moments, fsgrids::dperbspan dperb, fsgrids::dmomentsspan dmoments, const fsgrid::FsStencil &stencil, cuint sysBoundaryFlag, cuint sysBoundaryLayer, const bool doMoments) |
| Low-level spatial derivatives calculation. | |
| void | calculateDerivativesSimple (fsgrids::perbspan perb, fsgrids::momentsspan moments, fsgrids::dperbspan dperb, fsgrids::dmomentsspan dmoments, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid, const bool doMoments) |
| High-level derivative calculation wrapper function. | |
| void | calculateBVOLDerivatives (fsgrids::volspan vol, fsgrids::consttechnicalspan technical, const fsgrid::FsStencil &stencil) |
| Low-level spatial derivatives calculation. | |
| void | calculateBVOLDerivativesSimple (fsgrids::volspan vol, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid) |
| High-level derivative calculation wrapper function. | |
| void | calculateCurvature (fsgrids::volspan vol, fsgrids::constbgbspan bgb, const fsgrid::FsStencil &stencil, const std::array< Real, 3 > &gridSpacing) |
| Low-level curvature calculation. | |
| void | calculateCurvatureSimple (fsgrids::volspan vol, fsgrids::constbgbspan bgb, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid) |
| High-level curvature calculation wrapper function. | |
| static std::array< Real, 3 > | getPerBVol (SpatialCell *cell) |
| Returns perturbed volumetric B of cell. | |
| static std::array< Real, 3 > | getBVol (SpatialCell *cell) |
| Returns volumetric B of cell. | |
| static std::array< Real, 3 > | getMomentumDensity (SpatialCell *cell) |
| Calculates momentum density of cell. | |
| static Real | calculateU (SpatialCell *cell) |
| Calculates energy density for spatial cell. | |
| static Real | calculateAnisotropy (const Eigen::Matrix3d &rot, const std::array< Real, 6 > &P) |
| Calculates pressure anistotropy from B and Pi. | |
| void | calculateScaledDeltas (SpatialCell *cell, std::vector< SpatialCell * > &neighbors) |
| Low-level scaled gradients calculation. | |
| void | calculateScaledDeltasSimple (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid) |
| High-level scaled gradient calculation wrapper function. | |
Calculates pressure anistotropy from B and Pi.
| rot | Eigen rotation matrix for parallel/perpendicular pressure |
| P | elements of pressure order in order: P_11, P_22, P_33, P_23, P_13, P_12 |
Definition at line 505 of file derivatives.cpp.

| void calculateBVOLDerivatives | ( | fsgrids::volspan | vol, |
| fsgrids::consttechnicalspan | technical, | ||
| const fsgrid::FsStencil & | stencil ) |
Low-level spatial derivatives calculation.
Calculate the spatial derivatives of BVOL or set them to zero.
For sysBoundaryLayer 1 or 2, we are near a boundary, and we wish to use regular centered differences instead of slope limiter-adjusted values. This is to minimize oscillations as a smooth behaviour is required near artificial boundaries, unlike at boundaries and shocks inside the simulation domain.
| vol | fsGrid holding the volume averaged fields |
| technical | fsGrid holding technical information (such as boundary types) |
| stencil | fsgrid stencil of current cell |
Definition at line 295 of file derivatives.cpp.


| void calculateBVOLDerivativesSimple | ( | fsgrids::volspan | vol, |
| fsgrids::technicalspan | technical, | ||
| FieldSolverGrid & | fsgrid ) |
High-level derivative calculation wrapper function.
BVOL has been calculated locally by calculateVolumeAveragedFields but not communicated. For the acceleration step one needs the cross-derivatives of BVOL
| vol | fsGrid holding the volume averaged fields |
| technical | fsGrid holding technical information (such as boundary types) |
| fsgrid | fsgrid container |
Definition at line 361 of file derivatives.cpp.


| void calculateCurvature | ( | fsgrids::volspan | vol, |
| fsgrids::constbgbspan | bgb, | ||
| const fsgrid::FsStencil & | stencil, | ||
| const std::array< Real, 3 > & | gridSpacing ) |
Low-level curvature calculation.
| vol | fsGrid holding the volume averaged fields |
| bgb | fsGrid holding the background fields |
| stencil | fsgrid stencil |
| gridSpacing | cell sizes in x,y,z |
http://fusionwiki.ciemat.es/wiki/Magnetic_curvature
Definition at line 393 of file derivatives.cpp.


| void calculateCurvatureSimple | ( | fsgrids::volspan | vol, |
| fsgrids::constbgbspan | bgb, | ||
| fsgrids::technicalspan | technical, | ||
| FieldSolverGrid & | fsgrid ) |
High-level curvature calculation wrapper function.
| vol | fsGrid holding the volume averaged fields |
| bgb | fsGrid holding the background fields |
| technical | fsGrid holding technical information (such as boundary types) |
| fsgrid | fsgrid container |
Definition at line 440 of file derivatives.cpp.


| void calculateDerivatives | ( | fsgrids::perbspan | perb, |
| fsgrids::constmomentsspan | moments, | ||
| fsgrids::dperbspan | dperb, | ||
| fsgrids::dmomentsspan | dmoments, | ||
| const fsgrid::FsStencil & | stencil, | ||
| cuint | sysBoundaryFlag, | ||
| cuint | sysBoundaryLayer, | ||
| const bool | doMoments ) |
Low-level spatial derivatives calculation.
Calculate the spatial derivatives or apply the derivative boundary conditions.
| perb | fsGrid holding the perturbed B quantities |
| moments | fsGrid holding the moment quantities |
| dperb | fsGrid holding the derivatives of perturbed B |
| dmoments | fsGrid holding the derviatives of moments |
| stencil | fsgrid stencil for the cell |
| sysBoundaryFlag | system boundary flag for the cell |
| sysBoundaryLayer | system boundary layer for the cell |
| doMoments | Bool telling whether the derivatives for moments need updating too. |
Definition at line 209 of file derivatives.cpp.


| void calculateDerivativesSimple | ( | fsgrids::perbspan | perb, |
| fsgrids::momentsspan | moments, | ||
| fsgrids::dperbspan | dperb, | ||
| fsgrids::dmomentsspan | dmoments, | ||
| fsgrids::technicalspan | technical, | ||
| FieldSolverGrid & | fsgrid, | ||
| const bool | doMoments ) |
High-level derivative calculation wrapper function.
B has to be updated because after the system boundary update in propagateMagneticFieldSimple there is no consistent state of B yet everywhere.
Then the derivatives are calculated.
| perb | fsGrid holding the perturbed B quantities |
| moments | fsGrid holding the moment quantities |
| dperb | fsGrid holding the derivatives of perturbed B |
| dmoments | fsGrid holding the derviatives of moments |
| technical | fsGrid holding technical information (such as boundary types) |
| fsgrid | fsgrid container |
| doMoments | If true, the derivatives of moments (rho, V, P) are communicated to neighbours and their derivatives updated. |
Definition at line 254 of file derivatives.cpp.


| void calculateScaledDeltas | ( | SpatialCell * | cell, |
| std::vector< SpatialCell * > & | neighbors ) |
Low-level scaled gradients calculation.
For the SpatialCell* cell and its neighbors, calculate scaled gradients and their maximum alpha The gradients are the same as in the GUMICS simulation, see Janhunen, P., Palmroth, M., Laitinen, T., Honkonen, I., Juusola, L., Facsko, G., & Pulkkinen, T. I. (2012). The GUMICS-4 global MHD magnetosphere-ionosphere coupling simulation. Journal of Atmospheric and Solar - Terrestrial Physics, 80, 48-59. https://doi.org/10.1016/j.jastp.2012.03.006
Definition at line 535 of file derivatives.cpp.


| void calculateScaledDeltasSimple | ( | dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & | mpiGrid | ) |
High-level scaled gradient calculation wrapper function.
Calculates gradients needed for alpha everywhere in the grid
Definition at line 664 of file derivatives.cpp.


|
static |
Calculates energy density for spatial cell.
Definition at line 493 of file derivatives.cpp.


| void computeMomentsDerivatives | ( | fsgrids::constmomentsspan | moments, |
| fsgrids::dmomentsspan | dmoments, | ||
| const fsgrid::FsStencil & | stencil, | ||
| const bool | atSysBoundary ) |
Definition at line 40 of file derivatives.cpp.


| void computePerbDerivatives | ( | fsgrids::perbspan | perb, |
| fsgrids::dperbspan | dperb, | ||
| const fsgrid::FsStencil & | stencil, | ||
| bool | dontCompute2ndDerivatives, | ||
| bool | atSysBoundary, | ||
| cuint | sysBoundaryFlag ) |
Definition at line 124 of file derivatives.cpp.


|
static |
Returns volumetric B of cell.
Definition at line 474 of file derivatives.cpp.

|
static |
Calculates momentum density of cell.
Definition at line 483 of file derivatives.cpp.

|
static |
Returns perturbed volumetric B of cell.
Definition at line 465 of file derivatives.cpp.