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

Outflow is a class applying copy/outflow boundary conditions. More...

#include <outflow.h>

Inheritance diagram for SBC::Outflow:
Collaboration diagram for SBC::Outflow:

Public Member Functions

 Outflow ()
virtual ~Outflow ()
virtual void getParameters () override
virtual void initSysBoundary (creal &t, Project &project) override
virtual void applyInitialState (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid, fsgrids::perbspan perb, fsgrids::bgbspan bgb, Project &project) override
virtual void updateState (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid, fsgrids::perbspan perb, fsgrids::bgbspan bgb, creal t) override
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) override
virtual void fieldSolverBoundaryCondElectricField (fsgrids::efieldspan e, const fsgrid::FsStencil &stencil, cuint component) override
virtual void fieldSolverBoundaryCondHallElectricField (fsgrids::ehallspan ehall, const fsgrid::FsStencil &stencil, cuint component) override
virtual void fieldSolverBoundaryCondGradPeElectricField (fsgrids::egradpespan EGradPe, const fsgrid::FsStencil &stencil, cuint component) override
virtual void fieldSolverBoundaryCondDerivatives (fsgrids::dperbspan dperb, fsgrids::dmomentsspan dmoments, const fsgrid::FsStencil &stencil, cuint RKCase, cuint component) override
virtual void fieldSolverBoundaryCondBVOLDerivatives (fsgrids::volspan vols, const fsgrid::FsStencil &stencil, cuint component) override
virtual void vlasovBoundaryCondition (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const CellID &cellID, const uint popID, const bool calculate_V_moments) override
virtual void setupL2OutflowAtRestart (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid) override
virtual void getFaces (bool *faces) override
virtual std::string getName () const override
virtual uint getIndex () const override
Public Member Functions inherited from SBC::OuterBoundaryCondition
virtual void assignSysBoundary (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid)
Public Member Functions inherited from SBC::SysBoundaryCondition
 SysBoundaryCondition ()
virtual ~SysBoundaryCondition ()
virtual void generateTemplateCell ()
virtual void mapCellPotentialAndGetEXBDrift (std::array< Real, CellParams::N_SPATIAL_CELL_PARAMS > &cellParams)
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 Public Member Functions inherited from SBC::SysBoundaryCondition
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 Types

enum  vlasovscheme { NONE , COPY , N_SCHEMES }

Protected Attributes

bool facesToSkipFields [6]
bool facesToReapply [6]
std::vector< std::string > faceList
std::vector< std::string > faceNoFieldsList
std::vector< OutflowSpeciesParametersspeciesParams
Real quenchFactor
Protected Attributes inherited from SBC::OuterBoundaryCondition
std::array< bool, 6 > facesToProcess
Protected Attributes inherited from SBC::SysBoundaryCondition
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

Additional Inherited Members

Protected Member Functions inherited from SBC::SysBoundaryCondition
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)

Detailed Description

Outflow is a class applying copy/outflow boundary conditions.

Outflow is a class handling cells tagged as sysboundarytype::OUTFLOW by this system boundary condition. It applies copy/outflow boundary conditions.

These consist in:

  • Copy the distribution and moments from the nearest NOT_SYSBOUNDARY cell;
  • Copy the perturbed B components from the nearest NOT_SYSBOUNDARY cell. EXCEPTION: the face components adjacent to the simulation domain at the +x/+y/+z faces are propagated still.

Definition at line 54 of file outflow.h.

Member Enumeration Documentation

◆ vlasovscheme

Enumerator
NONE 
COPY 
N_SCHEMES 

Definition at line 119 of file outflow.h.

Constructor & Destructor Documentation

◆ Outflow()

SBC::Outflow::Outflow ( )

Definition at line 49 of file outflow.cpp.

◆ ~Outflow()

SBC::Outflow::~Outflow ( )
virtual

Definition at line 50 of file outflow.cpp.

Member Function Documentation

◆ addParameters()

void SBC::Outflow::addParameters ( )
static

Definition at line 52 of file outflow.cpp.

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

◆ applyInitialState()

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

Implements SBC::SysBoundaryCondition.

Definition at line 190 of file outflow.cpp.

Here is the call graph for this function:

◆ fieldSolverBoundaryCondBVOLDerivatives()

void SBC::Outflow::fieldSolverBoundaryCondBVOLDerivatives ( fsgrids::volspan vols,
const fsgrid::FsStencil & stencil,
cuint component )
overridevirtual

