Vlasiator ebf0dd394 on dev (v5.4.0 + 1054 commits)
Loading...
Searching...
No Matches
SysBoundary Class Reference

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::SysBoundaryConditiongetSysBoundary (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

Detailed Description

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.

Constructor & Destructor Documentation

◆ SysBoundary() [1/2]

SysBoundary::SysBoundary ( )

Definition at line 43 of file main.cpp.

Here is the caller graph for this function:

◆ ~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.

Definition at line 44 of file main.cpp.

◆ SysBoundary() [2/2]

SysBoundary::SysBoundary ( const SysBoundary & bc)
private

Private copy-constructor to prevent copying the class.

Here is the call graph for this function:

Member Function Documentation

◆ addParameters()

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.

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

◆ addSysBoundary()

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.

Parameters
bcSysBoundaryCondition object
projectProject object
tCurrent time
Return values
successIf true, the given SBC::SysBoundaryCondition was added successfully.

Definition at line 124 of file sysboundary.cpp.

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

◆ applyInitialState()

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.

Parameters
mpiGridGrid
Return values
successIf true, the application of all system boundary states succeeded.

Definition at line 599 of file sysboundary.cpp.

Here is the caller graph for this function:

◆ applySysBoundaryVlasovConditions()

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.

Parameters
mpiGridGrid
tCurrent time
calculate_V_momentsif true, compute into _V, false into _R moments so that the interpolated ones can be done

Definition at line 663 of file sysboundary.cpp.

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

◆ checkRefinement()

void SysBoundary::checkRefinement ( dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid)

Definition at line 262 of file sysboundary.cpp.

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

◆ classifyCells()

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.

Parameters
mpiGridGrid

Definition at line 359 of file sysboundary.cpp.

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

◆ clear()

void SysBoundary::clear ( )
inline

Definition at line 91 of file sysboundary.h.

Here is the caller graph for this function:

◆ existSysBoundary()

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.

Parameters
stringname
Return values
successif queried boundary exists
See also
addSysBoundary

Definition at line 252 of file sysboundary.cpp.

Here is the caller graph for this function:

◆ getParameters()

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.

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

◆ getSysBoundary()

SBC::SysBoundaryCondition * SysBoundary::getSysBoundary ( cuint sysBoundaryType) const

Get a pointer to the SysBoundaryCondition of given index.

Parameters
sysBoundaryTypeType of the system boundary condition to return
Returns
Pointer to the instance of the SysBoundaryCondition. NULL if sysBoundaryType is invalid.

Definition at line 743 of file sysboundary.cpp.

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

◆ initSysBoundaries()

void SysBoundary::initSysBoundaries ( Project & project,
creal & t )

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.

Parameters
projectProject object
tCurrent time
Return values
successIf true, the initialisation of all system boundaries succeeded.
See also
addSysBoundary

Definition at line 153 of file sysboundary.cpp.

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

◆ isAnyDynamic()

bool SysBoundary::isAnyDynamic ( ) const

Get a bool telling whether any system boundary condition is dynamic in time (and thus needs updating).

Return values
isDynamicIs any system boundary condition dynamic in time.

Definition at line 760 of file sysboundary.cpp.

Here is the caller graph for this function:

◆ isPeriodic()

bool SysBoundary::isPeriodic ( uint direction) const

Get a bool telling whether the system is periodic in the queried direction.

Parameters
direction0: x, 1: y, 2: z.
Return values
periodicIs the system periodic in the queried direction.

Definition at line 766 of file sysboundary.cpp.

Here is the caller graph for this function:

◆ setupL2OutflowAtRestart()

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

Definition at line 633 of file sysboundary.cpp.

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

◆ size()

unsigned int SysBoundary::size ( ) const

Get the number of SysBoundaryConditions stored in SysBoundary.

Return values
sizeNumber of SysBoundaryConditions stored in SysBoundary.

Definition at line 755 of file sysboundary.cpp.

◆ updateState()

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.

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

◆ updateSysBoundariesAfterLoadBalance()

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.

Parameters
mpiGridThe DCCRG grid

Definition at line 791 of file sysboundary.cpp.

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

Member Data Documentation

◆ anyDynamic

bool SysBoundary::anyDynamic
private

bool telling whether any system boundary condition is dynamic in time (and thus needs updating).

Definition at line 107 of file sysboundary.h.

◆ indexToSysBoundary

std::map<uint, SBC::SysBoundaryCondition*> SysBoundary::indexToSysBoundary
private

A map from the system boundary types to the corresponding class member.

Definition at line 103 of file sysboundary.h.

◆ periodic

std::array<bool, 3> SysBoundary::periodic
private

Array of bool telling whether the system is periodic in any direction.

Definition at line 110 of file sysboundary.h.

◆ sysBoundaries

std::list<SBC::SysBoundaryCondition*> SysBoundary::sysBoundaries
private

A container for all SBC::SysBoundaryConditions stored in SysBoundary.

Definition at line 101 of file sysboundary.h.

◆ sysBoundaryCondList

std::vector<std::string> SysBoundary::sysBoundaryCondList
private

List of system boundary conditions (SBC) to be used.

Definition at line 105 of file sysboundary.h.


The documentation for this class was generated from the following files: