Vlasiator ebf0dd394 on dev (v5.4.0 + 1054 commits)
Loading...
Searching...
No Matches
arch_moments.h File Reference
#include <vector>
#include <limits>
#include <dccrg.hpp>
#include <dccrg_cartesian_geometry.hpp>
#include "../definitions.h"
#include "../common.h"
#include "../spatial_cells/spatial_cell_wrapper.hpp"
Include dependency graph for arch_moments.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define nMom1   4
#define nMom2   6

Functions

template<typename REAL, uint SIZE>
void blockVelocityFirstMoments (vmesh::VelocityBlockContainer *blockContainer, REAL(&array)[SIZE], uint nBlocks)
template<typename REAL, uint SIZE>
void blockVelocitySecondMoments (vmesh::VelocityBlockContainer *blockContainer, const REAL averageVX, const REAL averageVY, const REAL averageVZ, REAL(&array)[SIZE], uint nBlocks)
void calculateMoments_R (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const std::vector< CellID > &cells, const bool &computeSecond, const bool initialCompute=false)
void calculateMoments_V (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const std::vector< CellID > &cells, const bool &computeSecond, const bool initialCompute=false)

Macro Definition Documentation

◆ nMom1

#define nMom1   4

Definition at line 37 of file arch_moments.h.

◆ nMom2

#define nMom2   6

Definition at line 38 of file arch_moments.h.

Function Documentation

◆ blockVelocityFirstMoments()

template<typename REAL, uint SIZE>
void blockVelocityFirstMoments ( vmesh::VelocityBlockContainer * blockContainer,
REAL(&) array[SIZE],
uint nBlocks )
inline

Calculate the zeroth and first velocity moments for the given velocity block and add results to 'array', which must have at least size four. After this function returns, the contents of 'array' are as follows: array[0]=n; array[1]=n*Vx; array[2]=nVy; array[3]=nVz; Here n is the scaled number density, i.e., number density times population mass / proton mass. This function is AMR safe.

Parameters
dataDistribution functions
blockParametersParameters for the velocity blocks
arrayArray where the calculated moments are added
nBlocksThe number of blocks

Definition at line 83 of file arch_moments.h.

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

◆ blockVelocitySecondMoments()

template<typename REAL, uint SIZE>
void blockVelocitySecondMoments ( vmesh::VelocityBlockContainer * blockContainer,
const REAL averageVX,
const REAL averageVY,
const REAL averageVZ,
REAL(&) array[SIZE],
uint nBlocks )
inline

Calculate the second velocity moments for the velocity blocks, and add results to 'array', which must have at least size three. After this function returns, the contents of 'array' are as follows: array[0]=n(Vx-Vx0); array[1]=n(Vy-Vy0); array[2]=n(Vz-Vz0); Here Vx0,Vy0,Vz0 are the components of the bulk velocity (calculated over all species). This function is AMR safe.

Parameters
dataDistribution functions
blockParametersParameters for the velocity blocks
averageVXBulk velocity x
averageVYBulk velocity y
averageVZBulk velocity z
arrayArray where the calculated moments are added
nBlocksThe number of blocks

Definition at line 123 of file arch_moments.h.

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

◆ calculateMoments_R()

void calculateMoments_R ( dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid,
const std::vector< CellID > & cells,
const bool & computeSecond,
const bool initialCompute )

Calculate zeroth, first, and (possibly) second bulk velocity moments for the given spatial cell. The calculated moments include contributions from all existing particle populations. The calculated moments are stored to SpatialCell::parameters in _R variables.

Parameters
mpiGridParallel grid library.
cellsVector containing the spatial cells to be calculated.
computeSecondIf true, second velocity moments are calculated.
initialComputeIf true, force re-calculation of outflow L1 sysboundary cell moments. (otherwise skipped as their VDF contents are not kept up to date)

Definition at line 178 of file arch_moments.cpp.

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

◆ calculateMoments_V()

void calculateMoments_V ( dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid,
const std::vector< CellID > & cells,
const bool & computeSecond,
const bool initialCompute )

Calculate zeroth, first, and (possibly) second bulk velocity moments for the given spatial cell. Additionally, for each species, calculate the maximum spatial time step so that CFL(spatial)=1. The calculated moments include contributions from all existing particle populations. The calculated moments are stored to SpatialCell::parameters in _V variables.

Parameters
mpiGridParallel grid library.
cellsVector containing the spatial cells to be calculated.
computeSecondIf true, second velocity moments are calculated.
initialComputeIf true, force re-calculation of outflow L1 sysboundary cell moments. (otherwise skipped as their VDF contents are not kept up to date)

Definition at line 342 of file arch_moments.cpp.

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