Vlasiator ebf0dd394 on dev (v5.4.0 + 1054 commits)
Loading...
Searching...
No Matches
SBC::SysBoundaryCondition Class Referenceabstract

SBC::SysBoundaryCondition is the base class for system boundary conditions. More...

#include <sysboundarycondition.h>

Inheritance diagram for SBC::SysBoundaryCondition:

Public Member Functions

 SysBoundaryCondition ()
virtual ~SysBoundaryCondition ()
virtual void getParameters ()
virtual void generateTemplateCell ()
virtual void initSysBoundary (creal &t, Project &project)=0
virtual void assignSysBoundary (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid)=0
virtual void applyInitialState (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid, fsgrids::perbspan perb, fsgrids::bgbspan bgb, Project &project)=0
virtual void updateState (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid, fsgrids::perbspan perb, fsgrids::bgbspan bgb, creal t)=0
virtual Real fieldSolverBoundaryCondMagneticField (fsgrids::perbspan b, fsgrids::constbgbspan bgb, fsgrids::consttechnicalspan technical, const std::array< Real, 3 > &gridSpacing, const std::array< fsgrid::FsSize_t, 3 > &globalCoordinates, const fsgrid::FsStencil &stencil, cuint component)=0
virtual void fieldSolverBoundaryCondElectricField (fsgrids::efieldspan e, const fsgrid::FsStencil &stencil, cuint component)=0
virtual void fieldSolverBoundaryCondHallElectricField (fsgrids::ehallspan ehall, const fsgrid::FsStencil &stencil, cuint component)=0
virtual void fieldSolverBoundaryCondGradPeElectricField (fsgrids::egradpespan EGradPe, const fsgrid::FsStencil &stencil, cuint component)=0
virtual void fieldSolverBoundaryCondDerivatives (fsgrids::dperbspan dperb, fsgrids::dmomentsspan dmoments, const fsgrid::FsStencil &stencil, cuint RKCase, cuint component)=0
virtual void fieldSolverBoundaryCondBVOLDerivatives (fsgrids::volspan vols, const fsgrid::FsStencil &stencil, cuint component)=0
virtual void mapCellPotentialAndGetEXBDrift (std::array< Real, CellParams::N_SPATIAL_CELL_PARAMS > &cellParams)
virtual void vlasovBoundaryCondition (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const CellID &cellID, const uint popID, const bool calculate_V_moments)=0
virtual void setupL2OutflowAtRestart (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid)
virtual void getFaces (bool *faces)=0
virtual std::string getName () const
virtual uint getIndex () const =0
uint getPrecedence () const
bool isDynamic () const
bool updateSysBoundaryConditionsAfterLoadBalance (const dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const std::vector< CellID > &local_cells_on_boundary)
bool doApplyUponRestart () const
void setPeriodicity (std::array< bool, 3 > isFacePeriodic)

Static Public Member Functions

static void addParameters ()
static void setCellDerivativesToZero (fsgrids::dperbspan dperb, fsgrids::dmomentsspan dmoments, const fsgrid::FsStencil &stencil, cuint component)
static void setCellBVOLDerivativesToZero (fsgrids::volspan vols, const fsgrid::FsStencil &stencil, cuint component)

Protected Member Functions

void determineFace (bool *isThisCellOnAFace, const creal x, const creal y, const creal z, const creal dx, const creal dy, const creal dz, const bool excludeSlicesAndPeriodicDimensions=false) const
 Function used to determine on which face(s) if any the cell at given coordinates is.
void determineFace (std::array< bool, 6 > &isThisCellOnAFace, const dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, CellID id, const bool excludeSlicesAndPeriodicDimensions=false)
 Function used to determine on which face(s) if any the cell with the given MPI id is on.
