24 bool evaluateDifferentialSource,
25 bool evaluateAlgebraicSource,
26 bool copyOldTimeStepAndScaleWithTimeStepSize,
30 const TempDataEnumerator& fluxEnumerator,
31 const TempDataEnumerator& differentialSourceEnumerator,
32 const TempDataEnumerator& KODissipationEnumerator,
36 double* tempDifferentialSourceX,
37 double* tempDifferentialSourceY,
38 double* tempDifferentialSourceZ,
39 double* tempKODissipationX,
40 double* tempKODissipationY,
41 double* tempKODissipationZ
43 const bool evaluateKODissipation = KOSigma>0.0;
45 for (
int patchIndex=0; patchIndex<patchData.
numberOfCells; patchIndex++) {
46 const double timeStepSize = copyOldTimeStepAndScaleWithTimeStepSize ? patchData.
dt[patchIndex] : 1.0;
49 if ( Dimensions==3 and copyOldTimeStepAndScaleWithTimeStepSize ) {
50 for (
int x = 0; x < numberOfGridCellsPerPatchPerAxis; x++)
51 for (
int y = 0; y < numberOfGridCellsPerPatchPerAxis; y++)
52 for (
int z = 0; z < numberOfGridCellsPerPatchPerAxis; z++)
53 for (
int unknown=0; unknown<unknowns; unknown++) {
55 patchData.
QIn[patchIndex],
58 gridCellIndex3d(x,y,z),
60 patchData.
QOut[patchIndex],
65 else if (Dimensions==3 and not copyOldTimeStepAndScaleWithTimeStepSize){
66 for (
int x = 0; x < numberOfGridCellsPerPatchPerAxis; x++)
67 for (
int y = 0; y < numberOfGridCellsPerPatchPerAxis; y++)
68 for (
int z = 0; z < numberOfGridCellsPerPatchPerAxis; z++)
70 for (
int unknown=0; unknown<unknowns; unknown++) {
73 gridCellIndex3d(x,y,z),
75 patchData.
QOut[patchIndex],
81 else if (Dimensions==2 and copyOldTimeStepAndScaleWithTimeStepSize) {
82 for (
int x = 0; x < numberOfGridCellsPerPatchPerAxis; x++)
83 for (
int y = 0; y < numberOfGridCellsPerPatchPerAxis; y++)
84 for (
int unknown=0; unknown<unknowns; unknown++) {
86 patchData.
QIn[patchIndex],
91 patchData.
QOut[patchIndex],
97 for (
int x = 0; x < numberOfGridCellsPerPatchPerAxis; x++)
98 for (
int y = 0; y < numberOfGridCellsPerPatchPerAxis; y++){
99 for (
int unknown=0; unknown<unknowns; unknown++) {
102 gridCellIndex2d(x,y),
104 patchData.
QOut[patchIndex],
113 if (Dimensions==2 and evaluateAlgebraicSource) {
114 for (
int x = 0; x < numberOfGridCellsPerPatchPerAxis; x++)
115 for (
int y = 0; y < numberOfGridCellsPerPatchPerAxis; y++) {
116 ::exahype2::fd::internal::addAlgebraicSourceTerm_LoopBody<Solver>(
117 patchData.
QIn[patchIndex],
122 gridCellIndex2d(x,y),
123 patchData.
t[patchIndex],
125 patchData.
QOut[patchIndex],
130 else if (Dimensions==3 and evaluateAlgebraicSource) {
131 for (
int x = 0; x < numberOfGridCellsPerPatchPerAxis; x++)
132 for (
int y = 0; y < numberOfGridCellsPerPatchPerAxis; y++)
133 for (
int z = 0; z < numberOfGridCellsPerPatchPerAxis; z++) {
134 ::exahype2::fd::internal::addAlgebraicSourceTerm_LoopBody<Solver>(
135 patchData.
QIn[patchIndex],
140 gridCellIndex3d(x,y,z),
141 patchData.
t[patchIndex],
143 patchData.
QOut[patchIndex],
150 if (evaluateFlux and Dimensions==2) {
151 for (
int x = 0; x < numberOfGridCellsPerPatchPerAxis; x++)
152 for (
int y = 0; y < numberOfGridCellsPerPatchPerAxis; y++) {
153 internal::computeFlux_LoopBody<Solver>(
154 patchData.
QIn[patchIndex],
159 gridCellIndex2d(x,y),
160 patchData.
t[patchIndex],
167 for (
int x = 0; x < numberOfGridCellsPerPatchPerAxis; x++)
168 for (
int y = 0; y < numberOfGridCellsPerPatchPerAxis; y++) {
169 internal::computeFlux_LoopBody<Solver>(
170 patchData.
QIn[patchIndex],
175 gridCellIndex2d(x,y),
176 patchData.
t[patchIndex],
183 for (
int x = 0; x < numberOfGridCellsPerPatchPerAxis; x++)
184 for (
int y = 0; y < numberOfGridCellsPerPatchPerAxis; y++)
185 for (
int unknown=0; unknown<unknowns; unknown++) {
188 tempFluxX, tempFluxY, tempFluxZ,
193 gridCellIndex2d(x,y),
196 *(patchData.
QOut + patchIndex),
201 else if (evaluateFlux and Dimensions==3) {
202 for (
int x = 0; x < numberOfGridCellsPerPatchPerAxis; x++)
203 for (
int y = 0; y < numberOfGridCellsPerPatchPerAxis; y++)
204 for (
int z = 0; z < numberOfGridCellsPerPatchPerAxis; z++) {
205 internal::computeFlux_LoopBody<Solver>(
206 patchData.
QIn[patchIndex],
211 gridCellIndex3d(x,y,z),
212 patchData.
t[patchIndex],
219 for (
int x = 0; x < numberOfGridCellsPerPatchPerAxis; x++)
220 for (
int y = 0; y < numberOfGridCellsPerPatchPerAxis; y++)
221 for (
int z = 0; z < numberOfGridCellsPerPatchPerAxis; z++) {
222 internal::computeFlux_LoopBody<Solver>(
223 patchData.
QIn[patchIndex],
228 gridCellIndex3d(x,y,z),
229 patchData.
t[patchIndex],
236 for (
int x = 0; x < numberOfGridCellsPerPatchPerAxis; x++)
237 for (
int y = 0; y < numberOfGridCellsPerPatchPerAxis; y++)
238 for (
int z = 0; z < numberOfGridCellsPerPatchPerAxis; z++) {
239 internal::computeFlux_LoopBody<Solver>(
240 patchData.
QIn[patchIndex],
245 gridCellIndex3d(x,y,z),
246 patchData.
t[patchIndex],
254 for (
int x = 0; x < numberOfGridCellsPerPatchPerAxis; x++)
255 for (
int y = 0; y < numberOfGridCellsPerPatchPerAxis; y++)
256 for (
int z = 0; z < numberOfGridCellsPerPatchPerAxis; z++)
257 for (
int unknown=0; unknown<unknowns; unknown++) {
259 tempFluxX, tempFluxY, tempFluxZ,
264 gridCellIndex3d(x,y,z),
267 *(patchData.
QOut + patchIndex),
274 if (evaluateDifferentialSource and Dimensions==2) {
275 for (
int x = 0; x < numberOfGridCellsPerPatchPerAxis; x++)
276 for (
int y = 0; y < numberOfGridCellsPerPatchPerAxis; y++) {
277 internal::computeDifferentialSourceTerm_LoopBody<Solver>(
278 patchData.
QIn[patchIndex],
283 gridCellIndex2d(x,y),
284 patchData.
t[patchIndex],
287 tempDifferentialSourceX,
292 for (
int x = 0; x < numberOfGridCellsPerPatchPerAxis; x++)
293 for (
int y = 0; y < numberOfGridCellsPerPatchPerAxis; y++) {
294 internal::computeDifferentialSourceTerm_LoopBody<Solver>(
295 patchData.
QIn[patchIndex],
300 gridCellIndex2d(x,y),
301 patchData.
t[patchIndex],
304 tempDifferentialSourceY,
309 for (
int x = 0; x < numberOfGridCellsPerPatchPerAxis; x++)
310 for (
int y = 0; y < numberOfGridCellsPerPatchPerAxis; y++)
311 for (
int unknown=0; unknown<unknowns; unknown++) {
313 tempDifferentialSourceX, tempDifferentialSourceY, tempDifferentialSourceZ,
318 gridCellIndex2d(x,y),
321 *(patchData.
QOut + patchIndex),
326 else if (evaluateDifferentialSource and Dimensions==3) {
327 for (
int x = 0; x < numberOfGridCellsPerPatchPerAxis; x++)
328 for (
int y = 0; y < numberOfGridCellsPerPatchPerAxis; y++)
329 for (
int z = 0; z < numberOfGridCellsPerPatchPerAxis; z++) {
330 internal::computeDifferentialSourceTerm_LoopBody<Solver>(
331 patchData.
QIn[patchIndex],
336 gridCellIndex3d(x,y,z),
337 patchData.
t[patchIndex],
340 tempDifferentialSourceX,
345 for (
int x = 0; x < numberOfGridCellsPerPatchPerAxis; x++)
346 for (
int y = 0; y < numberOfGridCellsPerPatchPerAxis; y++)
347 for (
int z = 0; z < numberOfGridCellsPerPatchPerAxis; z++) {
348 internal::computeDifferentialSourceTerm_LoopBody<Solver>(
349 patchData.
QIn[patchIndex],
354 gridCellIndex3d(x,y,z),
355 patchData.
t[patchIndex],
358 tempDifferentialSourceY,
363 for (
int x = 0; x < numberOfGridCellsPerPatchPerAxis; x++)
364 for (
int y = 0; y < numberOfGridCellsPerPatchPerAxis; y++)
365 for (
int z = 0; z < numberOfGridCellsPerPatchPerAxis; z++) {
366 internal::computeDifferentialSourceTerm_LoopBody<Solver>(
367 patchData.
QIn[patchIndex],
372 gridCellIndex3d(x,y,z),
373 patchData.
t[patchIndex],
376 tempDifferentialSourceZ,
381 for (
int x = 0; x < numberOfGridCellsPerPatchPerAxis; x++)
382 for (
int y = 0; y < numberOfGridCellsPerPatchPerAxis; y++)
383 for (
int z = 0; z < numberOfGridCellsPerPatchPerAxis; z++)
384 for (
int unknown=0; unknown<unknowns; unknown++) {
386 tempDifferentialSourceX, tempDifferentialSourceY, tempDifferentialSourceZ,
391 gridCellIndex3d(x,y,z),
394 *(patchData.
QOut + patchIndex),
401 if (evaluateKODissipation and Dimensions==2) {
402 for (
int x = 0; x < numberOfGridCellsPerPatchPerAxis; x++)
403 for (
int y = 0; y < numberOfGridCellsPerPatchPerAxis; y++) {
405 patchData.
QIn[patchIndex],
410 gridCellIndex2d(x,y),
411 patchData.
t[patchIndex],
418 for (
int x = 0; x < numberOfGridCellsPerPatchPerAxis; x++)
419 for (
int y = 0; y < numberOfGridCellsPerPatchPerAxis; y++) {
421 patchData.
QIn[patchIndex],
426 gridCellIndex2d(x,y),
427 patchData.
t[patchIndex],
434 for (
int x = 0; x < numberOfGridCellsPerPatchPerAxis; x++)
435 for (
int y = 0; y < numberOfGridCellsPerPatchPerAxis; y++)
436 for (
int unknown=0; unknown<unknowns; unknown++) {
438 KOSigma, tempKODissipationX, tempKODissipationY, tempKODissipationZ,
443 gridCellIndex2d(x,y),
446 *(patchData.
QOut + patchIndex),
451 else if (evaluateKODissipation and Dimensions==3) {
452 for (
int x = 0; x < numberOfGridCellsPerPatchPerAxis; x++)
453 for (
int y = 0; y < numberOfGridCellsPerPatchPerAxis; y++)
454 for (
int z = 0; z < numberOfGridCellsPerPatchPerAxis; z++) {
456 patchData.
QIn[patchIndex],
461 gridCellIndex3d(x,y,z),
462 patchData.
t[patchIndex],
469 for (
int x = 0; x < numberOfGridCellsPerPatchPerAxis; x++)
470 for (
int y = 0; y < numberOfGridCellsPerPatchPerAxis; y++)
471 for (
int z = 0; z < numberOfGridCellsPerPatchPerAxis; z++) {
473 patchData.
QIn[patchIndex],
478 gridCellIndex3d(x,y,z),
479 patchData.
t[patchIndex],
486 for (
int x = 0; x < numberOfGridCellsPerPatchPerAxis; x++)
487 for (
int y = 0; y < numberOfGridCellsPerPatchPerAxis; y++)
488 for (
int z = 0; z < numberOfGridCellsPerPatchPerAxis; z++) {
490 patchData.
QIn[patchIndex],
495 gridCellIndex3d(x,y,z),
496 patchData.
t[patchIndex],
503 for (
int x = 0; x < numberOfGridCellsPerPatchPerAxis; x++)
504 for (
int y = 0; y < numberOfGridCellsPerPatchPerAxis; y++)
505 for (
int z = 0; z < numberOfGridCellsPerPatchPerAxis; z++)
506 for (
int unknown=0; unknown<unknowns; unknown++) {
508 KOSigma, tempKODissipationX, tempKODissipationY, tempKODissipationZ,
513 gridCellIndex3d(x,y,z),
516 *(patchData.
QOut + patchIndex),