|
Vlasiator ebf0dd394 on dev (v5.4.0 + 1054 commits)
|
SysBoundary contains the SysBoundaryConditions used in the simulation. More...
#include <sysboundary.h>
Public Member Functions | |
| SysBoundary () | |
| ~SysBoundary () | |
| Destructor for class SysBoundary. | |
| void | addParameters () |
| Add its own and all existing SysBoundaryConditions' parameters. | |
| void | getParameters () |
| Get this class' parameters. | |
| void | addSysBoundary (SBC::SysBoundaryCondition *sbc, Project &project, creal &t) |
| void | initSysBoundaries (Project &project, creal &t) |
| Initialise all system boundary conditions actually used. | |
| bool | existSysBoundary (std::string name) |
| Boolean check if queried sysboundarycondition exists Note: this queries against the parsed list of names, not against the actual existing boundaries. This is so that the project configuration (which is handled before grid and boundary initialization) can use this call. | |
| void | checkRefinement (dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid) |
| void | classifyCells (dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid) |
| Classify all simulation cells with respect to the system boundary conditions. | |
| void | applyInitialState (dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid, fsgrids::perbspan perb, fsgrids::bgbspan bgb, Project &project) |
| Apply the initial state to all system boundary cells. Loops through all SysBoundaryConditions and calls the corresponding applyInitialState function. This function must apply the initial state for all existing particle species. | |
| void | updateState (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid, fsgrids::perbspan perb, fsgrids::bgbspan bgb, creal t) |
| void | applySysBoundaryVlasovConditions (dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, creal &t, const bool calculate_V_moments) |
| Apply the Vlasov system boundary conditions to all system boundary cells at time t. | |
| void | setupL2OutflowAtRestart (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid) |
| unsigned int | size () const |
| SBC::SysBoundaryCondition * | getSysBoundary (cuint sysBoundaryType) const |
| bool | isAnyDynamic () const |
| bool | isPeriodic (uint direction) const |
| void | updateSysBoundariesAfterLoadBalance (dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid) |
| void | clear () |
Private Member Functions | |
| SysBoundary (const SysBoundary &bc) | |
Private Attributes | |
| std::list< SBC::SysBoundaryCondition * > | sysBoundaries |
| std::map< uint, SBC::SysBoundaryCondition * > | indexToSysBoundary |
| std::vector< std::string > | sysBoundaryCondList |
| bool | anyDynamic |
| std::array< bool, 3 > | periodic |
SysBoundary contains the SysBoundaryConditions used in the simulation.
The purpose of SysBoundary is to contain SBC::SysBoundaryConditions, and apply them to the simulation volume cells if the cells pertain to a specific boundary type. If the simulation domain is not fully periodic then the behaviour at the edges or boundaries of the volume has to be properly defined.
initSysBoundaries creates the instances of SBC::SysBoundaryConditions that are needed. They are then initialised, which means the internals are prepared for the system boundary condition to be applied (import and process parameters, generate template cells etc.). When the whole simulation domain is initialised, the boundary conditions are applied to the cells they have by calling applyInitialState.
If needed, a user can write his or her own SBC::SysBoundaryConditions, which are loaded when the simulation initializes.
Definition at line 54 of file sysboundary.h.
| SysBoundary::SysBoundary | ( | ) |
| SysBoundary::~SysBoundary | ( | ) |
Destructor for class SysBoundary.
Reduces the value of SysBoundary::nSysBoundaries by one, and if after the destruction SysBoundary::nSysBoundaries equals zero all stored SysBoundaries are deleted.
|
private |
Private copy-constructor to prevent copying the class.

| void SysBoundary::addParameters | ( | ) |
Add its own and all existing SysBoundaryConditions' parameters.
Adds the parameters specific to the SysBondary class handling the list of SysBoundaryConditions and then calls the static addParameters functions of all SysBoundaryConditions implemented in the code in order to have them appear also in the help.
Definition at line 79 of file sysboundary.cpp.


| void SysBoundary::addSysBoundary | ( | SBC::SysBoundaryCondition * | bc, |
| Project & | project, | ||
| creal & | t ) |
Add a new SBC::SysBoundaryCondition which has been created with new sysBoundary. SysBoundary will take care of deleting it.
| bc | SysBoundaryCondition object |
| project | Project object |
| t | Current time |
| success | If true, the given SBC::SysBoundaryCondition was added successfully. |
Definition at line 124 of file sysboundary.cpp.


| void SysBoundary::applyInitialState | ( | dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > & | mpiGrid, |
| fsgrids::technicalspan | technical, | ||
| FieldSolverGrid & | fsgrid, | ||
| fsgrids::perbspan | perb, | ||
| fsgrids::bgbspan | bgb, | ||
| Project & | project ) |
Apply the initial state to all system boundary cells. Loops through all SysBoundaryConditions and calls the corresponding applyInitialState function. This function must apply the initial state for all existing particle species.
| mpiGrid | Grid |
| success | If true, the application of all system boundary states succeeded. |
Definition at line 599 of file sysboundary.cpp.

| void SysBoundary::applySysBoundaryVlasovConditions | ( | dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > & | mpiGrid, |
| creal & | t, | ||
| const bool | calculate_V_moments ) |
Apply the Vlasov system boundary conditions to all system boundary cells at time t.
Loops through all SysBoundaryConditions and calls the corresponding vlasovBoundaryCondition() function. The boundary condition functions are called for all particle species, one at a time.
WARNING (see end of the function) Blocks are changed but lists not updated now, if you need to use/communicate them before the next update is done, add an update at the end of this function.
| mpiGrid | Grid |
| t | Current time |
| calculate_V_moments | if true, compute into _V, false into _R moments so that the interpolated ones can be done |
Definition at line 663 of file sysboundary.cpp.


| void SysBoundary::checkRefinement | ( | dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > & | mpiGrid | ) |
Definition at line 262 of file sysboundary.cpp.


| void SysBoundary::classifyCells | ( | dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > & | mpiGrid, |
| fsgrids::technicalspan | technical, | ||
| FieldSolverGrid & | fsgrid ) |
Classify all simulation cells with respect to the system boundary conditions.
Loops through all cells and and for each assigns the correct sysBoundaryFlag depending on the return value of each SysBoundaryCondition's assignSysBoundary.
| mpiGrid | Grid |
Definition at line 359 of file sysboundary.cpp.


|
inline |
| bool SysBoundary::existSysBoundary | ( | std::string | name | ) |
Boolean check if queried sysboundarycondition exists Note: this queries against the parsed list of names, not against the actual existing boundaries. This is so that the project configuration (which is handled before grid and boundary initialization) can use this call.
| string | name |
| success | if queried boundary exists |
Definition at line 252 of file sysboundary.cpp.

| void SysBoundary::getParameters | ( | ) |
Get this class' parameters.
Get the parameters pertaining to this class.
getParameters for each actually used system boundary condition is called by each SysBoundaryCondition's initialization function.
Definition at line 103 of file sysboundary.cpp.


| SBC::SysBoundaryCondition * SysBoundary::getSysBoundary | ( | cuint | sysBoundaryType | ) | const |
Get a pointer to the SysBoundaryCondition of given index.
| sysBoundaryType | Type of the system boundary condition to return |
Definition at line 743 of file sysboundary.cpp.


Initialise all system boundary conditions actually used.
This function loops through the list of system boundary conditions listed as to be used in the configuration file/command line arguments. For each of these it adds the corresponding instance and updates the member isDynamic to determine whether any SysBoundaryCondition is dynamic in time.
| project | Project object |
| t | Current time |
| success | If true, the initialisation of all system boundaries succeeded. |
Definition at line 153 of file sysboundary.cpp.


| bool SysBoundary::isAnyDynamic | ( | ) | const |
Get a bool telling whether any system boundary condition is dynamic in time (and thus needs updating).
| isDynamic | Is any system boundary condition dynamic in time. |
Definition at line 760 of file sysboundary.cpp.

| bool SysBoundary::isPeriodic | ( | uint | direction | ) | const |
Get a bool telling whether the system is periodic in the queried direction.
| direction | 0: x, 1: y, 2: z. |
| periodic | Is the system periodic in the queried direction. |
Definition at line 766 of file sysboundary.cpp.

| void SysBoundary::setupL2OutflowAtRestart | ( | dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & | mpiGrid | ) |
Definition at line 633 of file sysboundary.cpp.


| unsigned int SysBoundary::size | ( | ) | const |
Get the number of SysBoundaryConditions stored in SysBoundary.
| size | Number of SysBoundaryConditions stored in SysBoundary. |
Definition at line 755 of file sysboundary.cpp.
| void SysBoundary::updateState | ( | dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & | mpiGrid, |
| fsgrids::technicalspan | technical, | ||
| FieldSolverGrid & | fsgrid, | ||
| fsgrids::perbspan | perb, | ||
| fsgrids::bgbspan | bgb, | ||
| creal | t ) |
Definition at line 619 of file sysboundary.cpp.


| void SysBoundary::updateSysBoundariesAfterLoadBalance | ( | dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > & | mpiGrid | ) |
Updates all NonsysboundaryCells into an internal map. This should be called in loadBalance.
| mpiGrid | The DCCRG grid |
Definition at line 791 of file sysboundary.cpp.


|
private |
bool telling whether any system boundary condition is dynamic in time (and thus needs updating).
Definition at line 107 of file sysboundary.h.
|
private |
A map from the system boundary types to the corresponding class member.
Definition at line 103 of file sysboundary.h.
|
private |
Array of bool telling whether the system is periodic in any direction.
Definition at line 110 of file sysboundary.h.
|
private |
A container for all SBC::SysBoundaryConditions stored in SysBoundary.
Definition at line 101 of file sysboundary.h.
|
private |
List of system boundary conditions (SBC) to be used.
Definition at line 105 of file sysboundary.h.