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

#include <KHB.h>

Inheritance diagram for projects::KHB:
Collaboration diagram for projects::KHB:

Public Types

enum  { TOP , BOTTOM }

Public Member Functions

 KHB ()
virtual ~KHB ()
virtual bool initialize (void) override
virtual void getParameters (void) override
virtual void calcCellParameters (spatial_cell::SpatialCell *cell, creal &t) override
virtual std::vector< std::array< Real, 3 > > getV0 (creal x, creal y, creal z, const uint popID) const override
 Return a vector containing the velocity coordinate of the centre of each ion population in the distribution.
virtual void setProjectBField (fsgrids::perbspan perb, fsgrids::bgbspan bgb, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid) override
virtual Realf fillPhaseSpace (spatial_cell::SpatialCell *cell, const uint popID, const uint nRequested) const override
virtual Realf probePhaseSpace (spatial_cell::SpatialCell *cell, const uint popID, Real vx_in, Real vy_in, Real vz_in) const override
Real profile (creal top, creal bottom, creal x) const
Public Member Functions inherited from projects::Project
 Project ()
virtual ~Project ()
virtual Real getCorrectNumberDensity (spatial_cell::SpatialCell *cell, const uint popID) const
virtual void hook (cuint &stage, const dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, fsgrids::perbspan perb, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid) const
bool initialized ()
virtual void setupBeforeSetCell (const std::vector< CellID > &cells)
void setCell (spatial_cell::SpatialCell *cell)
 Set the perturbed fields and distribution of a cell according to the default simulation settings. This is used for the NOT_SYSBOUNDARY cells and some other system boundary conditions (e.g. Outflow).
virtual bool canRefine (spatial_cell::SpatialCell *cell) const
virtual bool shouldRefineCell (dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, CellID id, Real r_max2) const
virtual bool shouldUnrefineCell (dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, CellID id, Real r_max2) const
virtual bool refineSpatialCells (dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid) const
virtual uint64_t adaptRefinement (dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid) const
 Adapts refinement by one level according to the project. Returns true if any cells were refined, false if not.
virtual bool forceRefinement (dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, int n) const
 Refine/unrefine spatial cells one level to the static criteria in the config.
virtual bool filterRefined (dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid) const
 Boxcar filters spatial cells that were recently refined.

Static Public Member Functions

static void addParameters (void)
Static Public Member Functions inherited from projects::Project
static void addParameters ()

Public Attributes

Real P
Real rho [2]
Real Vx [2]
Real Vy [2]
Real Vz [2]
Real Bx [2]
Real By [2]
Real Bz [2]
Real lambda
Real amp
Real offset
Real transitionWidth
int harmonics
bool randomPhase

Additional Inherited Members

Protected Member Functions inherited from projects::Project
void setVelocitySpace (const uint popID, spatial_cell::SpatialCell *cell) const
 Sets the distribution function in a cell.
void printPopulations ()
virtual bool rescalesDensity (const uint popID) const
void rescaleDensity (spatial_cell::SpatialCell *cell, const uint popID) const
Real getRandomNumber (std::default_random_engine &randGen) const
void setRandomSeed (uint64_t seedModifier, std::default_random_engine &randGen) const
void setRandomCellSeed (spatial_cell::SpatialCell *cell, std::default_random_engine &randGen) const

Detailed Description

Definition at line 32 of file KHB.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
TOP 
BOTTOM 

Definition at line 53 of file KHB.h.

Constructor & Destructor Documentation

◆ KHB()

projects::KHB::KHB ( )

Definition at line 36 of file KHB.cpp.

◆ ~KHB()

projects::KHB::~KHB ( )
virtual

Definition at line 37 of file KHB.cpp.

Member Function Documentation

◆ addParameters()

void projects::KHB::addParameters ( void )
static

Definition at line 41 of file KHB.cpp.

Here is the caller graph for this function:

◆ calcCellParameters()

void projects::KHB::calcCellParameters ( spatial_cell::SpatialCell * cell,
creal & t )
overridevirtual

Calculate potentially needed parameters for the given spatial cell at the given time.

Currently this function is only called during initialization.

The following array indices contain the coordinates of the "lower left corner" of the cell: CellParams::XCRD, CellParams::YCRD, and CellParams::ZCRD. The cell size is given in the following array indices: CellParams::DX, CellParams::DY, and CellParams::DZ.

Parameters
cellPointer to the spatial cell to be handled.
tThe current value of time. This is passed as a convenience. If you need more detailed information of the state of the simulation, you can read it from Parameters.

Print a warning message to stderr and abort, one should not use the base class functions.

