Peano
|
For the generic kernels that I use here most of the time. More...
Namespaces | |
namespace | dg |
namespace | elastic |
namespace | enumerator |
namespace | ExaHyPEMain |
namespace | fd |
namespace | fv |
namespace | grid |
namespace | internal |
namespace | postprocessing |
namespace | Project |
namespace | solvers |
namespace | symhype |
namespace | tracer |
Data Structures | |
class | CellAccess |
Cell access class. More... | |
struct | CellData |
Representation of a number of cells which contains all information that's required to process the stored patches or polynomial shape functions (given you know the semantics of the data). More... | |
class | EnclaveBookkeeping |
Enclave bookkeeping. More... | |
class | EnclaveTask |
Base class for all enclave tasks. More... | |
class | LoadBalancingConfiguration |
ExaHyPE 2-specific load balancing configuration. More... | |
class | PlotFilter |
class | RefinementControl |
Manage refine/erase requests within ExaHyPE 2. More... | |
class | RefinementControlService |
class | Solver |
struct | VolumeIndex |
A lot of the loop routines expect a voxel (or face) index which is a vector over integers. More... | |
struct | VolumeIndex< 0, Args... > |
Enumerations | |
enum class | PrecisionCommand { Long_double = sizeof(long double) , Double = sizeof(double) , Single = sizeof(float) , Float = Single , Half = sizeof(float) / 2 , Float16_t = Half , FP16 = Half , Bfloat = -1 , Bfloat16_t = Bfloat , BF16 = Bfloat , Custom } |
enum class | RefinementCommand { Keep , Refine , Erase } |
Functions | |
PrecisionCommand | getDefaultPrecisionCommand () |
The default is double as this is the highest precision available per default. | |
RefinementCommand | getDefaultRefinementCommand () |
The default is coarsen as this is the lowest priority command. | |
template<typename CellLabel , typename FaceLabel > | |
double | getMinTimeStampOfNeighboursAhead (const CellLabel &cellLabel, const peano4::datamanagement::FaceEnumerator< FaceLabel > &faceLabelEnumerator) |
Similar to getMinTimeStampOfNeighbours(), but we minimise only over those neighbours that are actually ahead. | |
template<typename CellLabel , typename FaceLabel > | |
bool | runTimeStepOnCell (const CellLabel &cellLabel, const peano4::datamanagement::FaceEnumerator< FaceLabel > &faceLabelEnumerator, double globalMinTimeStamp) |
Determine whether to run a time step on a cell by analysing the neighbouring cells' timestamp. | |
template<typename CellLabel , typename FaceLabel > | |
double | removeTimeStepAccumulationErrorsFromCell (const CellLabel &cellLabel, const peano4::datamanagement::FaceEnumerator< FaceLabel > &faceLabelEnumerator, double timeStepSize) |
Remove accumulation errors from cell time stamps. | |
std::pair< double, double > | getInterpolationWeights (double oldTimeStampOnFace, double newTimeStampOnFace, double cellTimeStamp) |
double | discretiseAndTruncateTimeStepSizes (double cellTimeStepSize, double maxGlobalTimeStepSize, int discretisationStepsSize) |
Discretise (bucket) time step sizes and truncate it. | |
tarch::tests::TestCase * | getUnitTests () |
Please destroy after usage. | |
void | setDefaultLogStatements () |
template<class... Args> | |
auto | volumeIndex (Args... args) |
Variables | |
bool | havenumpy = False |
bool | havempmath = False |
bool | havesympy = False |
bool | havematplotlib = False |
For the generic kernels that I use here most of the time.
|
strong |
Enumerator | |
---|---|
Long_double | |
Double | |
Single | |
Float | |
Half | |
Float16_t | |
FP16 | |
Bfloat | |
Bfloat16_t | |
BF16 | |
Custom |
Definition at line 6 of file PrecisionControl.h.
|
strong |
Enumerator | |
---|---|
Keep | |
Refine | |
Erase |
Definition at line 13 of file RefinementControl.h.
double exahype2::discretiseAndTruncateTimeStepSizes | ( | double | cellTimeStepSize, |
double | maxGlobalTimeStepSize, | ||
int | discretisationStepsSize ) |
Discretise (bucket) time step sizes and truncate it.
This routine is used by any local time stepping. The idea is that we first mimick subcycling: Let there be a global max time step size. We assume this one arises on the coarsest mesh level. So patches either do this time step or they do a time step that is \( 3^{-k} \) that size.
We expect a min time step size that we use globally. We find the biggest \( discretisationSteps^k \cdot minGlobalTimeStepSize < cellTimeStepSize \) value through k which still meets the stability of cellTimeStepSize. We then return this value.
If the eigenvalues become very small within a cell, we end up with huge time step sizes. This should not happen. So I expect the global time step size (largest value) and truncate the time step size in any case by this one.
I use the global minimal time step size to kick off the analysis. This fails if the admissible global time step size shrinks over time. Therefore, the cell's time step size can be smaller than the globally admissible time step size. It simply means that the global time step size is shrinking and that the argument we get is lagging behind as we haven't finished the current time step yet.
discretisationSteps | Pass in zero to allow a totally anarchic time stepping. Use one to construct subcycling without a re-adoption of the time step sizes or something negative to switch the bucketing off. |
maxGlobalTimeStepSize | Maximum global time step size (of previous time step). I use this one to truncate too big time step sizes. Overall, I expect the time step size not to grow by more than 10 percent. |
cellTimeStepSize | Time step size the patch would like to pick. |
Definition at line 30 of file TimeStepping.cpp.
References _log, tarch::la::greater(), and logDebug.
exahype2::PrecisionCommand exahype2::getDefaultPrecisionCommand | ( | ) |
The default is double as this is the highest precision available per default.
Definition at line 3 of file PrecisionControl.cpp.
References Double.
exahype2::RefinementCommand exahype2::getDefaultRefinementCommand | ( | ) |
The default is coarsen as this is the lowest priority command.
Definition at line 8 of file RefinementControl.cpp.
References Erase.
std::pair< double, double > exahype2::getInterpolationWeights | ( | double | oldTimeStampOnFace, |
double | newTimeStampOnFace, | ||
double | cellTimeStamp ) |
I'm afraid of accumulation errors in the time stamps for the small cells which might end up lacking behind or running ahead. I can recognise such situations by very small weights for the old time snapshot. However, I don't fix it here. For fixing such a divergence, I rely on an explicit cleanup later on.
cellTimeStamp | This is an in-out parameter, as we can adopt the stamp size to avoid the accummulation of rounding errors. |
Definition at line 8 of file TimeStepping.cpp.
References _log, assertion4, assertion5, tarch::la::equals(), tarch::la::greaterEquals(), logDebug, and tarch::la::smallerEquals().
double exahype2::getMinTimeStampOfNeighboursAhead | ( | const CellLabel & | cellLabel, |
const peano4::datamanagement::FaceEnumerator< FaceLabel > & | faceLabelEnumerator ) |
Similar to getMinTimeStampOfNeighbours(), but we minimise only over those neighbours that are actually ahead.
If no neighbour is ahead or one lags behind, we return the time stamp of cellLabel.
Local timestepping codes can run into situations where the eigenvalue per cell is zero. This means that nothing happens in such cell. Therefore, the cell cannot advance in time. We don't know how far we can/should march. In this case, ExaHyPE offers two strategies: We can use the global admissible time step size, i.e. the global maximum eigenvalue, to determine a time step size; or we can see whether one of the neighbours is ahead and catch up.
The former method leads to a staircase pattern, as some cells where nothing happens race forward in time. A description of this behaviour is found in the Python routine referenced below.
I've seen multiple cases where
Definition at line 61 of file TimeStepping.h.
References assertion, tarch::la::greater(), and tarch::la::smaller().
tarch::tests::TestCase * exahype2::getUnitTests | ( | ) |
Please destroy after usage.
Definition at line 18 of file UnitTests.cpp.
References tarch::tests::TreeTestCaseCollection::addTestCase().
Referenced by main(), and runTests().
double exahype2::removeTimeStepAccumulationErrorsFromCell | ( | const CellLabel & | cellLabel, |
const peano4::datamanagement::FaceEnumerator< FaceLabel > & | faceLabelEnumerator, | ||
double | timeStepSize ) |
Remove accumulation errors from cell time stamps.
If we add time step sizes to the time stamp over and over again, it is very likely that the time stamps at resolution boundaries do not match at one point. If we use subcycling, 3xdt/3 usually does not equal the dt of a big cell. So it makes sense to amend the time step sizes slightly to help us to synchronise time stamps between cells, i.e. to avoid that they are off by a tiny bit and hence mess up the time stepping.
So what I do first of all is to check if the current (update) cell time stamp does equal a neighbour. If there are multiple of matching neighbours, I pick the one with the biggest time stamp. This check for equality is a double precision check which should use relative quantities, as time stamps can be arbitrarily large. So once I find a matching time stamp, I return this time stamp rather than the current time step size and, hence, sync the current time step size with the neighbours. This can mean that I reduce or increase the time step size slightly, i.e. I assume that enough slack is built into the chosen time step size such that a tiny increase does not blow up the result.
If two time stamps are equal depends on the magnutide of the time step size. It does not matter what the time stamps are, as any "rounding" decision should be time translation invariant. However, if I have a large time step size, then I'd be happy to alter it more rigorously than for a stiff problem with tiny time step sizes. Overall, I accept around one percent of the time step sizes as acceptable alteration of the outcome.
If we have subcycling, then we know that timeStepSize is never zero, as we use the largest (original) eigenvalue within the system and derive the levels' time step sizes from there. Things are different with local time stepping, where each cell can have its own time step size. If a cell has a size of zero, then we always should derive the admissible dt from the neighbours.
timeStepSize | Time step size the code would wish to use |
Definition at line 200 of file TimeStepping.h.
References _log, assertion2, tarch::la::equals(), tarch::la::greaterEquals(), logDebug, and tarch::la::NUMERICAL_ZERO_DIFFERENCE.
bool exahype2::runTimeStepOnCell | ( | const CellLabel & | cellLabel, |
const peano4::datamanagement::FaceEnumerator< FaceLabel > & | faceLabelEnumerator, | ||
double | globalMinTimeStamp ) |
Determine whether to run a time step on a cell by analysing the neighbouring cells' timestamp.
These timestamps are stored within the face labels. We update a cell if all the neighbours are at the same time stamp or ahead.
For some reason that I haven't understood completely yet, the above decision pattern can still lead to a deadlock where no cell in the global domain does advance in time. Which is really weird, as there always should be a global minimum. My guess is that something along the AMR boundaries does not work properly.
cellLabel |
Definition at line 132 of file TimeStepping.h.
References tarch::la::equals(), exahype2::internal::getMinTimeStampOfNeighbours(), and tarch::la::greaterEquals().
void exahype2::setDefaultLogStatements | ( | ) |
Definition at line 20 of file UserInterface.cpp.
References tarch::logging::LogFilter::addFilterListEntry(), tarch::logging::LogFilter::FilterListEntry::AlwaysOn, tarch::logging::LogFilter::FilterListEntry::AnyRank, tarch::logging::LogFilter::FilterListEntry::BlackListEntry, tarch::logging::LogFilter::clearFilterList(), tarch::logging::LogFilter::getInstance(), tarch::logging::LogFilter::FilterListEntry::TargetDebug, tarch::logging::LogFilter::FilterListEntry::TargetInfo, tarch::logging::LogFilter::FilterListEntry::TargetTrace, and tarch::logging::LogFilter::FilterListEntry::WhiteListEntry.
auto exahype2::volumeIndex | ( | Args... | args | ) |
Definition at line 54 of file VolumeIndex.h.
References exahype2::VolumeIndex< N, Args >::generate().
Referenced by exahype2::fd::tests::CCZ4KernelTest::AppleWithAppleTest(), exahype2::fv::musclhancock::internal::computeQonFace_LoopBody(), exahype2::fv::musclhancock::internal::computeTimeDerivative_LoopBody(), exahype2::fv::riemann::loopbodies::copySolution(), exahype2::fv::rusanov::loopbodies::copySolution(), exahype2::enumerator::AoSLexicographicEnumerator::operator()(), exahype2::enumerator::AoSoALexicographicEnumerator::operator()(), exahype2::enumerator::SoALexicographicEnumerator::operator()(), exahype2::dg::projectVolumetricDataOntoFaces(), exahype2::dg::projectVolumetricDataOntoFaces(), exahype2::fv::riemann::loopbodies::reduceMaxEigenvalue(), exahype2::fd::internal::reduceMaxEigenvalue_LoopBody(), exahype2::fv::rusanov::omp::internal::timeStepWithRusanovBatchedStateless(), exahype2::fv::rusanov::omp::internal::timeStepWithRusanovPatchwiseStateless(), and exahype2::fv::musclhancock::internal::updateSolutionwithNCPandSource_LoopBody().
bool exahype2.havematplotlib = False |
Definition at line 42 of file __init__.py.
bool exahype2.havempmath = False |
Definition at line 19 of file __init__.py.
bool exahype2.havenumpy = False |
Definition at line 10 of file __init__.py.
bool exahype2.havesympy = False |
Definition at line 32 of file __init__.py.