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

Go to the source code of this file.

Classes

struct  FieldSolverData

Functions

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 balanceLoad (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, SysBoundary &sysBoundaries, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid, bool doTranslationLists=true)
 Balance load.
void prepareAMRLists (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid)
void updateRemoteVelocityBlockLists (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const uint popID, const uint neighborhood=Neighborhoods::DIST_FUNC)
void deallocateRemoteCellBlocks (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid)
bool adjustVelocityBlocks (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const std::vector< CellID > &cellsToAdjust, bool doPrepareToReceiveBlocks, const uint popID)
void shrink_to_fit_grid_data (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid)
void setFaceNeighborRanks (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid)
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=-1)
void recalculateLocalCellsCache (const dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid)

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 std::vector< CellID > & cellsToAdjust,
bool doPrepareToReceiveBlocks,
const uint popID )

Adjust sparse velocity space to make it consistent in all 6 dimensions

1) Compute which blocks have content (done for all cells in mpiGrid) 2) Adjust local velocity blocks. That is, make sure blocks exist which have content, or have neighbors with content in all 6-dimensions. This is done for cells in cellsToAdjust list. 3) Make sure remote cells are up-to-date and ready to receive data, if doPrepareToReceiveBlocks is true.

Note that block existence does not use vlasov stencil as it is important to also include diagonals to avoid massloss

Parameters
mpiGridParallel grid with spatial cells
cellsToAdjustList of cells that are adjusted, that is cells which blocks are added or removed.
doPrepareToReceiveBlocksIf true, then remote cells are set up so that velocity space data can be received. Global operation, value has to be the same for all processes.

◆ 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 blocks in remote cells in order to save memory.

Parameters
mpiGridSpatial grid

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:

◆ 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:

◆ 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:

◆ 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: