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

#include <ionosphere.h>

Classes

struct  Element
struct  Node
struct  AtmosphericLayer

Public Types

enum  IonosphereSolverGaugeFixing { None , Pole , Integral , Equator }
enum  IonosphereIonizationModel {
  Rees1963 , Rees1989 , SergienkoIvanov , Robinson2020 ,
  Juusola2025 , FixedSigma
}

Public Member Functions

Real lookupProductionValue (int heightindex, Real energy_keV, Real temperature_keV)
void setDipoleField (const FieldFunction &dipole)
void setConstantBackgroundField (const std::array< Real, 3 > B)
void readAtmosphericModelFile (const char *filename)
void storeNodeB ()
void offset_FAC ()
void normalizeRadius (Node &n, Real R)
void updateConnectivity ()
void updateIonosphereCommunicator (dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid)
void initializeTetrahedron ()
void initializeOctahedron ()
void initializeIcosahedron ()
void initializeSphericalFibonacci (int n)
void initializeGridFromFile (std::string path)
int32_t findElementNeighbour (uint32_t e, int n1, int n2)
uint32_t findNodeAtCoordinates (std::array< Real, 3 > x)
void subdivideElement (uint32_t e)
void stitchRefinementInterfaces ()
void calculatePrecipitation ()
void calculateConductivityTensor (const Real F10_7, const Real recombAlpha, const Real backgroundIonisation, const bool refillTensorAtRestart=false)
Real interpolateUpmappedPotential (const std::array< Real, 3 > &x)
void addMatrixDependency (uint node1, uint node2, Real coeff, bool transposed=false)
void addAllMatrixDependencies (uint nodeIndex)
void initSolver (bool zeroOut=true)
iSolverReal Atimes (uint nodeIndex, int parameter, bool transpose=false)
Real Asolve (uint nodeIndex, int parameter, bool transpose=false)
void solve (int &iteration, int &nRestarts, Real &residual, Real &minPotentialN, Real &maxPotentialN, Real &minPotentialS, Real &maxPotentialS)
void solveInternal (int &iteration, int &nRestarts, Real &residual, Real &minPotentialN, Real &maxPotentialN, Real &minPotentialS, Real &maxPotentialS)
void mapDownBoundaryData (fsgrids::perbspan perb, fsgrids::constdperbspan dperb, fsgrids::momentsspan moments, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid)
Real elementArea (uint32_t elementIndex)
std::array< Real, 3 > mappedElementArea (uint32_t elementIndex)
Eigen::Vector3d elementBarycentre (uint32_t el)
Eigen::Vector3d elementCircumcentre (uint el)
Eigen::Vector3d elementNormal (uint32_t el)
Eigen::Vector3d commonEdgeMidpoint (uint32_t el1, uint32_t el2)
Real dualPolygonArea (uint gridNode)
Real areaInDualPolygon (uint gridNode, uint gridElem)
Real nodeNeighbourArea (uint32_t nodeIndex)
std::tuple< Eigen::Vector3d, Eigen::Vector3d > connectingSegmentLengths (uint32_t el1, uint32_t el2)
std::array< Real, 3 > computeGradT (const std::array< Real, 3 > &a, const std::array< Real, 3 > &b, const std::array< Real, 3 > &c)
std::array< Real, 9 > sigmaAverage (uint elementIndex)
double elementIntegral (uint elementIndex, int i, int j, bool transpose=false)

Public Attributes

std::vector< Elementelements
std::vector< Eigen::Vector3d > elementCurlFreeCurrent
std::vector< Eigen::Vector3d > elementDivFreeCurrent
std::vector< Nodenodes
std::array< AtmosphericLayer, numAtmosphereLevelsatmosphere
enum SBC::SphericalTriGrid::IonosphereSolverGaugeFixing gaugeFixing
enum SBC::SphericalTriGrid::IonosphereIonizationModel ionizationModel
std::array< std::array< std::array< Real, productionNumTemperatures >, productionNumAccEnergies >, numAtmosphereLevelsproductionTable
MPI_Comm communicator = MPI_COMM_NULL
int rank = -1
int writingRank
bool isCouplingInwards = true
bool isCouplingOutwards = true
FieldFunction dipoleField
std::array< Real, 3 > BGB
std::map< std::array< Real, 3 >, std::array< std::pair< int, Real >, 3 > > vlasovGridCoupling

Static Public Attributes

static constexpr int numAtmosphereLevels = 20

Detailed Description

Definition at line 76 of file ionosphere.h.

Member Enumeration Documentation

◆ IonosphereIonizationModel