void copyCellData (const SpatialCell *from, SpatialCell *to, const bool copyMomentsOnly, const uint popID, const bool copy_V_moments)
std::array< SpatialCell *, 27 > & getFlowtoCells (const CellID &cellID)
std::array< Realf *, 27 > getFlowtoCellsBlock (const std::array< SpatialCell *, 27 > flowtoCells, const vmesh::GlobalID blockGID, const uint popID)
int nbrID (const int i, const int j, const int k)
void vlasovBoundaryCopyFromTheClosestNbr (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const CellID &cellID, const bool &copyMomentsOnly, const uint popID, const bool calculate_V_moments)
void vlasovBoundaryCopyFromTheClosestL1OutflowNbr (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const CellID &cellID, const bool &copyMomentsOnly, const uint popID, const bool calculate_V_moments)
void vlasovBoundaryCopyFromAllClosestNbrs (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const CellID &cellID, const uint popID, const bool calculate_V_moments)
void vlasovBoundaryFluffyCopyFromAllCloseNbrs (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const CellID &cellID, const uint popID, const bool calculate_V_moments, creal fluffiness)
std::array< int, 3 > getTheClosestNonsysboundaryCell (fsgrids::technicalspan technical, FieldSolverGrid &fsgrid, cint i, cint j, cint k)
std::vector< std::array< int, 3 > > getAllClosestNonsysboundaryCells (fsgrids::technicalspan technical, FieldSolverGrid &fsgrid, cint i, cint j, cint k)
CellIDgetTheClosestNonsysboundaryCell (const CellID &cellID)
std::vector< CellID > & getAllClosestNonsysboundaryCells (const CellID &cellID)
std::vector< CellID > & getAllCloseNonsysboundaryCells (const CellID &cellID)
Real fieldBoundaryCopyFromSolvingNbrMagneticField (fsgrids::perbspan b, fsgrids::consttechnicalspan technical, const fsgrid::FsStencil &stencil, cuint component, cuint mask)
CellIDgetTheClosestL1OutflowCell (const CellID &cellID)
std::vector< CellID > & getAllClosestL1OutflowCells (const CellID &cellID)

Protected Attributes

uint precedence
bool dynamic
std::array< bool, 3 > periodic
std::unordered_map< CellID, std::vector< CellID > > allClosestNonsysboundaryCells
std::unordered_map< CellID, std::vector< CellID > > allCloseNonsysboundaryCells
std::unordered_map< CellID, std::vector< CellID > > allClosestL1OutflowCells
std::unordered_map< CellID, std::vector< CellID > > allCloseL1OutflowCells
bool applyUponRestart

Detailed Description

SBC::SysBoundaryCondition is the base class for system boundary conditions.

SBC::SysBoundaryCondition defines a base class for applying boundary conditions. Specific system boundary conditions inherit from this base class, that's why most functions defined here are not meant to be called and contain a corresponding error message. The functions to be called are the inherited class members.

The initSysBoundary function is used to initialise the internal workings needed by the system boundary condition to run (e.g. importing parameters, initialising class members). assignSysBoundary is used to determine whether a given cell is within the domain of system boundary condition. applyInitialState is called to initialise a system boundary cell's parameters and velocity space.

If needed, a user can write his or her own SBC::SysBoundaryConditions, which are loaded when the simulation initializes.

Definition at line 56 of file sysboundarycondition.h.

Constructor & Destructor Documentation

◆ SysBoundaryCondition()

SBC::SysBoundaryCondition::SysBoundaryCondition ( )

SysBoundaryCondition base class constructor. The constructor is empty.

Definition at line 175 of file sysboundarycondition.cpp.

Here is the caller graph for this function:

◆ ~SysBoundaryCondition()

SBC::SysBoundaryCondition::~SysBoundaryCondition ( )
virtual

SysBoundaryCondition base class virtual destructor. The destructor is empty.

Definition at line 178 of file sysboundarycondition.cpp.

Member Function Documentation

◆ addParameters()

void SBC::SysBoundaryCondition::addParameters ( )
static

SysBoundaryCondition base class instance of the addParameters function. Should not be used, each derived class should have its own.

Definition at line 181 of file sysboundarycondition.cpp.

◆ applyInitialState()

virtual void SBC::SysBoundaryCondition::applyInitialState ( dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid,
fsgrids::technicalspan technical,
FieldSolverGrid & fsgrid,
fsgrids::perbspan perb,
fsgrids::bgbspan bgb,
Project & project )
pure virtual

◆ assignSysBoundary()

virtual void SBC::SysBoundaryCondition::assignSysBoundary ( dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid,
fsgrids::technicalspan technical,
FieldSolverGrid & fsgrid )
pure virtual

◆ copyCellData()

void SBC::SysBoundaryCondition::copyCellData ( const SpatialCell * from,
SpatialCell * to,
const bool copyMomentsOnly,
const uint popID,
const bool copy_V_moments )
protected

