|
Vlasiator ebf0dd394 on dev (v5.4.0 + 1054 commits)
|
#include <project.h>

Public Member Functions | |
| Project () | |
| virtual | ~Project () |
| virtual Real | getCorrectNumberDensity (spatial_cell::SpatialCell *cell, const uint popID) const |
| virtual void | getParameters () |
| virtual bool | initialize () |
| virtual void | hook (cuint &stage, const dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, fsgrids::perbspan perb, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid) const |
| bool | initialized () |
| virtual void | setProjectBField (fsgrids::perbspan perb, fsgrids::bgbspan bgb, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid) |
| virtual void | setupBeforeSetCell (const std::vector< CellID > &cells) |
| void | setCell (spatial_cell::SpatialCell *cell) |
| Set the perturbed fields and distribution of a cell according to the default simulation settings. This is used for the NOT_SYSBOUNDARY cells and some other system boundary conditions (e.g. Outflow). | |
| virtual bool | canRefine (spatial_cell::SpatialCell *cell) const |
| virtual bool | shouldRefineCell (dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, CellID id, Real r_max2) const |
| virtual bool | shouldUnrefineCell (dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, CellID id, Real r_max2) const |
| virtual bool | refineSpatialCells (dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid) const |
| virtual uint64_t | adaptRefinement (dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid) const |
| Adapts refinement by one level according to the project. Returns true if any cells were refined, false if not. | |
| virtual bool | forceRefinement (dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, int n) const |
| Refine/unrefine spatial cells one level to the static criteria in the config. | |
| virtual bool | filterRefined (dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid) const |
| Boxcar filters spatial cells that were recently refined. | |
Static Public Member Functions | |
| static void | addParameters () |
Protected Member Functions | |
| virtual uint | findBlocksToInitialize (spatial_cell::SpatialCell *cell, const uint popID) const |
| Prepares a list of blocks to loop through when initialising. | |
| void | setVelocitySpace (const uint popID, spatial_cell::SpatialCell *cell) const |
| Sets the distribution function in a cell. | |
| virtual void | calcCellParameters (spatial_cell::SpatialCell *cell, creal &t) |
| virtual Realf | fillPhaseSpace (spatial_cell::SpatialCell *cell, const uint popID, const uint nRequested) const =0 |
| void | printPopulations () |
| virtual bool | rescalesDensity (const uint popID) const |
| void | rescaleDensity (spatial_cell::SpatialCell *cell, const uint popID) const |
| Real | getRandomNumber (std::default_random_engine &randGen) const |
| void | setRandomSeed (uint64_t seedModifier, std::default_random_engine &randGen) const |
| void | setRandomCellSeed (spatial_cell::SpatialCell *cell, std::default_random_engine &randGen) const |
Private Attributes | |
| uint | seed |
| bool | baseClassInitialized |
Static Private Attributes | |
| static char | rngStateBuffer [256] |
| projects::Project::Project | ( | ) |
|
virtual |
Definition at line 73 of file project.cpp.
|
virtual |
Adapts refinement by one level according to the project. Returns true if any cells were refined, false if not.
| mpiGrid | grid to refine |
Definition at line 516 of file project.cpp.


|
static |
Register parameters that should be read in.
Definition at line 75 of file project.cpp.


|
protectedvirtual |
Calculate potentially needed parameters for the given spatial cell at the given time.
Currently this function is only called during initialization.
The following array indices contain the coordinates of the "lower left corner" of the cell: CellParams::XCRD, CellParams::YCRD, and CellParams::ZCRD. The cell size is given in the following array indices: CellParams::DX, CellParams::DY, and CellParams::DZ.
| cell | Pointer to the spatial cell to be handled. |
| t | The current value of time. This is passed as a convenience. If you need more detailed information of the state of the simulation, you can read it from Parameters. |
Print a warning message to stderr and abort, one should not use the base class functions.
Reimplemented in projects::Alfven, projects::Diffusion, projects::Dispersion, projects::Distributions, projects::Firehose, projects::Flowthrough, projects::Fluctuations, projects::Harris, projects::IPShock, projects::KHB, projects::Larmor, projects::LossCone, projects::Magnetosphere, projects::MultiPeak, projects::Riemann1, projects::Shock, projects::Shocktest, projects::test_fp, projects::TestHall, and projects::verificationLarmor.
Definition at line 296 of file project.cpp.

|
virtual |
|
protectedpure virtual |
Calculates the distribution function contents for the spatial cell and population in question NOTE: This function is called inside parallel region so it must be declared as const. This function will contain a loop over nRequested velocity blocks, with the block GlobalIDs provided in the GIDlist buffer, storing phase-space densities in the bufferData buffer.
| popID | Particle species ID. |
Implemented in projects::Alfven, projects::Diffusion, projects::Dispersion, projects::Distributions, projects::Firehose, projects::Flowthrough, projects::Fluctuations, projects::Harris, projects::IPShock, projects::KHB, projects::Larmor, projects::LossCone, projects::Magnetosphere, projects::MultiPeak, projects::Riemann1, projects::Shock, projects::Shocktest, projects::Template, projects::test_fp, projects::TestHall, and projects::verificationLarmor.

|
virtual |
Boxcar filters spatial cells that were recently refined.
| mpiGrid | grid to filter |
Definition at line 601 of file project.cpp.


|
protectedvirtual |
Prepares a list of blocks to loop through when initialising.
The base class version just prepares all blocks, which amounts to looping through the whole velocity space. This is very expensive and becomes prohibitive in cases where a large velocity space is needed with only small portions actually containing something. Use with care. NOTE: This function is called inside parallel region so it must be declared as const. The function stores the prepared blocks into cell->velocity_block_with_content_list and returns the count.
Reimplemented in projects::TriAxisSearch.
Definition at line 175 of file project.cpp.


