Vlasiator ebf0dd394 on dev (v5.4.0 + 1054 commits)
Loading...
Searching...
No Matches
grid.cpp File Reference
#include "common.h"
#include <cstdlib>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <vector>
#include <sstream>
#include <ctime>
#include "grid.h"
#include "vlasovsolver/vlasovmover.h"
#include "definitions.h"
#include "mpiconversion.h"
#include "logger.h"
#include "parameters.h"
#include "datareduction/datareducer.h"
#include "sysboundary/sysboundary.h"
#include "fieldsolver/fs_common.h"
#include "fieldsolver/gridGlue.hpp"
#include "fieldsolver/derivatives.hpp"
#include "vlasovsolver/cpu_trans_pencils.hpp"
#include "projects/project.h"
#include "iowrite.h"
#include "ioread.h"
#include "object_wrapper.h"
#include "memory_report.h"
Include dependency graph for grid.cpp:

Go to the source code of this file.

Functions

void initVelocityGridGeometry (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid)
void initSpatialCellCoordinates (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid)
void initializeStencils (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid)
void writeVelMesh (const dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid)
void initializeGrids (int argn, char **argc, dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, fsgrid::FsData< std::array< Real, fsgrids::bfield::N_BFIELD > > &perb, fsgrid::FsData< std::array< Real, fsgrids::bgbfield::N_BGB > > &bgb, fsgrid::FsData< std::array< Real, fsgrids::moments::N_MOMENTS > > &moments, fsgrid::FsData< std::array< Real, fsgrids::moments::N_MOMENTS > > &momentsdt2, fsgrid::FsData< std::array< Real, fsgrids::dmoments::N_DMOMENTS > > &dmoments, fsgrid::FsData< std::array< Real, fsgrids::efield::N_EFIELD > > &e, fsgrid::FsData< std::array< Real, fsgrids::egradpe::N_EGRADPE > > &egradpe, fsgrid::FsData< std::array< Real, fsgrids::volfields::N_VOL > > &vol, fsgrid::FsData< fsgrids::technical > &technical, FieldSolverGrid &fsgrid, SysBoundary &sysBoundaries, Project &project)
 Initialize DCCRG and fsgrids.
void setFaceNeighborRanks (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid)
uint64_t get_transfer_part (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, uint64_t num_part_transfers, CellID cell)
void transferInParts (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, std::vector< CellID > &incoming_cells_list, std::vector< CellID > &outgoing_cells_list, bool refinement=false)
void balanceLoad (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, SysBoundary &sysBoundaries, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid, bool doTranslationLists)
 Balance load.
void prepareAMRLists (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid)
bool adjustVelocityBlocks (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const vector< CellID > &cellsToAdjust, bool doPrepareToReceiveBlocks, const uint popID)
void shrink_to_fit_grid_data (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid)
void deallocateRemoteCellBlocks (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid)
void updateRemoteVelocityBlockLists (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const uint popID, const uint neighborhood)
void mapRefinement (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid)
bool adaptRefinement (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid, SysBoundary &sysBoundaries, Project &project, int useStatic)
void recalculateLocalCellsCache (const dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid)

Variables

Logger logFile

Function Documentation

◆ adaptRefinement()

bool adaptRefinement ( dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid,
fsgrids::technicalspan technical,
FieldSolverGrid & fsgrid,
SysBoundary & sysBoundaries,
Project & project,
int useStatic = -1 )

Refine spatial cells and update necessary information

Parameters
mpiGridSpatial grid
fsgridTechnical grid
sysBoundariesSystem boundaries
projectProject used
useStaticUsed for forcing static refinement on restart. Negative values use adaptive refinement, non-negative values correspond to static refinement pass in Project::forceRefinement

Definition at line 1337 of file grid.cpp.

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

◆ adjustVelocityBlocks()

bool adjustVelocityBlocks ( dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid,
const vector< CellID > & cellsToAdjust,
bool doPrepareToReceiveBlocks,
const uint popID )

Definition at line 830 of file grid.cpp.

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

◆ balanceLoad()

void balanceLoad ( dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid,
SysBoundary & sysBoundaries,
fsgrids::technicalspan technical,
FieldSolverGrid & fsgrid,
bool doTranslationLists = true )

Balance load.

Parameters
[in,out]mpiGridThe DCCRG grid with spatial cells

Definition at line 672 of file grid.cpp.

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

◆ deallocateRemoteCellBlocks()

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

Deallocates all block data in remote cells in order to save memory

Parameters
mpiGridSpatial grid

Definition at line 902 of file grid.cpp.

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

◆ get_transfer_part()

uint64_t get_transfer_part ( dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid,
uint64_t num_part_transfers,
CellID cell )
inline

Definition at line 483 of file grid.cpp.

Here is the caller graph for this function:

◆ initializeGrids()

void initializeGrids ( int argn,
char ** argc,
dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid,
fsgrid::FsData< std::array< Real, fsgrids::bfield::N_BFIELD > > & perb,
fsgrid::FsData< std::array< Real, fsgrids::bgbfield::N_BGB > > & bgb,
fsgrid::FsData< std::array< Real, fsgrids::moments::N_MOMENTS > > & moments,
fsgrid::FsData< std::array< Real, fsgrids::moments::N_MOMENTS > > & momentsdt2,
fsgrid::FsData< std::array< Real, fsgrids::dmoments::N_DMOMENTS > > & dmoments,
fsgrid::FsData< std::array< Real, fsgrids::efield::N_EFIELD > > & e,
fsgrid::FsData< std::array< Real, fsgrids::egradpe::N_EGRADPE > > & egradpe,
fsgrid::FsData< std::array< Real, fsgrids::volfields::N_VOL > > & vol,
fsgrid::FsData< fsgrids::technical > & technical,
FieldSolverGrid & fsgrid,
SysBoundary & sysBoundaries,
Project & project )

Initialize DCCRG and fsgrids.

Definition at line 92 of file grid.cpp.

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

◆ initializeStencils()

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

Definition at line 1037 of file grid.cpp.

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

◆ initSpatialCellCoordinates()

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

Definition at line 411 of file grid.cpp.

Here is the caller graph for this function:

◆ initVelocityGridGeometry()

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

◆ mapRefinement()

void mapRefinement ( dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid,
fsgrids::technicalspan technical,
FieldSolverGrid & fsgrid )

Map grid refinement to FsGrid

Definition at line 1322 of file grid.cpp.

Here is the caller graph for this function:

◆ prepareAMRLists()

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

Definition at line 797 of file grid.cpp.

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

◆ recalculateLocalCellsCache()

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

Definition at line 1486 of file grid.cpp.

Here is the caller graph for this function:

◆ setFaceNeighborRanks()

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

Definition at line 433 of file grid.cpp.

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

◆ shrink_to_fit_grid_data()

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

Shrink to fit velocity space data to save memory.

Parameters
mpiGridSpatial grid

Definition at line 874 of file grid.cpp.

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

◆ transferInParts()

void transferInParts ( dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid,
std::vector< CellID > & incoming_cells_list,
std::vector< CellID > & outgoing_cells_list,
bool refinement = false )

Definition at line 490 of file grid.cpp.

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

◆ updateRemoteVelocityBlockLists()

void updateRemoteVelocityBlockLists ( dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid,
const uint popID,
const uint neighborhood = Neighborhoods::DIST_FUNC )

Updates velocity block lists between remote neighbors and prepares local copies of remote neighbors to receive velocity block data. This is needed if one has locally adjusted velocity blocks

Parameters
mpiGridThe DCCRG grid with spatial cells

Definition at line 919 of file grid.cpp.

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

◆ writeVelMesh()

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

Definition at line 73 of file grid.cpp.

Here is the call graph for this function:

Variable Documentation

◆ logFile

Logger logFile
extern

Definition at line 25 of file main.cpp.