Function used to copy the distribution and moments from one cell to another.

Parameters
fromPointer to parent cell to copy from.
toPointer to destination cell.
copyMomentsOnlyskip copying of VDF
popIDID of the particle species.
copy_V_momentswhich set of moments to copy (_V or _R)

Definition at line 376 of file sysboundarycondition.cpp.

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

◆ determineFace() [1/2]

void SBC::SysBoundaryCondition::determineFace ( bool * isThisCellOnAFace,
const creal x,
const creal y,
const creal z,
const creal dx,
const creal dy,
const creal dz,
const bool excludeSlicesAndPeriodicDimensions = false ) const
protected

Function used to determine on which face(s) if any the cell at given coordinates is.

This function is used by some of the classes inheriting from this base class.

Depth is hard-coded to be 2 as other parts of the code (field solver especially) rely on that.

Parameters
isThisCellOnAFacePointer to an array of 6 bool returning of each face whether the cell is on that face. Order: 0 x+; 1 x-; 2 y+; 3 y-; 4 z+; 5 z-
xCell x coordinate
yCell y coordinate
zCell z coordinate
dxCell dx size
dyCell dy size
dzCell dz size
excludeSlicesAndPeriodicDimensionsIf true, do not consider a cell to be part of the face if that face has a depth of 1 only (single-cell thick slices/columns) or if that direciton is periodic..

Definition at line 61 of file sysboundarycondition.cpp.

Here is the caller graph for this function:

◆ determineFace() [2/2]

void SBC::SysBoundaryCondition::determineFace ( std::array< bool, 6 > & isThisCellOnAFace,
const dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid,
CellID id,
const bool excludeSlicesAndPeriodicDimensions = false )
protected

Function used to determine on which face(s) if any the cell with the given MPI id is on.

This function is used by some of the classes inheriting from this base class.

Depth is hard-coded to be 2 as other parts of the code (field solver especially) rely on that. So if a cell has less than two unique neighbors in some direction, it is considered to be on that face.

Parameters
isThisCellOnAFaceReferemce to an std::array of 6 bool returning of each face whether the cell is on that face. Order: 0 x+; 1 x-; 2 y+; 3 y-; 4 z+; 5 z-
mpiGridReference to grid
idID of cell to check
excludeSlicesAndPeriodicDimensionsIf true, do not consider a cell to be part of the face if that face has a depth of 1 only (single-cell thick slices/columns) or if that direciton is periodic..

Definition at line 116 of file sysboundarycondition.cpp.

◆ doApplyUponRestart()

bool SBC::SysBoundaryCondition::doApplyUponRestart ( ) const

Get a bool telling whether to call again applyInitialState upon restarting the simulation.

Definition at line 731 of file sysboundarycondition.cpp.

◆ fieldBoundaryCopyFromSolvingNbrMagneticField()

Real SBC::SysBoundaryCondition::fieldBoundaryCopyFromSolvingNbrMagneticField ( fsgrids::perbspan b,
fsgrids::consttechnicalspan technical,
const fsgrid::FsStencil & stencil,
cuint component,
cuint mask )
protected

Definition at line 672 of file sysboundarycondition.cpp.

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

◆ fieldSolverBoundaryCondBVOLDerivatives()

virtual void SBC::SysBoundaryCondition::fieldSolverBoundaryCondBVOLDerivatives ( fsgrids::volspan vols,
const fsgrid::FsStencil & stencil,
cuint component )
pure virtual

◆ fieldSolverBoundaryCondDerivatives()

virtual void SBC::SysBoundaryCondition::fieldSolverBoundaryCondDerivatives ( fsgrids::dperbspan dperb,
fsgrids::dmomentsspan dmoments,
const fsgrid::FsStencil & stencil,
cuint RKCase,
cuint component )
pure virtual

◆ fieldSolverBoundaryCondElectricField()

virtual void SBC::SysBoundaryCondition::fieldSolverBoundaryCondElectricField ( fsgrids::efieldspan e,
const fsgrid::FsStencil & stencil,
cuint component )
pure virtual

Implemented in SBC::Copysphere, SBC::DoNotCompute, SBC::Inflow, SBC::Ionosphere, and SBC::Outflow.