Enumerator
Rees1963 
Rees1989 
SergienkoIvanov 
Robinson2020 
Juusola2025 
FixedSigma 

Definition at line 160 of file ionosphere.h.

◆ IonosphereSolverGaugeFixing

Enumerator
None 
Pole 
Integral 
Equator 

Definition at line 153 of file ionosphere.h.

Member Function Documentation

◆ addAllMatrixDependencies()

void SBC::SphericalTriGrid::addAllMatrixDependencies ( uint nodeIndex)

Definition at line 2285 of file ionosphere.cpp.

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

◆ addMatrixDependency()

void SBC::SphericalTriGrid::addMatrixDependency ( uint node1,
uint node2,
Real coeff,
bool transposed = false )

Add matrix value for the solver

Definition at line 2204 of file ionosphere.cpp.

Here is the caller graph for this function:

◆ areaInDualPolygon()

Real SBC::SphericalTriGrid::areaInDualPolygon ( uint gridNode,
uint gridElem )
inline

Definition at line 457 of file ionosphere.h.

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

◆ Asolve()

Real SBC::SphericalTriGrid::Asolve ( uint nodeIndex,
int parameter,
bool transpose = false )

Evaluate own parameter value

Definition at line 2519 of file ionosphere.cpp.

Here is the caller graph for this function:

◆ Atimes()

iSolverReal SBC::SphericalTriGrid::Atimes ( uint nodeIndex,
int parameter,
bool transpose = false )

Evaluate neighbour nodes' coupled parameter

Definition at line 2500 of file ionosphere.cpp.

Here is the caller graph for this function:

◆ calculateConductivityTensor()

void SBC::SphericalTriGrid::calculateConductivityTensor ( const Real F10_7,
const Real recombAlpha,
const Real backgroundIonisation,
const bool refillTensorAtRestart = false )

Update sigma tensor, if last argument is true, just refill the tensor from SIGMAH, SIGMAP and SIGMAPARALLEL from restart data

Definition at line 1160 of file ionosphere.cpp.

Here is the call graph for this function:

◆ calculatePrecipitation()

void SBC::SphericalTriGrid::calculatePrecipitation ( )

Estimate precipitation flux

Definition at line 1136 of file ionosphere.cpp.

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

◆ commonEdgeMidpoint()

Eigen::Vector3d SBC::SphericalTriGrid::commonEdgeMidpoint ( uint32_t el1,
uint32_t el2 )
inline

Definition at line 387 of file ionosphere.h.

Here is the caller graph for this function:

◆ computeGradT()

std::array< Real, 3 > SBC::SphericalTriGrid::computeGradT ( const std::array< Real, 3 > & a,
const std::array< Real, 3 > & b,
const std::array< Real, 3 > & c )

Definition at line 2120 of file ionosphere.cpp.

Here is the caller graph for this function:

◆ connectingSegmentLengths()

std::tuple< Eigen::Vector3d, Eigen::Vector3d > SBC::SphericalTriGrid::connectingSegmentLengths ( uint32_t el1,
uint32_t el2 )
inline

Definition at line 504 of file ionosphere.h.

Here is the call graph for this function:

◆ dualPolygonArea()

Real SBC::SphericalTriGrid::dualPolygonArea ( uint gridNode)
inline

Definition at line 418 of file ionosphere.h.

Here is the call graph for this function:

◆ elementArea()

Real SBC::SphericalTriGrid::elementArea ( uint32_t elementIndex)
inline

Definition at line 243 of file ionosphere.h.

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

◆ elementBarycentre()

Eigen::Vector3d SBC::SphericalTriGrid::elementBarycentre ( uint32_t el)
inline

Definition at line 298 of file ionosphere.h.

Here is the caller graph for this function:

◆ elementCircumcentre()

Eigen::Vector3d SBC::SphericalTriGrid::elementCircumcentre ( uint el)
inline

Definition at line 312 of file ionosphere.h.

Here is the caller graph for this function:

◆ elementIntegral()

Real SBC::SphericalTriGrid::elementIntegral ( uint elementIndex,
int i,
int j,
bool transpose = false )

Definition at line 2150 of file ionosphere.cpp.

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

◆ elementNormal()

Eigen::Vector3d SBC::SphericalTriGrid::elementNormal ( uint32_t el)
inline

Definition at line 361 of file ionosphere.h.

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

◆ findElementNeighbour()

int32_t SBC::SphericalTriGrid::findElementNeighbour ( uint32_t e,
int n1,
int n2 )

Definition at line 617 of file ionosphere.cpp.

Here is the caller graph for this function:

◆ findNodeAtCoordinates()