Reimplemented from projects::Project.

Definition at line 241 of file KHB.cpp.

◆ fillPhaseSpace()

Realf projects::KHB::fillPhaseSpace ( spatial_cell::SpatialCell * cell,
const uint popID,
const uint nRequested ) const
overridevirtual

Calculates the distribution function contents for the spatial cell and population in question NOTE: This function is called inside parallel region so it must be declared as const. This function will contain a loop over nRequested velocity blocks, with the block GlobalIDs provided in the GIDlist buffer, storing phase-space densities in the bufferData buffer.

Parameters
popIDParticle species ID.
Returns
The total stored number density of the cell for this population The physical unit of this quantity is 1/m^3.

Implements projects::Project.

Definition at line 147 of file KHB.cpp.

Here is the call graph for this function:

◆ getParameters()

void projects::KHB::getParameters ( void )
overridevirtual

Get the value that was read in.

Reimplemented from projects::Project.

Definition at line 66 of file KHB.cpp.

Here is the call graph for this function:

◆ getV0()

vector< std::array< Real, 3 > > projects::KHB::getV0 ( creal x,
creal y,
creal z,
const uint popID ) const
inlineoverridevirtual

Return a vector containing the velocity coordinate of the centre of each ion population in the distribution.

This function is used by findBlocksToInitialize() to start the search of the extent of the distribution along each axis. The extension to a vector allows to have more than one population in each spatial cell.

See also
findBlocksToInitialize

Implements projects::TriAxisSearch.

Definition at line 112 of file KHB.cpp.

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

◆ initialize()

bool projects::KHB::initialize ( void )
overridevirtual

Initialize project. Can be used, e.g., to read in parameters from the input file.

Initialize the Project. Velocity mesh and particle population parameters are read from the configuration file, and corresponding internal variables are created here. NOTE: Each project must call this function!

Returns
If true, particle species and velocity meshes were created successfully.

Reimplemented from projects::Project.

Definition at line 39 of file KHB.cpp.

Here is the call graph for this function:

◆ probePhaseSpace()

Realf projects::KHB::probePhaseSpace ( spatial_cell::SpatialCell * cell,
const uint popID,
Real vx_in,
Real vy_in,
Real vz_in ) const
overridevirtual

Implements projects::TriAxisSearch.

Definition at line 211 of file KHB.cpp.

Here is the call graph for this function:

◆ profile()

Real projects::KHB::profile ( creal top,
creal bottom,
creal x ) const

Definition at line 99 of file KHB.cpp.

Here is the caller graph for this function:

◆ setProjectBField()

void projects::KHB::setProjectBField ( fsgrids::perbspan perb,
fsgrids::bgbspan bgb,
fsgrids::technicalspan technical,
FieldSolverGrid & fsgrid )
overridevirtual

Set the background and perturbed magnetic fields for this project.

Parameters
perBGridGrid on which values of the perturbed field can be set if needed.
BgBGridGrid on which values for the background field can be set if needed, e.g. using the background field functions.
technicalTechnical fsgrid, available if some of its data is necessary.
See also
setBackgroundField, setBackgroundFieldToZero

Print a warning message to stderr and abort, one should not use the base class functions.

Reimplemented from projects::Project.

Definition at line 243 of file KHB.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ amp

Real projects::KHB::amp

Definition at line 66 of file KHB.h.

◆ Bx

Real projects::KHB::Bx[2]

Definition at line 62 of file KHB.h.

◆ By

Real projects::KHB::By[2]

Definition at line 63 of file KHB.h.

◆ Bz

Real projects::KHB::Bz[2]

Definition at line 64 of file KHB.h.

◆ harmonics

int projects::KHB::harmonics

Definition at line 69 of file KHB.h.

◆ lambda

Real projects::KHB::lambda

Definition at line 65 of file KHB.h.

◆ offset

Real projects::KHB::offset

Definition at line 67 of file KHB.h.

◆ P

Real projects::KHB::P

Definition at line 57 of file KHB.h.

◆ randomPhase

bool projects::KHB::randomPhase

Definition at line 70 of file KHB.h.

◆ rho

Real projects::KHB::rho[2]

Definition at line 58 of file KHB.h.

◆ transitionWidth

Real projects::KHB::transitionWidth

Definition at line 68 of file KHB.h.

◆ Vx

Real projects::KHB::Vx[2]

Definition at line 59 of file KHB.h.

◆ Vy

Real projects::KHB::Vy[2]

Definition at line 60 of file KHB.h.

◆ Vz

Real projects::KHB::Vz[2]

Definition at line 61 of file KHB.h.


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