Implements SBC::SysBoundaryCondition.

Definition at line 289 of file outflow.cpp.

Here is the call graph for this function:

◆ fieldSolverBoundaryCondDerivatives()

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

Implements SBC::SysBoundaryCondition.

Definition at line 283 of file outflow.cpp.

Here is the call graph for this function:

◆ fieldSolverBoundaryCondElectricField()

void SBC::Outflow::fieldSolverBoundaryCondElectricField ( fsgrids::efieldspan e,
const fsgrid::FsStencil & stencil,
cuint component )
overridevirtual

Implements SBC::SysBoundaryCondition.

Definition at line 244 of file outflow.cpp.

◆ fieldSolverBoundaryCondGradPeElectricField()

void SBC::Outflow::fieldSolverBoundaryCondGradPeElectricField ( fsgrids::egradpespan EGradPe,
const fsgrid::FsStencil & stencil,
cuint component )
overridevirtual

Implements SBC::SysBoundaryCondition.

Definition at line 277 of file outflow.cpp.

◆ fieldSolverBoundaryCondHallElectricField()

void SBC::Outflow::fieldSolverBoundaryCondHallElectricField ( fsgrids::ehallspan ehall,
const fsgrid::FsStencil & stencil,
cuint component )
overridevirtual

Implements SBC::SysBoundaryCondition.

Definition at line 249 of file outflow.cpp.

◆ fieldSolverBoundaryCondMagneticField()

Real SBC::Outflow::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 )
overridevirtual

Implements SBC::SysBoundaryCondition.

Definition at line 235 of file outflow.cpp.

Here is the call graph for this function:

◆ getFaces()

void SBC::Outflow::getFaces ( bool * faces)
overridevirtual

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-

Implements SBC::SysBoundaryCondition.

Definition at line 420 of file outflow.cpp.

◆ getIndex()

uint SBC::Outflow::getIndex ( ) const
overridevirtual

Implements SBC::SysBoundaryCondition.

Definition at line 427 of file outflow.cpp.

Here is the caller graph for this function:

◆ getName()

string SBC::Outflow::getName ( ) const
overridevirtual

Reimplemented from SBC::SysBoundaryCondition.

Definition at line 426 of file outflow.cpp.

◆ getParameters()

void SBC::Outflow::getParameters ( )
overridevirtual

Reimplemented from SBC::SysBoundaryCondition.

Definition at line 75 of file outflow.cpp.

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

◆ initSysBoundary()

void SBC::Outflow::initSysBoundary ( creal & t,
Project & project )
overridevirtual

Implements SBC::SysBoundaryCondition.

Definition at line 152 of file outflow.cpp.

Here is the call graph for this function:

◆ setupL2OutflowAtRestart()

void SBC::Outflow::setupL2OutflowAtRestart ( dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid)
overridevirtual

Reimplemented from SBC::SysBoundaryCondition.

Definition at line 329 of file outflow.cpp.

Here is the call graph for this function:

◆ updateState()

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

Implements SBC::SysBoundaryCondition.

Definition at line 230 of file outflow.cpp.

◆ vlasovBoundaryCondition()

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

NOTE that this is called once for each particle species!

Parameters
mpiGrid
cellID

Implements SBC::SysBoundaryCondition.

Definition at line 299 of file outflow.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ faceList

std::vector<std::string> SBC::Outflow::faceList
protected

List of faces on which outflow boundary conditions are to be applied ([xyz][+-]).

Definition at line 111 of file outflow.h.

◆ faceNoFieldsList

std::vector<std::string> SBC::Outflow::faceNoFieldsList
protected

List of faces on which no fields outflow boundary conditions are to be applied ([xyz][+-]).

Definition at line 113 of file outflow.h.

◆ facesToReapply

bool SBC::Outflow::facesToReapply[6]
protected

Array of bool telling which faces are going to be reapplied upon restart.

Definition at line 109 of file outflow.h.

◆ facesToSkipFields

bool SBC::Outflow::facesToSkipFields[6]
protected

Array of bool telling which faces are going to be processed by the fields system boundary condition.

Definition at line 107 of file outflow.h.

◆ quenchFactor

Real SBC::Outflow::quenchFactor
protected

Factor by which to quench the inflowing parts of the velocity distribution function.

Definition at line 117 of file outflow.h.

◆ speciesParams

std::vector<OutflowSpeciesParameters> SBC::Outflow::speciesParams
protected

Definition at line 114 of file outflow.h.


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