Peano
Loading...
Searching...
No Matches
applications::exahype2::euler::sphericalaccretion::SSInfall Class Reference

#include <SSInfall.h>

Inheritance diagram for applications::exahype2::euler::sphericalaccretion::SSInfall:
Collaboration diagram for applications::exahype2::euler::sphericalaccretion::SSInfall:

Public Member Functions

void startTimeStep (double globalMinTimeStamp, double globalMaxTimeStamp, double globalMinTimeStepSize, double globalMaxTimeStepSize) override
 
void finishTimeStep () override
 
::exahype2::RefinementCommand refinementCriterion (const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &volumeCentre, const tarch::la::Vector< Dimensions, double > &volumeH, double t) override
 
void initialCondition (double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &volumeCentre, const tarch::la::Vector< Dimensions, double > &volumeH, bool gridIsConstructed) override
 
void sourceTerm (const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &volumeCentre, const tarch::la::Vector< Dimensions, double > &volumeH, double t, double dt, double *__restrict__ S) override
 There are two variants of the source term.
 
virtual void boundaryConditions (const double *__restrict__ Qinside, double *__restrict__ Qoutside, const tarch::la::Vector< Dimensions, double > &faceCentre, const tarch::la::Vector< Dimensions, double > &volumeH, double t, int normal) override
 
virtual double maxEigenvalue (const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &faceCentre, const tarch::la::Vector< Dimensions, double > &volumeH, double t, double dt, int normal) override
 See flux() for a description why there are two maxEigenvalue() versions.
 
virtual void flux (const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &faceCentre, const tarch::la::Vector< Dimensions, double > &volumeH, double t, double dt, int normal, double *__restrict__ F) override
 The flux in the SSInfall does not depend on any variable of the solver.
 
void add_mass (const double r_coor, const double rho, const double size)
 
double mass_interpolate (const double r_coor, const int MassCal)
 
virtual bool patchCanUseStatelessPDETerms (const tarch::la::Vector< Dimensions, double > &patchCentre, const tarch::la::Vector< Dimensions, double > &patchH, double t, double dt) const
 Within the mass accumulation radius, I return false.
 
bool isOutsideOfLargestRadius (const tarch::la::Vector< Dimensions, double > &patchCentre, const tarch::la::Vector< Dimensions, double > &patchH) const
 This is a very conservative routine.
 

Static Public Member Functions

static void sourceTerm (const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &volumeCentre, const tarch::la::Vector< Dimensions, double > &volumeH, double t, double dt, double *__restrict__ S, Offloadable)
 This is the variation that's used on the GPU.
 
static double maxEigenvalue (const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &faceCentre, const tarch::la::Vector< Dimensions, double > &volumeH, double t, double dt, int normal, Offloadable)
 
static void flux (const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &faceCentre, const tarch::la::Vector< Dimensions, double > &volumeH, double t, double dt, int normal, double *__restrict__ F, Offloadable)
 

Static Public Attributes

static const tarch::la::Vector< Dimensions, double > OverDensityCentre
 

Private Member Functions

std::string plotGlobalMTot (bool plotCopy) const
 
std::string plotRs () const
 
double getInitialMIn (double r_coord) const
 Returns m_in for time t=0.
 

Static Private Member Functions

static double getForceDensityNorm (double r_coord, double m_in, double t, double density, double a_input)
 

Static Private Attributes

static tarch::logging::Log _log
 
static double _rMax
 This is a straight 1:1 copy of r_s[sample_number-1].
 
static double _rhoMax
 This is a straight 1:1 copy of rho_x[sample_number-1].
 
static double _mTotMax
 From m_tot_copy[sample_number-1].
 

Detailed Description

Definition at line 13 of file SSInfall.h.

Member Function Documentation

◆ add_mass()

void applications::exahype2::euler::sphericalaccretion::SSInfall::add_mass ( const double  r_coor,
const double  rho,
const double  size 
)

◆ boundaryConditions()

virtual void applications::exahype2::euler::sphericalaccretion::SSInfall::boundaryConditions ( const double *__restrict__  Qinside,
double *__restrict__  Qoutside,
const tarch::la::Vector< Dimensions, double > &  faceCentre,
const tarch::la::Vector< Dimensions, double > &  volumeH,
double  t,
int  normal 
)
overridevirtual

◆ finishTimeStep()

void applications::exahype2::euler::sphericalaccretion::SSInfall::finishTimeStep ( )
override

◆ flux() [1/2]

virtual void applications::exahype2::euler::sphericalaccretion::SSInfall::flux ( const double *__restrict__  Q,
const tarch::la::Vector< Dimensions, double > &  faceCentre,
const tarch::la::Vector< Dimensions, double > &  volumeH,
double  t,
double  dt,
int  normal,
double *__restrict__  F 
)
overridevirtual

The flux in the SSInfall does not depend on any variable of the solver.

Therefore, we wrote a second variant of the flux() function which is static. This version basically invokes its static counterpart subject to some additional assertions and logging.

The static version fits to the GPU (see guidebook).

◆ flux() [2/2]

static void applications::exahype2::euler::sphericalaccretion::SSInfall::flux ( const double *__restrict__  Q,
const tarch::la::Vector< Dimensions, double > &  faceCentre,
const tarch::la::Vector< Dimensions, double > &  volumeH,
double  t,
double  dt,
int  normal,
double *__restrict__  F,
Offloadable   
)
static

◆ getForceDensityNorm()

static double applications::exahype2::euler::sphericalaccretion::SSInfall::getForceDensityNorm ( double  r_coord,
double  m_in,
double  t,
double  density,
double  a_input 
)
staticprivate
Returns
force density norm
Parameters
m_inTypically the result of getInitialMIn()
tTimestamp
densityTypically Q[0]

