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

Copysphere is a class applying an ionosphere-ish boundary conditions. More...

#include <copysphere.h>

Inheritance diagram for SBC::Copysphere:
Collaboration diagram for SBC::Copysphere:

Public Member Functions

 Copysphere ()
virtual ~Copysphere ()
virtual void getParameters () override
virtual void initSysBoundary (creal &t, Project &project) override
virtual void assignSysBoundary (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid) 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
void getFaces (bool *faces) override
virtual std::string getName () const override
virtual uint getIndex () const override
void generateTemplateCell (Project &project)
void setCellFromTemplate (SpatialCell *cell, const uint popID)
std::array< Real, 3 > fieldSolverGetNormalDirection (fsgrids::technicalspan technical, FieldSolverGrid &fsgrid, cint i, cint j, cint k)
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)
virtual void setupL2OutflowAtRestart (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid)
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)

Public Attributes

Real center [3]
Real radius
uint geometry
std::vector< CopysphereSpeciesParametersspeciesParams
bool zeroPerB
spatial_cell::SpatialCell templateCell

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)
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

Detailed Description

Copysphere is a class applying an ionosphere-ish boundary conditions.

Copysphere is a class handling cells tagged as sysboundarytype::COPYSPHERE by this system boundary condition. It applies copy boundary conditions to perturbed magnetic field.

These consist in:

  • Do nothing for the distribution (keep the initial state constant in time);
  • Copy the closest neighbors' perturbed B and average it;
  • Null out the electric fields.

For 3D magnetospheric simulations, you might be interesting in trying the ionosphere boundary instead!

Definition at line 55 of file copysphere.h.

Constructor & Destructor Documentation

◆ Copysphere()

SBC::Copysphere::Copysphere ( )

Definition at line 49 of file copysphere.cpp.

Here is the call graph for this function:

◆ ~Copysphere()

SBC::Copysphere::~Copysphere ( )
virtual

Definition at line 51 of file copysphere.cpp.

Member Function Documentation

◆ addParameters()

void SBC::Copysphere::addParameters ( )
static

Definition at line 53 of file copysphere.cpp.

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

◆ applyInitialState()

void SBC::Copysphere::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 182 of file copysphere.cpp.

Here is the call graph for this function:

◆ assignSysBoundary()

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

Implements SBC::SysBoundaryCondition.

Definition at line 160 of file copysphere.cpp.

Here is the call graph for this function:

◆ fieldSolverBoundaryCondBVOLDerivatives()

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

Implements SBC::SysBoundaryCondition.

Definition at line 612 of file copysphere.cpp.

Here is the call graph for this function:

◆ fieldSolverBoundaryCondDerivatives()

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

Implements SBC::SysBoundaryCondition.

Definition at line 606 of file copysphere.cpp.

Here is the call graph for this function:

◆ fieldSolverBoundaryCondElectricField()

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

Implements SBC::SysBoundaryCondition.

Definition at line 568 of file copysphere.cpp.

◆ fieldSolverBoundaryCondGradPeElectricField()

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

Implements SBC::SysBoundaryCondition.

Definition at line 600 of file copysphere.cpp.

◆ fieldSolverBoundaryCondHallElectricField()

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

Implements SBC::SysBoundaryCondition.

Definition at line 573 of file copysphere.cpp.

◆ fieldSolverBoundaryCondMagneticField()

Real SBC::Copysphere::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

We want here to

– Average perturbed face B from the nearest neighbours

– Retain only the normal components of perturbed face B

Implements SBC::SysBoundaryCondition.

Definition at line 480 of file copysphere.cpp.

◆ fieldSolverGetNormalDirection()

std::array< Real, 3 > SBC::Copysphere::fieldSolverGetNormalDirection ( fsgrids::technicalspan technical,
FieldSolverGrid & fsgrid,
cint i,
cint j,
cint k )

Definition at line 203 of file copysphere.cpp.

Here is the call graph for this function:

◆ generateTemplateCell()

void SBC::Copysphere::generateTemplateCell ( Project & project)

NOTE: This function must initialize all particle species!

Parameters
project

Definition at line 629 of file copysphere.cpp.

Here is the call graph for this function:

◆ getFaces()

void SBC::Copysphere::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 740 of file copysphere.cpp.

◆ getIndex()

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

Implements SBC::SysBoundaryCondition.

Definition at line 747 of file copysphere.cpp.

Here is the caller graph for this function:

◆ getName()

std::string SBC::Copysphere::getName ( ) const
overridevirtual

Reimplemented from SBC::SysBoundaryCondition.

Definition at line 739 of file copysphere.cpp.

◆ getParameters()

void SBC::Copysphere::getParameters ( )
overridevirtual

Reimplemented from SBC::SysBoundaryCondition.

Definition at line 76 of file copysphere.cpp.

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

◆ initSysBoundary()

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

Implements SBC::SysBoundaryCondition.

Definition at line 122 of file copysphere.cpp.

Here is the call graph for this function:

◆ setCellFromTemplate()

void SBC::Copysphere::setCellFromTemplate ( SpatialCell * cell,
const uint popID )

Definition at line 731 of file copysphere.cpp.

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

◆ updateState()

void SBC::Copysphere::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 742 of file copysphere.cpp.

◆ vlasovBoundaryCondition()

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

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.

Implements SBC::SysBoundaryCondition.

Definition at line 619 of file copysphere.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ center

Real SBC::Copysphere::center[3]

Coordinates of the centre of the copy sphere.

Definition at line 112 of file copysphere.h.

◆ geometry

uint SBC::Copysphere::geometry

Geometry of the copy sphere, 0: inf-norm (diamond), 1: 1-norm (square), 2: 2-norm (circle, DEFAULT), 3: polar-plane cylinder with line dipole.

Definition at line 114 of file copysphere.h.

◆ radius

Real SBC::Copysphere::radius

Radius of the copy sphere.

Definition at line 113 of file copysphere.h.

◆ speciesParams

std::vector<CopysphereSpeciesParameters> SBC::Copysphere::speciesParams

Definition at line 116 of file copysphere.h.

◆ templateCell

spatial_cell::SpatialCell SBC::Copysphere::templateCell

Definition at line 119 of file copysphere.h.

◆ zeroPerB

bool SBC::Copysphere::zeroPerB

Definition at line 117 of file copysphere.h.


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