Peano
Loading...
Searching...
No Matches
LaxFriedrichs.h
Go to the documentation of this file.
1// This file is part of the ExaHyPE2 project. For conditions of distribution and
2// use, please see the copyright notice at www.peano-framework.org
3#pragma once
4
5
6#include <vector>
7
8#include "../DGUtils.h"
9#include "../Functors.h"
10
14#include "../CellIntegral.h"
15#include "../Riemann.h"
16
17#include "tarch/la/Vector.h"
19
22
23#if defined(GPUOffloadingOMP)
25#endif
26
27
28namespace exahype2 {
29 namespace dg {
30 namespace laxfriedrichs {
106 const tarch::la::Vector<Dimensions,double>& faceCentre,
108 double t,
109 double dt,
110 int order,
111 int unknowns,
112 int auxiliaryVariables,
113 int faceNumber,
114 const double* __restrict__ quadraturePoints,
115 bool useFlux,
116 bool useNcp,
117 const double* __restrict__ projectedValues,
118 double* __restrict__ solution
119 );
120
121
129 const int order,
130 const int unknowns,
131 const int auxiliaryVariables,
132 Flux flux,
133 NonConservativeProduct nonConservativeProduct,
134 Source source,
135 PointSources pointSources,
136 const double* __restrict__ QuadratureNodes1d,
137 const double* __restrict__ MassMatrixDiagonal1d,
138 const double* __restrict__ StiffnessMatrix1d,
139 const double* __restrict__ DerivativeOperator1d,
140 bool evaluateFlux,
141 bool evaluateNonconservativeProduct,
142 bool evaluateSource,
143 bool evaluatePointSources
144 ) {
146 cellData,
147 order, unknowns, auxiliaryVariables,
148 flux, nonConservativeProduct, source, pointSources,
149 QuadratureNodes1d,
150 MassMatrixDiagonal1d,
151 StiffnessMatrix1d,
152 DerivativeOperator1d,
153 evaluateFlux, evaluateNonconservativeProduct, evaluateSource, evaluatePointSources
154 );
155 }
156
157
165 const int order,
166 const int unknowns,
167 const int auxiliaryVariables,
168 const double* __restrict__ MassMatrixDiagonal1d
169 ) {
171 cellData,
172 order, unknowns, auxiliaryVariables, MassMatrixDiagonal1d
173 );
174 }
175
176
183 const double* const __restrict__ faceQLeft,
184 const double* const __restrict__ faceQRight,
185 const double* const __restrict__ faceQBottom,
186 const double* const __restrict__ faceQUp,
187 int order,
188 int unknowns,
189 const int auxiliaryVariables,
190 const tarch::la::Vector<2,double>& cellSize,
191 const double* const __restrict__ BasisFunctionValuesLeft,
192 const double* __restrict__ MassMatrixDiagonal1d,
193 double* __restrict__ cellQ
194 ) {
196 faceQLeft, faceQRight, faceQBottom, faceQUp,
197 order, unknowns, auxiliaryVariables,
198 cellSize,
199 BasisFunctionValuesLeft,
200 MassMatrixDiagonal1d,
201 cellQ
202 );
203 }
204
205
212 const double* const __restrict__ faceQLeft,
213 const double* const __restrict__ faceQRight,
214 const double* const __restrict__ faceQBottom,
215 const double* const __restrict__ faceQUp,
216 const double* const __restrict__ faceQFront,
217 const double* const __restrict__ faceQBack,
218 int order,
219 int unknowns,
220 const int auxiliaryVariables,
221 const tarch::la::Vector<3,double>& cellSize,
222 const double* const __restrict__ BasisFunctionValuesLeft,
223 const double* __restrict__ MassMatrixDiagonal1d,
224 double* __restrict__ cellQ
225 ) {
227 faceQLeft, faceQRight, faceQBottom, faceQUp, faceQFront, faceQBack,
228 order, unknowns, auxiliaryVariables,
229 cellSize,
230 BasisFunctionValuesLeft,
231 MassMatrixDiagonal1d,
232 cellQ
233 );
234 }
235
236
237 template <
238 typename Solver,
239 int order,
240 int unknowns,
241 int auxiliaryVariables
242 >
245 bool evaluateFlux,
246 bool evaluateNonconservativeProduct,
247 bool evaluateSource,
248 bool evaluatePointSources
249 ) {
250 ::exahype2::dg::cellIntegral_patchwise_in_situ_GaussLegendre<Solver,order,unknowns,auxiliaryVariables>(
251 cellData,
252 evaluateFlux,
253 evaluateNonconservativeProduct,
254 evaluateSource,
255 evaluatePointSources
256 );
257 }
258 }
259 }
260}
261
Definition dg.py:1
static void cellIntegral_patchwise_in_situ_GaussLegendre_functors(::exahype2::CellData< double, double > &cellData, const int order, const int unknowns, const int auxiliaryVariables, Flux flux, NonConservativeProduct nonConservativeProduct, Source source, PointSources pointSources, const double *__restrict__ QuadratureNodes1d, const double *__restrict__ MassMatrixDiagonal1d, const double *__restrict__ StiffnessMatrix1d, const double *__restrict__ DerivativeOperator1d, bool evaluateFlux, bool evaluateNonconservativeProduct, bool evaluateSource, bool evaluatePointSources)
Delegate to generic implementation in parent directory.
void cellIntegral_patchwise_in_situ_GaussLegendre(::exahype2::CellData< double, double > &cellData, bool evaluateFlux, bool evaluateNonconservativeProduct, bool evaluateSource, bool evaluatePointSources)
static void multiplyWithInvertedMassMatrix_GaussLegendre(::exahype2::CellData< double, double > &cellData, const int order, const int unknowns, const int auxiliaryVariables, const double *__restrict__ MassMatrixDiagonal1d)
Delegate to generic implementation.
static void integrateOverRiemannSolutionsAndAddToVolume_GaussLegendre(const double *const __restrict__ faceQLeft, const double *const __restrict__ faceQRight, const double *const __restrict__ faceQBottom, const double *const __restrict__ faceQUp, int order, int unknowns, const int auxiliaryVariables, const tarch::la::Vector< 2, double > &cellSize, const double *const __restrict__ BasisFunctionValuesLeft, const double *__restrict__ MassMatrixDiagonal1d, double *__restrict__ cellQ)
Delegate to generic implementation.
void solveRiemannProblem_pointwise_in_situ(::exahype2::dg::Flux flux, ::exahype2::dg::NonConservativeProduct ncp, const tarch::la::Vector< Dimensions, double > &faceCentre, const tarch::la::Vector< Dimensions, double > &cellSize, double t, double dt, int order, int unknowns, int auxiliaryVariables, int faceNumber, const double *__restrict__ quadraturePoints, bool useFlux, bool useNcp, const double *__restrict__ projectedValues, double *__restrict__ solution)
Solve Riemann problem on face.
void multiplyWithInvertedMassMatrix_GaussLegendre(::exahype2::CellData< double, double > &cellData, const int order, const int unknowns, const int auxiliaryVariables, const double *__restrict__ MassMatrixDiagonal1d)
Final step of DG algorithm.
std::function< std::vector< PointSource >(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &cellCentre, const tarch::la::Vector< Dimensions, double > &h, double t, double dt) > PointSources
This is the only routine within the DG framework which accepts the dimensions of the underlying cell ...
Definition Functors.h:87
std::function< void(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &x, double t, double dt, double *__restrict__ S) > Source
Source functor.
Definition Functors.h:75
void cellIntegral_patchwise_in_situ_GaussLegendre_functors(::exahype2::CellData< double, double > &cellData, const int order, const int unknowns, const int auxiliaryVariables, Flux flux, NonConservativeProduct nonconservativeProduct, Source source, PointSources pointSources, const double *__restrict__ QuadratureNodes1d, const double *__restrict__ MassMatrixDiagonal1d, const double *__restrict__ StiffnessMatrix1d, const double *__restrict__ DerivativeOperator1d, bool evaluateFlux, bool evaluateNonconservativeProduct, bool evaluateSource, bool evaluatePointSources)
std::function< void(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &x, double t, double dt, int normal, double *__restrict__ F) > Flux
Flux functor.
Definition Functors.h:44
std::function< void(const double *__restrict__ Q, const double *__restrict__ dQdx, const tarch::la::Vector< Dimensions, double > &x, double t, double dt, int normal, double *__restrict__ F) > NonConservativeProduct
Definition Functors.h:54
void integrateOverRiemannSolutionsAndAddToVolume_GaussLegendre(const double *const __restrict__ faceQLeft, const double *const __restrict__ faceQRight, const double *const __restrict__ faceQBottom, const double *const __restrict__ faceQUp, int order, int unknowns, const int auxiliaryVariables, const tarch::la::Vector< 2, double > &cellSize, const double *const __restrict__ BasisFunctionValuesLeft, const double *__restrict__ MassMatrixDiagonal1d, double *__restrict__ cellQ)
Given a numerical flux at the various faces, this computes and adds the Riemann integral of this flux...
This file is part of the ExaHyPE 2 project within Peano 4.
Definition __init__.py:1
Representation of a number of cells which contains all information that's required to process the sto...
Definition CellData.h:78
Simple vector class.
Definition Vector.h:159