◆ getInitialMIn()

double applications::exahype2::euler::sphericalaccretion::SSInfall::getInitialMIn ( double  r_coord) const
private

Returns m_in for time t=0.

◆ initialCondition()

void applications::exahype2::euler::sphericalaccretion::SSInfall::initialCondition ( double *__restrict__  Q,
const tarch::la::Vector< Dimensions, double > &  volumeCentre,
const tarch::la::Vector< Dimensions, double > &  volumeH,
bool  gridIsConstructed 
)
override

◆ isOutsideOfLargestRadius()

bool applications::exahype2::euler::sphericalaccretion::SSInfall::isOutsideOfLargestRadius ( const tarch::la::Vector< Dimensions, double > &  patchCentre,
const tarch::la::Vector< Dimensions, double > &  patchH 
) const

This is a very conservative routine.

It takes the difference to centre, computes the L2 norm, adds a safety distance of \( \sqrt{3} h/2 \) and return true if an only if this holds.

If a patch is definitely outside of the largest radius, there's a couple of very natural consequences:

  • The interpolation is way easier than int eh general case: It will always be the fallback/generic version only using the static fields to interpolate.
  • A patch outside of the largest radius will definitely not contribute at all to the global mass, density, ...

◆ mass_interpolate()

double applications::exahype2::euler::sphericalaccretion::SSInfall::mass_interpolate ( const double  r_coor,
const int  MassCal 
)

◆ maxEigenvalue() [1/2]

virtual double applications::exahype2::euler::sphericalaccretion::SSInfall::maxEigenvalue ( const double *__restrict__  Q,
const tarch::la::Vector< Dimensions, double > &  faceCentre,
const tarch::la::Vector< Dimensions, double > &  volumeH,
double  t,
double  dt,
int  normal 
)
overridevirtual

See flux() for a description why there are two maxEigenvalue() versions.

◆ maxEigenvalue() [2/2]

static double applications::exahype2::euler::sphericalaccretion::SSInfall::maxEigenvalue ( const double *__restrict__  Q,
const tarch::la::Vector< Dimensions, double > &  faceCentre,
const tarch::la::Vector< Dimensions, double > &  volumeH,
double  t,
double  dt,
int  normal,
Offloadable   
)
static

◆ patchCanUseStatelessPDETerms()

virtual bool applications::exahype2::euler::sphericalaccretion::SSInfall::patchCanUseStatelessPDETerms ( const tarch::la::Vector< Dimensions, double > &  patchCentre,
const tarch::la::Vector< Dimensions, double > &  patchH,
double  t,
double  dt 
) const
virtual

Within the mass accumulation radius, I return false.

Outside, I return true. In the initial step, we do not allow anything to be offloaded to an accelerator.

◆ plotGlobalMTot()

std::string applications::exahype2::euler::sphericalaccretion::SSInfall::plotGlobalMTot ( bool  plotCopy) const
private

◆ plotRs()

std::string applications::exahype2::euler::sphericalaccretion::SSInfall::plotRs ( ) const
private

◆ refinementCriterion()

::exahype2::RefinementCommand applications::exahype2::euler::sphericalaccretion::SSInfall::refinementCriterion ( const double *__restrict__  Q,
const tarch::la::Vector< Dimensions, double > &  volumeCentre,
const tarch::la::Vector< Dimensions, double > &  volumeH,
double  t 
)
override

◆ sourceTerm() [1/2]

void applications::exahype2::euler::sphericalaccretion::SSInfall::sourceTerm ( const double *__restrict__  Q,
const tarch::la::Vector< Dimensions, double > &  volumeCentre,
const tarch::la::Vector< Dimensions, double > &  volumeH,
double  t,
double  dt,
double *__restrict__  S 
)
override

There are two variants of the source term.

This one is the modified gravity variant with an inhomogeneous source term.

◆ sourceTerm() [2/2]

static void applications::exahype2::euler::sphericalaccretion::SSInfall::sourceTerm ( const double *__restrict__  Q,
const tarch::la::Vector< Dimensions, double > &  volumeCentre,
const tarch::la::Vector< Dimensions, double > &  volumeH,
double  t,
double  dt,
double *__restrict__  S,
Offloadable   
)
static

This is the variation that's used on the GPU.

It works with a homogeneous source term, i.e. zeroes on the right-hand side.

◆ startTimeStep()

void applications::exahype2::euler::sphericalaccretion::SSInfall::startTimeStep ( double  globalMinTimeStamp,
double  globalMaxTimeStamp,
double  globalMinTimeStepSize,
double  globalMaxTimeStepSize 
)
override

Field Documentation

◆ _log

tarch::logging::Log applications::exahype2::euler::sphericalaccretion::SSInfall::_log
staticprivate

Definition at line 15 of file SSInfall.h.

◆ _mTotMax

double applications::exahype2::euler::sphericalaccretion::SSInfall::_mTotMax
staticprivate

From m_tot_copy[sample_number-1].

Definition at line 38 of file SSInfall.h.

◆ _rhoMax

double applications::exahype2::euler::sphericalaccretion::SSInfall::_rhoMax
staticprivate

This is a straight 1:1 copy of rho_x[sample_number-1].

We need a scalar here, as this one goes to the GPU.

Definition at line 33 of file SSInfall.h.

◆ _rMax

double applications::exahype2::euler::sphericalaccretion::SSInfall::_rMax
staticprivate

This is a straight 1:1 copy of r_s[sample_number-1].

We need a scalar here, as this one goes to to the GPU.

Definition at line 27 of file SSInfall.h.

◆ OverDensityCentre

const tarch::la::Vector<Dimensions, double> applications::exahype2::euler::sphericalaccretion::SSInfall::OverDensityCentre
static

Definition at line 61 of file SSInfall.h.


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