Here is the caller graph for this function:

◆ fieldSolverBoundaryCondGradPeElectricField()

virtual void SBC::SysBoundaryCondition::fieldSolverBoundaryCondGradPeElectricField ( fsgrids::egradpespan EGradPe,
const fsgrid::FsStencil & stencil,
cuint component )
pure virtual

Implemented in SBC::Copysphere, SBC::DoNotCompute, SBC::Inflow, SBC::Ionosphere, and SBC::Outflow.

Here is the caller graph for this function:

◆ fieldSolverBoundaryCondHallElectricField()

virtual void SBC::SysBoundaryCondition::fieldSolverBoundaryCondHallElectricField ( fsgrids::ehallspan ehall,
const fsgrid::FsStencil & stencil,
cuint component )
pure virtual

Implemented in SBC::Copysphere, SBC::DoNotCompute, SBC::Inflow, SBC::Ionosphere, and SBC::Outflow.

Here is the caller graph for this function:

◆ fieldSolverBoundaryCondMagneticField()

virtual Real SBC::SysBoundaryCondition::fieldSolverBoundaryCondMagneticField ( fsgrids::perbspan b,
fsgrids::constbgbspan bgb,
fsgrids::consttechnicalspan technical,
const std::array< Real, 3 > & gridSpacing,
const std::array< fsgrid::FsSize_t, 3 > & globalCoordinates,
const fsgrid::FsStencil & stencil,
cuint component )
pure virtual

Implemented in SBC::Copysphere, SBC::DoNotCompute, SBC::Inflow, SBC::Ionosphere, and SBC::Outflow.

Here is the caller graph for this function:

◆ generateTemplateCell()

virtual void SBC::SysBoundaryCondition::generateTemplateCell ( )
inlinevirtual

Definition at line 65 of file sysboundarycondition.h.

Here is the caller graph for this function:

◆ getAllCloseNonsysboundaryCells()

vector< CellID > & SBC::SysBoundaryCondition::getAllCloseNonsysboundaryCells ( const CellID & cellID)
protected

Get the cellIDs of all the close cells of type NOT_SYSBOUNDARY.

Parameters
cellIDID of the cell to start look from.
Returns
The vector of cell indices of those cells

Definition at line 665 of file sysboundarycondition.cpp.

Here is the caller graph for this function:

◆ getAllClosestL1OutflowCells()

std::vector< CellID > & SBC::SysBoundaryCondition::getAllClosestL1OutflowCells ( const CellID & cellID)
protected

◆ getAllClosestNonsysboundaryCells() [1/2]

vector< CellID > & SBC::SysBoundaryCondition::getAllClosestNonsysboundaryCells ( const CellID & cellID)
protected

Get the cellIDs of all the closest cells of type NOT_SYSBOUNDARY.

Parameters
cellIDID of the cell to start look from.
Returns
The vector of cell indices of those cells
See also
getTheClosestNonsysboundaryCell

Definition at line 654 of file sysboundarycondition.cpp.

◆ getAllClosestNonsysboundaryCells() [2/2]

vector< array< int, 3 > > SBC::SysBoundaryCondition::getAllClosestNonsysboundaryCells ( fsgrids::technicalspan technical,
FieldSolverGrid & fsgrid,
cint i,
cint j,
cint k )
protected

Get the cellIDs of all the closest cells of type NOT_SYSBOUNDARY.

Parameters
i,j,kCoordinates of the cell to start looking from
Returns
The vector of cell indices of those cells
See also
getTheClosestNonsysboundaryCell

Definition at line 579 of file sysboundarycondition.cpp.

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

◆ getFaces()

void SBC::SysBoundaryCondition::getFaces ( bool * faces)
pure virtual

Function used to know which faces the boundary condition is applied to.

Parameters
facesPointer to array of 6 bool in which the values are returned whether the corresponding face is of that type. Order: 0 x+; 1 x-; 2 y+; 3 y-; 4 z+; 5 z-

Function used in some cases to know which faces the system boundary condition is being applied to.

Parameters
facesPointer to array of 6 bool in which the values are returned whether the corresponding face is of that type. Order: 0 x+; 1 x-; 2 y+; 3 y-; 4 z+; 5 z-

Implemented in SBC::Copysphere, SBC::DoNotCompute, SBC::Inflow, SBC::Ionosphere, and SBC::Outflow.

