Peano 4
Loading...
Searching...
No Matches
maxScaledEigenvalue.cpph
Go to the documentation of this file.
1
14/*
15 * This function used to return the stable time step size directly but now returns the sum of the maximal eigenvalues
16 * scaled with the cell sizes I've chosen to do this because the eigenvalue can be required by some applications calling
17 * this and it saves some redundant computations since the actual time step size may be only required once for the
18 * entire application (MML)
19 */
20#include "exahype2/dg/DGUtils.h"
21#include "peano4/utils/Loop.h"
22
23template <typename SolverType, typename T>
25 SolverType& solver,
26 const T* const luh,
29 const double t,
30 const double dt
31) {
32 constexpr int NumberOfData = SolverType::NumberOfUnknowns + SolverType::NumberOfAuxiliaryVariables;
33 constexpr int BasisSize = SolverType::Order + 1;
34
35 const double invDx[2] = {1.0 / dx[0], 1.0 / dx[1]};
36
37 double maxEigenvalue = 0.0;
38 for (int i = 0; i < BasisSize; i++) {
39 for (int j = 0; j < BasisSize; j++) {
40
41 int linearisedIndex = i + BasisSize * j;
43
44 double denominator = 0.0;
45 for (int d = 0; d < Dimensions; d++) {
46 denominator
47 += solver.maxEigenvalue(
48 &luh[linearisedIndex * NumberOfData],
50 cellCentre,
51 dx,
52 index, // index
53 SolverType::Order,
54 solver.QuadraturePoints1d
55 ), // faceCentre
56 dx,
57 t,
58 dt,
59 d
60 )
61 * invDx[d];
62 }
63 maxEigenvalue = std::max(maxEigenvalue, denominator);
64 }
65 }
66 return maxEigenvalue;
67}
And from this we can write down f$ nabla phi_i nabla phi_i dx but since we are constructing matrix let s investigate the f$ j
we integrate over each cell and then take the sum across each of the cells We also consider the terms that enter the f$ so we are integrating with f$ phi_k phi_k dx
tarch::la::Vector< 2, double > getQuadraturePoint(const tarch::la::Vector< 2, double > &cellCentre, const tarch::la::Vector< 2, double > &cellSize, const tarch::la::Vector< 2, int > &index, int polynomialOrder, const double *__restrict__ quadraturePoints)
Construct location of a quadrature point.
Definition DGUtils.cpp:38
double maxScaledEigenvalue(SolverType &solver, const T *const luh, const tarch::la::Vector< Dimensions, double > &cellCentre, const tarch::la::Vector< Dimensions, double > &dx, const double t, const double dt)
This file is part of the ExaHyPE project.
This is a single successor class for the idx2, idx3, idx4, idx5, idx6 classes.
Definition KernelUtils.h:62
Simple vector class.
Definition Vector.h:134