Vlasiator ebf0dd394 on dev (v5.4.0 + 1054 commits)
Loading...
Searching...
No Matches
vlasovmover.cpp File Reference
#include <cstdlib>
#include <iostream>
#include <vector>
#include <stdint.h>
#include <zoltan.h>
#include <dccrg.hpp>
#include <phiprof.hpp>
#include "vlasovmover.h"
#include "../grid.h"
#include "../definitions.h"
#include "../object_wrapper.h"
#include "../mpiconversion.h"
#include "arch_moments.h"
#include "cpu_trans_pencils.hpp"
#include "cpu_acc_transform.hpp"
#include "cpu_acc_semilag.hpp"
#include "cpu_trans_map_amr.hpp"
Include dependency graph for vlasovmover.cpp:

Go to the source code of this file.

Functions

void calculateSpatialTranslation (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const vector< CellID > &local_propagated_cells, const vector< CellID > &remoteTargetCellsx, const vector< CellID > &remoteTargetCellsy, const vector< CellID > &remoteTargetCellsz, vector< uint > &nPencils, const Realf dt, const uint popID, Real &time)
void calculateSpatialGhostTranslation (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const vector< CellID > &local_propagated_cells, vector< uint > &nPencils, const creal dt, const uint popID, Real &time)
void calculateSpatialTranslation (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const Real dt)
uint getAccelerationSubcycles (const SpatialCell *spatial_cell, const Real dt, const uint popID)
void calculateAcceleration (const uint popID, const uint globalMaxSubcycles, const uint step, dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const std::vector< CellID > &acceleratedCells, const Real dt)
void calculateAcceleration (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const Real dt)
void calculateInterpolatedVelocityMoments (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const int cp_rhom, const int cp_vx, const int cp_vy, const int cp_vz, const int cp_rhoq, const int cp_p11, const int cp_p22, const int cp_p33, const int cp_p23, const int cp_p13, const int cp_p12)
 Compute real-time 1st order accurate moments from the moments after propagation in velocity and spatial space.
void calculateInitialVelocityMoments (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid)
 Compute 0th, 1st and 2nd velocity moments (RHO,VX,VY,VZ,P_11,P_22,P_33 and *_DT2) for all cells in the grid directly from distribution function. The simulation should be at a true time-step! This is at the moment only called at initialisation.

Function Documentation

◆ calculateAcceleration() [1/2]

void calculateAcceleration ( const uint popID,
const uint globalMaxSubcycles,
const uint step,
dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid,
const std::vector< CellID > & acceleratedCells,
const Real dt )

Accelerate the given population to new time t+dt.

Parameters
popIDParticle population ID.
globalMaxSubcyclesNumber of times acceleration is subcycled.
stepThe current subcycle step.
mpiGridParallel grid library.
acceleratedCellsList of cells in which the population is accelerated.
dtTimestep.

Compute subcycle dt. The length is maxVdt on all steps except the (possible) last one. This was to keep neighboring spatial cells in sync (with respect to gyration), so that two neighboring cells with different number of subcycles have similar gyration angles, but adjusting the length of the last step so all are accelerated for the same amount of time. This keeps spatial block neighbors as much in sync as possible for block adjustment.

Adjust velocity blocks after each subcycle to keep number of blocks managable. This call does not perform a full neighbour block list update (third argument) but still needs to consider has_content lists for spatial neighbours. The last subcycle adjustment is performed in a higher level function, and it performs a full neighbour block list update, and is called for all accelerated cells.

Definition at line 410 of file vlasovmover.cpp.

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

◆ calculateAcceleration() [2/2]

void calculateAcceleration ( dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid,
const Real dt )

Accelerate all particle populations to new time t+dt. This function is AMR safe.

Parameters
mpiGridParallel grid library.
dtTime step.

Definition at line 481 of file vlasovmover.cpp.

Here is the call graph for this function:

◆ calculateInitialVelocityMoments()

void calculateInitialVelocityMoments ( dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid)

Compute 0th, 1st and 2nd velocity moments (RHO,VX,VY,VZ,P_11,P_22,P_33 and *_DT2) for all cells in the grid directly from distribution function. The simulation should be at a true time-step! This is at the moment only called at initialisation.

Parameters
mpiGridGrid of spatial cells for which moments are computed

Definition at line 633 of file vlasovmover.cpp.

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

◆ calculateInterpolatedVelocityMoments()

void calculateInterpolatedVelocityMoments ( dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid,
const int cp_rhom,
const int cp_vx,
const int cp_vy,
const int cp_vz,
const int cp_rhoq,
const int cp_p11,
const int cp_p22,
const int cp_p33,
const int cp_p23,
const int cp_p13,
const int cp_p12 )

Compute real-time 1st order accurate moments from the moments after propagation in velocity and spatial space.

Definition at line 587 of file vlasovmover.cpp.

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

◆ calculateSpatialGhostTranslation()

void calculateSpatialGhostTranslation ( dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid,
const vector< CellID > & local_propagated_cells,
vector< uint > & nPencils,
const creal dt,
const uint popID,
Real & time )

Propagates the distribution function in spatial space. Now does all required calculations on ghost cells, coalescing all interim MPI communication into one call..

Based on SLICE-3D algorithm: Zerroukat, M., and T. Allen. "A three-dimensional monotone and conservative semi-Lagrangian scheme (SLICE-3D) for transport problems." Quarterly Journal of the Royal Meteorological Society 138.667 (2012): 1640-1651.

Definition at line 205 of file vlasovmover.cpp.

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

◆ calculateSpatialTranslation() [1/2]

void calculateSpatialTranslation ( dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid,
const Real dt )

Propagates the distribution function in spatial space.

Based on SLICE-3D algorithm: Zerroukat, M., and T. Allen. "A three‐dimensional monotone and conservative semi‐Lagrangian scheme (SLICE‐3D) for transport problems." Quarterly Journal of the Royal Meteorological Society 138.667 (2012): 1640-1651.

Definition at line 267 of file vlasovmover.cpp.

Here is the call graph for this function:

◆ calculateSpatialTranslation() [2/2]

void calculateSpatialTranslation ( dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid,
const vector< CellID > & local_propagated_cells,
const vector< CellID > & remoteTargetCellsx,
const vector< CellID > & remoteTargetCellsy,
const vector< CellID > & remoteTargetCellsz,
vector< uint > & nPencils,
const Realf dt,
const uint popID,
Real & time )

Propagates the distribution function in spatial space.

Based on SLICE-3D algorithm: Zerroukat, M., and T. Allen. "A three-dimensional monotone and conservative semi-Lagrangian scheme (SLICE-3D) for transport problems." Quarterly Journal of the Royal Meteorological Society 138.667 (2012): 1640-1651.

Definition at line 65 of file vlasovmover.cpp.

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

◆ getAccelerationSubcycles()

uint getAccelerationSubcycles ( const SpatialCell * spatial_cell,
const Real dt,
const uint popID )

Compute the number of subcycles needed for the acceleration of the particle species in the spatial cell. Note that one should first prepare to accelerate the cell with updateAccelerationMaxdt.

Parameters
spatial_cellSpatial cell containing the accelerated population.
popIDID of the accelerated particle species.

Definition at line 398 of file vlasovmover.cpp.

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