|
virtual |
Refine/unrefine spatial cells one level to the static criteria in the config.
| mpiGrid | Spatial grid |
| n | Static refinement pass. 0th pass refines level 0 cells and unrefines max level cells, 1st pass refines level 1 and unrefines max level -1 etc. |
Definition at line 591 of file project.cpp.

|
virtual |
Get correct number density base class function?
Reimplemented in projects::Flowthrough.
Definition at line 308 of file project.cpp.

|
virtual |
Get the value that was read in.
Reimplemented in projects::Alfven, projects::Diffusion, projects::Dispersion, projects::Distributions, projects::Firehose, projects::Flowthrough, projects::Fluctuations, projects::Harris, projects::IPShock, projects::KHB, projects::Larmor, projects::LossCone, projects::Magnetosphere, projects::MultiPeak, projects::Riemann1, projects::Shock, projects::Shocktest, projects::Template, projects::test_fp, projects::TestHall, and projects::verificationLarmor.
Definition at line 103 of file project.cpp.

|
protected |
Get random number between 0 and 1.0. One should always first initialize the rng.
| rngDataBuffer | struct of type random_data |
Definition at line 317 of file project.cpp.

|
virtual |
Perform some operation at each time step in the main program loop.
Reimplemented in projects::Dispersion.
Definition at line 138 of file project.cpp.

|
virtual |
Initialize project. Can be used, e.g., to read in parameters from the input file.
Initialize the Project. Velocity mesh and particle population parameters are read from the configuration file, and corresponding internal variables are created here. NOTE: Each project must call this function!
Reimplemented in projects::Alfven, projects::Diffusion, projects::Dispersion, projects::Distributions, projects::Firehose, projects::Flowthrough, projects::Fluctuations, projects::Harris, projects::IPShock, projects::KHB, projects::Larmor, projects::LossCone, projects::Magnetosphere, projects::MultiPeak, projects::Riemann1, projects::Shock, projects::Shocktest, projects::Template, projects::test_fp, projects::TestHall, and projects::verificationLarmor.
Definition at line 113 of file project.cpp.

| bool projects::Project::initialized | ( | ) |
Check if base class has been initialized.
Definition at line 124 of file project.cpp.

|
protected |
Write simulated particle populations to logfile.
Definition at line 219 of file project.cpp.

|
virtual |
Reimplemented in projects::IPShock.
Definition at line 354 of file project.cpp.

|
protected |
Rescale the distribution function of the given particle species so that the number density corresponds to the value returned by getCorrectNumberDensity.
| cell | Spatial cell. |
| popID | ID of the particle species. |
Definition at line 272 of file project.cpp.


|
protectedvirtual |
Check if the project wants to rescale densities.
| popID | ID of the particle species. |
Reimplemented in projects::Flowthrough.
Definition at line 264 of file project.cpp.

| void projects::Project::setCell | ( | spatial_cell::SpatialCell * | cell | ) |
Set the perturbed fields and distribution of a cell according to the default simulation settings. This is used for the NOT_SYSBOUNDARY cells and some other system boundary conditions (e.g. Outflow).
| cell | Pointer to the cell to set. |
Definition at line 150 of file project.cpp.


|
virtual |
Set the background and perturbed magnetic fields for this project.
| perBGrid | Grid on which values of the perturbed field can be set if needed. |
| BgBGrid | Grid on which values for the background field can be set if needed, e.g. using the background field functions. |
| technical | Technical fsgrid, available if some of its data is necessary. |
Print a warning message to stderr and abort, one should not use the base class functions.
Reimplemented in projects::Alfven, projects::Diffusion, projects::Dispersion, projects::Distributions, projects::Firehose, projects::Flowthrough, projects::Fluctuations, projects::Harris, projects::IPShock, projects::KHB, projects::Larmor, projects::LossCone, projects::Magnetosphere, projects::MultiPeak, projects::Riemann1, projects::Shock, projects::Shocktest, projects::Template, projects::test_fp, projects::TestHall, and projects::verificationLarmor.
Definition at line 127 of file project.cpp.

|
protected |
Set random seed (thread-safe) that is always the same for this particular cellID. Can be used to make reproducible simulations that do not depend on number of processes or threads.
| cell | SpatialCell used to infer CellID value to use as seed modifier |
| rngStateBuffer | buffer where random number values are kept |
| rngDataBuffer | struct of type random_data |
Set random seed (thread-safe) that is always the same for this particular cellID. Can be used to make reproducible simulations that do not depend on number of processes or threads.
| cell | SpatialCell used to infer CellID value to use as seed modifier |
| randGen | std::default_random_engine& to use |
Definition at line 336 of file project.cpp.


|
protected |
Set random seed (thread-safe). Seed is based on the seed read in from cfg + the seedModifier parameter
| seedModifier | CellID value to use as seed modifier |
| rngStateBuffer | buffer where random number values are kept |
| rngDataBuffer | struct of type random_data |
Set random seed (thread-safe). Seed is based on the seed read in from cfg + the seedModifier parameter
| seedModifier | value (e.g. CellID) to use as seed modifier |
| randGen | std::default_random_engine& to use |
Definition at line 326 of file project.cpp.

|
virtual |
Setup data structures for subsequent setCell calls. This will most likely be empty for most projects, except for some advanced data juggling ones (like restart from a subset of a larger run)
| cells | Local cellIDs of this task. |
Definition at line 142 of file project.cpp.

|
protected |
Sets the distribution function in a cell.
Uses the function findBlocksToInitialize and loops through the list returned by it to initialize the cells' velocity space. NOTE: This function is called inside parallel region so it must be declared as const.
Definition at line 235 of file project.cpp.


|
virtual |
|
virtual |
|
private |