Definition at line 707 of file sysboundarycondition.cpp.

Here is the caller graph for this function:

◆ getFlowtoCells()

std::array< SpatialCell *, 27 > & SBC::SysBoundaryCondition::getFlowtoCells ( const CellID & cellID)
protected

◆ getFlowtoCellsBlock()

std::array< Realf *, 27 > SBC::SysBoundaryCondition::getFlowtoCellsBlock ( const std::array< SpatialCell *, 27 > flowtoCells,
const vmesh::GlobalID blockGID,
const uint popID )
protected

◆ getIndex()

virtual uint SBC::SysBoundaryCondition::getIndex ( ) const
pure virtual

Implemented in SBC::Copysphere, SBC::DoNotCompute, SBC::Inflow, SBC::Ionosphere, SBC::Maxwellian, and SBC::Outflow.

Here is the caller graph for this function:

◆ getName()

virtual std::string SBC::SysBoundaryCondition::getName ( ) const
inlinevirtual

Reimplemented in SBC::Copysphere, SBC::DoNotCompute, SBC::Inflow, SBC::Ionosphere, SBC::Maxwellian, and SBC::Outflow.

Definition at line 143 of file sysboundarycondition.h.

Here is the caller graph for this function:

◆ getParameters()

virtual void SBC::SysBoundaryCondition::getParameters ( )
inlinevirtual

Reimplemented in SBC::Copysphere, SBC::DoNotCompute, SBC::Ionosphere, SBC::Maxwellian, and SBC::Outflow.

Definition at line 62 of file sysboundarycondition.h.

Here is the caller graph for this function:

◆ getPrecedence()

uint SBC::SysBoundaryCondition::getPrecedence ( ) const

Get the precedence value of the system boundary condition.

Returns
The precedence value of the system boundary condition as set by parameter.

Definition at line 717 of file sysboundarycondition.cpp.

Here is the caller graph for this function:

◆ getTheClosestL1OutflowCell()

CellID & SBC::SysBoundaryCondition::getTheClosestL1OutflowCell ( const CellID & cellID)
protected

Get the cellID of the first closest cell of type OUTFLOW and layer L1 found.

Parameters
cellIDID of the cell to start look from.
Returns
The cell index of that cell
See also
getAllClosestNonsysboundaryCells

Definition at line 642 of file sysboundarycondition.cpp.

Here is the caller graph for this function:

◆ getTheClosestNonsysboundaryCell() [1/2]

CellID & SBC::SysBoundaryCondition::getTheClosestNonsysboundaryCell ( const CellID & cellID)
protected

Get the cellID of the first closest cell of type NOT_SYSBOUNDARY found.

Parameters
cellIDID of the cell to start look from.
Returns
The cell index of that cell
See also
getAllClosestNonsysboundaryCells

Definition at line 630 of file sysboundarycondition.cpp.

◆ getTheClosestNonsysboundaryCell() [2/2]

array< int, 3 > SBC::SysBoundaryCondition::getTheClosestNonsysboundaryCell ( fsgrids::technicalspan technical,
FieldSolverGrid & fsgrid,
cint i,
cint j,
cint k )
protected

Get the cellID of the first closest cell of type NOT_SYSBOUNDARY found.

Parameters
i,j,kCoordinates of the cell to start looking from
Returns
The cell index of that cell
See also
getAllClosestNonsysboundaryCells

Definition at line 564 of file sysboundarycondition.cpp.

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

◆ initSysBoundary()

virtual void SBC::SysBoundaryCondition::initSysBoundary ( creal & t,
Project & project )
pure virtual

Implemented in SBC::Copysphere, SBC::DoNotCompute, SBC::Inflow, SBC::Ionosphere, and SBC::Outflow.

Here is the caller graph for this function:

◆ isDynamic()

bool SBC::SysBoundaryCondition::isDynamic ( ) const

Returns whether the boundary condition is dynamic in time.

Returns
Boolean value.

Definition at line 722 of file sysboundarycondition.cpp.

Here is the caller graph for this function:

◆ mapCellPotentialAndGetEXBDrift()

void SBC::SysBoundaryCondition::mapCellPotentialAndGetEXBDrift ( std::array< Real, CellParams::N_SPATIAL_CELL_PARAMS > & cellParams)
virtual

Reimplemented in SBC::Ionosphere.

Definition at line 733 of file sysboundarycondition.cpp.

◆ nbrID()

int SBC::SysBoundaryCondition::nbrID ( const int i,
const int j,
const int k )
inlineprotected

Helper function to get the index of a neighboring cell in the arrays in allFlowtoCells.

Parameters
iOffset in x direction (-1, 0 or 1)
jOffset in y direction (-1, 0 or 1)
kOffset in z direction (-1, 0 or 1)
Return values
intIndex in the flowto cell array (0 to 26, indexed from - to + x, y, z.

Definition at line 199 of file sysboundarycondition.h.

◆ setCellBVOLDerivativesToZero()

void SBC::SysBoundaryCondition::setCellBVOLDerivativesToZero ( fsgrids::volspan vols,
const fsgrid::FsStencil & stencil,
cuint component )
static

Function used to set the system boundary condition cell's BVOL derivatives to 0.

Parameters
mpiGridGrid
cellIDThe cell's ID.
component0: x-derivatives, 1: y-derivatives, 2: z-derivatives.

Definition at line 262 of file sysboundarycondition.cpp.

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

◆ setCellDerivativesToZero()

void SBC::SysBoundaryCondition::setCellDerivativesToZero ( fsgrids::dperbspan dperb,
fsgrids::dmomentsspan dmoments,
const fsgrid::FsStencil & stencil,
cuint component )
static

Function used to set the system boundary condition cell's derivatives to 0.

Parameters
mpiGridGrid
cellIDThe cell's ID.
component0: x-derivatives, 1: y-derivatives, 2: z-derivatives, 3: xy-derivatives, 4: xz-derivatives, 5: yz-derivatives.

Definition at line 191 of file sysboundarycondition.cpp.

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

◆ setPeriodicity()

void SBC::SysBoundaryCondition::setPeriodicity ( std::array< bool, 3 > isFacePeriodic)

Definition at line 724 of file sysboundarycondition.cpp.

◆ setupL2OutflowAtRestart()

virtual void SBC::SysBoundaryCondition::setupL2OutflowAtRestart ( dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid)
inlinevirtual

Reimplemented in SBC::Outflow.

Definition at line 130 of file sysboundarycondition.h.

◆ updateState()

virtual void SBC::SysBoundaryCondition::updateState ( dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid,
fsgrids::technicalspan technical,
FieldSolverGrid & fsgrid,
fsgrids::perbspan perb,
fsgrids::bgbspan bgb,
creal t )
pure virtual

◆ updateSysBoundaryConditionsAfterLoadBalance()

bool SBC::SysBoundaryCondition::updateSysBoundaryConditionsAfterLoadBalance ( const dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid,
const std::vector< CellID > & local_cells_on_boundary )

Updates the system boundary conditions after load balancing. This is called from e.g. the class SysBoundary.

Parameters
mpiGridGrid
local_cells_on_boundaryCells within this process
Return values
successReturns true if the operation is successful

Definition at line 466 of file sysboundarycondition.cpp.

◆ vlasovBoundaryCondition()

virtual void SBC::SysBoundaryCondition::vlasovBoundaryCondition ( dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid,
const CellID & cellID,
const uint popID,
const bool calculate_V_moments )
pure virtual

This function computes the Vlasov (distribution function) boundary condition for the given particle species only. It is not! allowed to change block structure in cell.

Parameters
mpiGridParallel grid.
cellIDSpatial cell ID.
popIDParticle species ID.

Implemented in SBC::Copysphere, SBC::DoNotCompute, SBC::Inflow, SBC::Ionosphere, and SBC::Outflow.

Here is the caller graph for this function:

◆ vlasovBoundaryCopyFromAllClosestNbrs()

void SBC::SysBoundaryCondition::vlasovBoundaryCopyFromAllClosestNbrs ( dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid,
const CellID & cellID,
const uint popID,
const bool copy_V_moments )
protected

Function used to average and copy the distribution and moments from all the closest sysboundarytype::NOT_SYSBOUNDARY cells.

Parameters
mpiGridGrid
cellIDThe cell's ID.
popIDID of the particle species.
copy_V_momentswhich set of moments to copy (_V or _R)

Definition at line 338 of file sysboundarycondition.cpp.

Here is the call graph for this function:

◆ vlasovBoundaryCopyFromTheClosestL1OutflowNbr()

void SBC::SysBoundaryCondition::vlasovBoundaryCopyFromTheClosestL1OutflowNbr ( dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid,
const CellID & cellID,
const bool & copyMomentsOnly,
const uint popID,
const bool copy_V_moments )
protected

Function used to copy the distribution and moments from (one of) the closest sysboundarytype::OUTFLOW L1 cell.

Parameters
mpiGridGrid
cellIDThe cell's ID.
copyMomentsOnlyIf true, do not touch velocity space.
popIDID of the particle species.
copy_V_momentswhich set of moments to copy (_V or _R)

Definition at line 315 of file sysboundarycondition.cpp.

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

◆ vlasovBoundaryCopyFromTheClosestNbr()

void SBC::SysBoundaryCondition::vlasovBoundaryCopyFromTheClosestNbr ( dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid,
const CellID & cellID,
const bool & copyMomentsOnly,
const uint popID,
const bool copy_V_moments )
protected

Function used to copy the distribution and moments from (one of) the closest sysboundarytype::NOT_SYSBOUNDARY cell.

Parameters
mpiGridGrid
cellIDThe cell's ID.
copyMomentsOnlyIf true, do not touch velocity space.
popIDID of the particle species.
copy_V_momentswhich set of moments to copy (_V or _R)

Definition at line 293 of file sysboundarycondition.cpp.

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

◆ vlasovBoundaryFluffyCopyFromAllCloseNbrs()

void SBC::SysBoundaryCondition::vlasovBoundaryFluffyCopyFromAllCloseNbrs ( dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid,
const CellID & cellID,
const uint popID,
const bool copy_V_moments,
creal fluffiness )
protected

Function used to average and copy the distribution and moments from all the close sysboundarytype::NOT_SYSBOUNDARY cells.

Parameters
mpiGridGrid
cellIDThe cell's ID.
popIDID of the particle species.
copy_V_momentswhich set of moments to copy (_V or _R) \patam fluffiness (parameter from 0 to 1; value 0 maintains original value, 1 replaces it completely with average)

Definition at line 357 of file sysboundarycondition.cpp.

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

Member Data Documentation

◆ allCloseL1OutflowCells

std::unordered_map<CellID, std::vector<CellID> > SBC::SysBoundaryCondition::allCloseL1OutflowCells
protected

Map of close Outflow L1 cells. Used in getAllCloseL1OutflowCells.

Definition at line 276 of file sysboundarycondition.h.

◆ allCloseNonsysboundaryCells

std::unordered_map<CellID, std::vector<CellID> > SBC::SysBoundaryCondition::allCloseNonsysboundaryCells
protected

Map of close nonsysboundarycells. Used in getAllCloseNonsysboundaryCells.

Definition at line 272 of file sysboundarycondition.h.

◆ allClosestL1OutflowCells

std::unordered_map<CellID, std::vector<CellID> > SBC::SysBoundaryCondition::allClosestL1OutflowCells
protected

Map of closest Outflow L1 cells. Used in getAllClosestL1OutflowCells.

Definition at line 274 of file sysboundarycondition.h.

◆ allClosestNonsysboundaryCells

std::unordered_map<CellID, std::vector<CellID> > SBC::SysBoundaryCondition::allClosestNonsysboundaryCells
protected

Map of closest nonsysboundarycells. Used in getAllClosestNonsysboundaryCells.

Definition at line 270 of file sysboundarycondition.h.

◆ applyUponRestart

bool SBC::SysBoundaryCondition::applyUponRestart
protected

bool telling whether to call again applyInitialState upon restarting the simulation.

Definition at line 279 of file sysboundarycondition.h.

◆ dynamic

bool SBC::SysBoundaryCondition::dynamic
protected

Is the boundary condition dynamic in time or not.

Definition at line 266 of file sysboundarycondition.h.

◆ periodic

std::array<bool, 3> SBC::SysBoundaryCondition::periodic
protected

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

Definition at line 268 of file sysboundarycondition.h.

◆ precedence

uint SBC::SysBoundaryCondition::precedence
protected

Precedence value of the system boundary condition.

Definition at line 264 of file sysboundarycondition.h.


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