uint32_t SBC::SphericalTriGrid::findNodeAtCoordinates ( std::array< Real, 3 > x)

Find the mesh node closest to the given coordinate

Definition at line 640 of file ionosphere.cpp.

Here is the call graph for this function:

◆ initializeGridFromFile()

void SBC::SphericalTriGrid::initializeGridFromFile ( std::string path)

Initialize grid from an OBJ or VTK file

Definition at line 380 of file ionosphere.cpp.

Here is the call graph for this function:

◆ initializeIcosahedron()

void SBC::SphericalTriGrid::initializeIcosahedron ( )

Initialize grid as a base icosahedron

Definition at line 238 of file ionosphere.cpp.

Here is the call graph for this function:

◆ initializeOctahedron()

void SBC::SphericalTriGrid::initializeOctahedron ( )

Initialize grid as a base octahedron

Definition at line 201 of file ionosphere.cpp.

Here is the call graph for this function:

◆ initializeSphericalFibonacci()

void SBC::SphericalTriGrid::initializeSphericalFibonacci ( int n)

Initialize grid as a spherical fibonacci lattice

Definition at line 279 of file ionosphere.cpp.

Here is the call graph for this function:

◆ initializeTetrahedron()

void SBC::SphericalTriGrid::initializeTetrahedron ( )

Initialize grid as a base tetrahedron

Definition at line 167 of file ionosphere.cpp.

Here is the call graph for this function:

◆ initSolver()

void SBC::SphericalTriGrid::initSolver ( bool zeroOut = true)

Initialize the CG solver

Definition at line 2443 of file ionosphere.cpp.

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

◆ interpolateUpmappedPotential()

Real SBC::SphericalTriGrid::interpolateUpmappedPotential ( const std::array< Real, 3 > & x)

Calculate upmapped potential at the given point

Definition at line 1854 of file ionosphere.cpp.

Here is the call graph for this function:

◆ lookupProductionValue()

Real SBC::SphericalTriGrid::lookupProductionValue ( int heightindex,
Real energy_keV,
Real temperature_keV )

Definition at line 1088 of file ionosphere.cpp.

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

◆ mapDownBoundaryData()

void SBC::SphericalTriGrid::mapDownBoundaryData ( fsgrids::perbspan perb,
fsgrids::constdperbspan dperb,
fsgrids::momentsspan moments,
fsgrids::technicalspan technical,
FieldSolverGrid & fsgrid )

Definition at line 1881 of file ionosphere.cpp.

Here is the call graph for this function:

◆ mappedElementArea()

std::array< Real, 3 > SBC::SphericalTriGrid::mappedElementArea ( uint32_t elementIndex)
inline

Definition at line 262 of file ionosphere.h.

Here is the call graph for this function:

◆ nodeNeighbourArea()

Real SBC::SphericalTriGrid::nodeNeighbourArea ( uint32_t nodeIndex)
inline

Definition at line 492 of file ionosphere.h.

Here is the call graph for this function:

◆ normalizeRadius()

void SBC::SphericalTriGrid::normalizeRadius ( Node & n,
Real R )

Scale all coordinates onto sphere with radius R

Definition at line 141 of file ionosphere.cpp.

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

◆ offset_FAC()

void SBC::SphericalTriGrid::offset_FAC ( )

Offset field aligned currents to get overall zero current

Definition at line 105 of file ionosphere.cpp.

Here is the caller graph for this function:

◆ readAtmosphericModelFile()

void SBC::SphericalTriGrid::readAtmosphericModelFile ( const char * filename)

Store the value of the magnetic field at the node.

Definition at line 892 of file ionosphere.cpp.

Here is the call graph for this function:

◆ setConstantBackgroundField()

void SBC::SphericalTriGrid::setConstantBackgroundField ( const std::array< Real, 3 > B)
inline

Definition at line 187 of file ionosphere.h.

◆ setDipoleField()

void SBC::SphericalTriGrid::setDipoleField ( const FieldFunction & dipole)
inline

Definition at line 184 of file ionosphere.h.

◆ sigmaAverage()

std::array< Real, 9 > SBC::SphericalTriGrid::sigmaAverage ( uint elementIndex)

Definition at line 2134 of file ionosphere.cpp.

Here is the caller graph for this function:

◆ solve()

void SBC::SphericalTriGrid::solve ( int & iteration,
int & nRestarts,
Real & residual,
Real & minPotentialN,
Real & maxPotentialN,
Real & minPotentialS,
Real & maxPotentialS )

Definition at line 2536 of file ionosphere.cpp.

Here is the call graph for this function:

◆ solveInternal()

void SBC::SphericalTriGrid::solveInternal ( int & iteration,
int & nRestarts,
Real & residual,
Real & minPotentialN,
Real & maxPotentialN,
Real & minPotentialS,
Real & maxPotentialS )

Definition at line 2627 of file ionosphere.cpp.

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

◆ stitchRefinementInterfaces()

void SBC::SphericalTriGrid::stitchRefinementInterfaces ( )

Make sure there are no t-junctions in the mesh by splitting neighbours

Definition at line 2333 of file ionosphere.cpp.

◆ storeNodeB()

void SBC::SphericalTriGrid::storeNodeB ( )

Definition at line 1078 of file ionosphere.cpp.

◆ subdivideElement()

void SBC::SphericalTriGrid::subdivideElement ( uint32_t e)

Subdivide mesh within element e

Definition at line 706 of file ionosphere.cpp.

Here is the call graph for this function:

◆ updateConnectivity()

void SBC::SphericalTriGrid::updateConnectivity ( )

Re-link elements and nodes

Definition at line 151 of file ionosphere.cpp.

Here is the caller graph for this function:

◆ updateIonosphereCommunicator()

void SBC::SphericalTriGrid::updateIonosphereCommunicator ( dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > & mpiGrid,
fsgrids::technicalspan technical,
FieldSolverGrid & fsgrid )

(Re-)create the subcommunicator for ionosphere-internal communication

Definition at line 1814 of file ionosphere.cpp.

Member Data Documentation

◆ atmosphere

std::array<AtmosphericLayer, numAtmosphereLevels> SBC::SphericalTriGrid::atmosphere

Definition at line 151 of file ionosphere.h.

◆ BGB

std::array<Real, 3> SBC::SphericalTriGrid::BGB

Uniform background field

Definition at line 179 of file ionosphere.h.

◆ communicator

MPI_Comm SBC::SphericalTriGrid::communicator = MPI_COMM_NULL

The communicator internally used to solve the ionosphere potential

Definition at line 173 of file ionosphere.h.

◆ dipoleField

FieldFunction SBC::SphericalTriGrid::dipoleField

Simulation background field model to trace connections with

Definition at line 178 of file ionosphere.h.

◆ elementCurlFreeCurrent

std::vector<Eigen::Vector3d> SBC::SphericalTriGrid::elementCurlFreeCurrent

Definition at line 85 of file ionosphere.h.

◆ elementDivFreeCurrent

std::vector<Eigen::Vector3d> SBC::SphericalTriGrid::elementDivFreeCurrent

Definition at line 86 of file ionosphere.h.

◆ elements

std::vector<Element> SBC::SphericalTriGrid::elements

Definition at line 84 of file ionosphere.h.

◆ gaugeFixing

enum SBC::SphericalTriGrid::IonosphereSolverGaugeFixing SBC::SphericalTriGrid::gaugeFixing

◆ ionizationModel

enum SBC::SphericalTriGrid::IonosphereIonizationModel SBC::SphericalTriGrid::ionizationModel

◆ isCouplingInwards

bool SBC::SphericalTriGrid::isCouplingInwards = true

True for any rank that actually couples fsgrid information into the ionosphere

Definition at line 176 of file ionosphere.h.

◆ isCouplingOutwards

bool SBC::SphericalTriGrid::isCouplingOutwards = true

True for any rank that actually couples ionosphere potential information out to the vlasov grid

Definition at line 177 of file ionosphere.h.

◆ nodes

std::vector<Node> SBC::SphericalTriGrid::nodes

Definition at line 137 of file ionosphere.h.

◆ numAtmosphereLevels

int SBC::SphericalTriGrid::numAtmosphereLevels = 20
staticconstexpr

Definition at line 140 of file ionosphere.h.

◆ productionTable

std::array< std::array< std::array< Real, productionNumTemperatures >, productionNumAccEnergies >, numAtmosphereLevels > SBC::SphericalTriGrid::productionTable

Definition at line 170 of file ionosphere.h.

◆ rank

int SBC::SphericalTriGrid::rank = -1

Own rank in the ionosphere communicator

Definition at line 174 of file ionosphere.h.

◆ vlasovGridCoupling

std::map< std::array<Real, 3>, std::array< std::pair<int, Real>, 3> > SBC::SphericalTriGrid::vlasovGridCoupling

Grid coupling information, caching how vlasovGrid coordinate couple to ionosphere data

Definition at line 182 of file ionosphere.h.

◆ writingRank

int SBC::SphericalTriGrid::writingRank

Rank in the MPI_COMM_WORLD communicator that does ionosphere I/O

Definition at line 175 of file ionosphere.h.


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