Peano 4
Loading...
Searching...
No Matches
Generic.cpp
Go to the documentation of this file.
1#include "Generic.h"
2
4#include "tarch/logging/Log.h"
6
7#include "peano4/utils/Loop.h"
8
10
12 double Q[],
13 int unknowns
14) {
15 std::string result = "(" + std::to_string(Q[0]);
16 for (int i=1; i<unknowns; i++) result += "," + std::to_string(Q[i]);
17 result += ")";
18 return result;
19};
20
22 const double* __restrict__ UIn,
23 int unknowns,
24 int auxiliaryVariables,
25 int order,
26 const std::string& location
27) {
28 const int numberOfNodesPerAxisInPatch = order + 1;
29 dfor (k,numberOfNodesPerAxisInPatch) {
30 int index = peano4::utils::dLinearised(k,numberOfNodesPerAxisInPatch) * (unknowns+auxiliaryVariables);
31 for (int i=0; i<unknowns+auxiliaryVariables; i++) {
32 nonCriticalAssertion6( std::isfinite(UIn[index+i]), unknowns, auxiliaryVariables, order, k, i, location );
33 }
34 }
35}
36
38 const double* __restrict__ QIn,
39 int unknowns,
40 int auxiliaryVariables,
41 int order,
42 const std::string& location
43) {
44 const int numberOfNodesPerAxisInPatch = order + 1;
45 dfor (k,numberOfNodesPerAxisInPatch) {
46 int index = peano4::utils::dLinearised(k,numberOfNodesPerAxisInPatch) * (unknowns+auxiliaryVariables);
47 for (int i=0; i<numberOfNodesPerAxisInPatch*(unknowns+auxiliaryVariables); i++) {
48 nonCriticalAssertion6( std::isfinite(QIn[index+i]), unknowns, auxiliaryVariables, order, k, i, location );
49 }
50 }
51}
52
53//#if defined(GPUOffloadingOMP)
54//#pragma omp declare target
55//#endif
56//void exahype2::aderdg::copyPatch(
57// const double* __restrict__ QIn,
58// double* __restrict__ QOut,
59// int unknowns,
60// int auxiliaryVariables,
61// int order
62//) {
63// const int numberOfNodesPerAxisInPatch = order + 1;
64// dfor (k,numberOfNodesPerAxisInPatch) {
65// int index = peano4::utils::dLinearised(k,numberOfNodesPerAxisInPatch) * (unknowns+auxiliaryVariables);
66// for (int i=0; i<unknowns+auxiliaryVariables; i++) {
67// QOut[ index + i ] = QIn[index + 1];
68// }
69// }
70//}
71//#if defined(GPUOffloadingOMP)
72//#pragma omp end declare target
73//#endif
we integrate over each cell and then take the sum across each of the cells We also consider the terms that enter the f$ k
#define dfor(counter, max)
d-dimensional Loop
Definition Loop.h:308
#define nonCriticalAssertion6(expr, param0, param1, param2, param3, param4, param5)
void validatePatch(const double *__restrict__ UIn, int unknowns, int auxiliaryVariables, int order, const std::string &location="")
Just runs over the patch and ensures that no entry is non or infinite.
Definition Generic.cpp:21
std::string plotNode(double Q[], int unknowns)
Render a DG nodes components as a string.
Definition Generic.cpp:11
void validateSpacetimePatch(const double *__restrict__ QIn, int unknowns, int auxiliaryVariables, int order, const std::string &location="")
Just runs over the space-time patch and ensures that no entry is non or infinite.
Definition Generic.cpp:37
CPUGPUMethod int dLinearised(const tarch::la::Vector< Dimensions, int > &counter, int max)
Map d-dimensional vector onto integer index.
Definition Loop.cpp:106