353 NumberOfFiniteVolumesPerAxisPerPatch + 1, NumberOfFiniteVolumesPerAxisPerPatch + 1
369 bottomLeftCellN1(0)++;
371 bottomLeftCellN2(1)++;
374 bottomRightCellN1(0)--;
376 bottomRightCellN2(1)++;
380 topRightCell, NumberOfFiniteVolumesPerAxisPerPatch + 2
384 bottomLeftCell, NumberOfFiniteVolumesPerAxisPerPatch + 2
387 bottomRightCell, NumberOfFiniteVolumesPerAxisPerPatch + 2
391 topLeftCellN1, NumberOfFiniteVolumesPerAxisPerPatch + 2
394 topLeftCellN2, NumberOfFiniteVolumesPerAxisPerPatch + 2
398 topRightCellN1, NumberOfFiniteVolumesPerAxisPerPatch + 2
401 topRightCellN2, NumberOfFiniteVolumesPerAxisPerPatch + 2
405 bottomLeftCellN1, NumberOfFiniteVolumesPerAxisPerPatch + 2
408 bottomLeftCellN2, NumberOfFiniteVolumesPerAxisPerPatch + 2
412 bottomRightCellN1, NumberOfFiniteVolumesPerAxisPerPatch + 2
415 bottomRightCellN2, NumberOfFiniteVolumesPerAxisPerPatch + 2
418 for (
int i = 0; i < NumberOfUnknowns + NumberOfAuxiliaryVariables; i++) {
420 Q[(topLeftCellSerialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i]
422 * (Q[(topLeftCellN1Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i] + Q[(topLeftCellN2Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i]);
423 Q[(topRightCellSerialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i]
425 * (Q[(topRightCellN1Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i] + Q[(topRightCellN2Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i]);
427 Q[(bottomLeftCellSerialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i]
429 * (Q[(bottomLeftCellN1Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i] + Q[(bottomLeftCellN2Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i]);
431 Q[(bottomRightCellSerialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i]
433 * (Q[(bottomRightCellN1Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i] + Q[(bottomRightCellN2Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i]);
437 for (
int i = 1; i < NumberOfFiniteVolumesPerAxisPerPatch + 1; i++) {
443 backLeftCell, NumberOfFiniteVolumesPerAxisPerPatch + 2
446 backLeftCellN1, NumberOfFiniteVolumesPerAxisPerPatch + 2
449 backLeftCellN2, NumberOfFiniteVolumesPerAxisPerPatch + 2
457 backRightCell, NumberOfFiniteVolumesPerAxisPerPatch + 2
460 backRightCellN1, NumberOfFiniteVolumesPerAxisPerPatch + 2
463 backRightCellN2, NumberOfFiniteVolumesPerAxisPerPatch + 2
471 backTopCell, NumberOfFiniteVolumesPerAxisPerPatch + 2
474 backTopCellN1, NumberOfFiniteVolumesPerAxisPerPatch + 2
477 backTopCellN2, NumberOfFiniteVolumesPerAxisPerPatch + 2
485 backBottomCell, NumberOfFiniteVolumesPerAxisPerPatch + 2
488 backBottomCellN1, NumberOfFiniteVolumesPerAxisPerPatch + 2
491 backBottomCellN2, NumberOfFiniteVolumesPerAxisPerPatch + 2
499 frontLeftCell, NumberOfFiniteVolumesPerAxisPerPatch + 2
502 frontLeftCellN1, NumberOfFiniteVolumesPerAxisPerPatch + 2
505 frontLeftCellN2, NumberOfFiniteVolumesPerAxisPerPatch + 2
509 NumberOfFiniteVolumesPerAxisPerPatch + 1, i, NumberOfFiniteVolumesPerAxisPerPatch + 1
512 NumberOfFiniteVolumesPerAxisPerPatch, i, NumberOfFiniteVolumesPerAxisPerPatch + 1
515 NumberOfFiniteVolumesPerAxisPerPatch + 1, i, NumberOfFiniteVolumesPerAxisPerPatch
519 frontRightCell, NumberOfFiniteVolumesPerAxisPerPatch + 2
522 frontRightCellN1, NumberOfFiniteVolumesPerAxisPerPatch + 2
525 frontRightCellN2, NumberOfFiniteVolumesPerAxisPerPatch + 2
529 i, NumberOfFiniteVolumesPerAxisPerPatch + 1, NumberOfFiniteVolumesPerAxisPerPatch + 1
532 i, NumberOfFiniteVolumesPerAxisPerPatch + 1, NumberOfFiniteVolumesPerAxisPerPatch
535 i, NumberOfFiniteVolumesPerAxisPerPatch, NumberOfFiniteVolumesPerAxisPerPatch + 1
539 frontTopCell, NumberOfFiniteVolumesPerAxisPerPatch + 2
542 frontTopCellN1, NumberOfFiniteVolumesPerAxisPerPatch + 2
545 frontTopCellN2, NumberOfFiniteVolumesPerAxisPerPatch + 2
553 frontBottomCell, NumberOfFiniteVolumesPerAxisPerPatch + 2
556 frontBottomCellN1, NumberOfFiniteVolumesPerAxisPerPatch + 2
559 frontBottomCellN2, NumberOfFiniteVolumesPerAxisPerPatch + 2
567 bottomLeftCell, NumberOfFiniteVolumesPerAxisPerPatch + 2
570 bottomLeftCellN1, NumberOfFiniteVolumesPerAxisPerPatch + 2
573 bottomLeftCellN2, NumberOfFiniteVolumesPerAxisPerPatch + 2
581 bottomRightCell, NumberOfFiniteVolumesPerAxisPerPatch + 2
584 bottomRightCellN1, NumberOfFiniteVolumesPerAxisPerPatch + 2
587 bottomRightCellN2, NumberOfFiniteVolumesPerAxisPerPatch + 2
595 topLeftCell, NumberOfFiniteVolumesPerAxisPerPatch + 2
598 topLeftCellN1, NumberOfFiniteVolumesPerAxisPerPatch + 2
601 topLeftCellN2, NumberOfFiniteVolumesPerAxisPerPatch + 2
605 NumberOfFiniteVolumesPerAxisPerPatch + 1, NumberOfFiniteVolumesPerAxisPerPatch + 1, i
608 NumberOfFiniteVolumesPerAxisPerPatch, NumberOfFiniteVolumesPerAxisPerPatch + 1, i
611 NumberOfFiniteVolumesPerAxisPerPatch + 1, NumberOfFiniteVolumesPerAxisPerPatch, i
615 topRightCell, NumberOfFiniteVolumesPerAxisPerPatch + 2
618 topRightCellN1, NumberOfFiniteVolumesPerAxisPerPatch + 2
621 topRightCellN2, NumberOfFiniteVolumesPerAxisPerPatch + 2
624 for (
int j = 0; j < NumberOfAuxiliaryVariables + NumberOfUnknowns; j++) {
625 Q[(backLeftCellSerialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j]
627 * (Q[(backLeftCellN1Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j] + Q[(backLeftCellN2Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j]);
629 Q[(backRightCellSerialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j]
631 * (Q[(backRightCellN1Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j] + Q[(backRightCellN2Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j]);
633 Q[(backTopCellSerialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j]
635 * (Q[(backTopCellN1Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j] + Q[(backTopCellN2Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j]);
637 Q[(backBottomCellSerialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j]
639 * (Q[(backBottomCellN1Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j] + Q[(backBottomCellN2Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j]);
641 Q[(frontLeftCellSerialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j]
643 * (Q[(frontLeftCellN1Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j] + Q[(frontLeftCellN2Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j]);
645 Q[(frontRightCellSerialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j]
647 * (Q[(frontRightCellN1Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j] + Q[(frontRightCellN2Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j]);
649 Q[(frontTopCellSerialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j]
651 * (Q[(frontTopCellN1Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j] + Q[(frontTopCellN2Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j]);
653 Q[(frontBottomCellSerialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j]
655 * (Q[(frontBottomCellN1Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j] + Q[(frontBottomCellN2Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j]);
657 Q[(bottomLeftCellSerialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j]
659 * (Q[(bottomLeftCellN1Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j] + Q[(bottomLeftCellN2Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j]);
661 Q[(bottomRightCellSerialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j]
663 * (Q[(bottomRightCellN1Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j] + Q[(bottomRightCellN2Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j]);
665 Q[(topLeftCellSerialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j]
667 * (Q[(topLeftCellN1Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j] + Q[(topLeftCellN2Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j]);
669 Q[(topRightCellSerialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j]
671 * (Q[(topRightCellN1Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j] + Q[(topRightCellN2Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + j]);
678 NumberOfFiniteVolumesPerAxisPerPatch + 1, NumberOfFiniteVolumesPerAxisPerPatch + 1, 0
684 0, NumberOfFiniteVolumesPerAxisPerPatch + 1, NumberOfFiniteVolumesPerAxisPerPatch + 1
687 NumberOfFiniteVolumesPerAxisPerPatch + 1,
688 NumberOfFiniteVolumesPerAxisPerPatch + 1,
689 NumberOfFiniteVolumesPerAxisPerPatch + 1
693 NumberOfFiniteVolumesPerAxisPerPatch + 1, 0, NumberOfFiniteVolumesPerAxisPerPatch + 1
697 topLeftBackCellN1(0)++;
699 topLeftBackCellN2(1)--;
701 topLeftBackCellN3(2)++;
704 topRightBackCellN1(0)--;
706 topRightBackCellN2(1)--;
708 topRightBackCellN3(2)++;
711 bottomLeftBackCellN1(0)++;
713 bottomLeftBackCellN2(1)++;
715 bottomLeftBackCellN3(2)++;
718 bottomRightBackCellN1(0)--;
720 bottomRightBackCellN2(1)++;
722 bottomRightBackCellN3(2)++;
725 topLeftFrontCellN1(0)++;
727 topLeftFrontCellN2(1)--;
729 topLeftFrontCellN3(2)--;
732 topRightFrontCellN1(0)--;
734 topRightFrontCellN2(1)--;
736 topRightFrontCellN3(2)--;
743 bottomRightFrontCellN1(0)--;
745 bottomRightFrontCellN2(1)++;
747 bottomRightFrontCellN3(2)--;
750 topLeftBackCell, NumberOfFiniteVolumesPerAxisPerPatch + 2
753 topRightBackCell, NumberOfFiniteVolumesPerAxisPerPatch + 2
756 bottomLeftBackCell, NumberOfFiniteVolumesPerAxisPerPatch + 2
759 bottomRightBackCell, NumberOfFiniteVolumesPerAxisPerPatch + 2
763 topLeftFrontCell, NumberOfFiniteVolumesPerAxisPerPatch + 2
766 topRightFrontCell, NumberOfFiniteVolumesPerAxisPerPatch + 2
769 bottomLeftFrontCell, NumberOfFiniteVolumesPerAxisPerPatch + 2
772 bottomRightFrontCell, NumberOfFiniteVolumesPerAxisPerPatch + 2
776 topLeftBackCellN1, NumberOfFiniteVolumesPerAxisPerPatch + 2
779 topLeftBackCellN2, NumberOfFiniteVolumesPerAxisPerPatch + 2
782 topLeftBackCellN3, NumberOfFiniteVolumesPerAxisPerPatch + 2
786 topRightBackCellN1, NumberOfFiniteVolumesPerAxisPerPatch + 2
789 topRightBackCellN2, NumberOfFiniteVolumesPerAxisPerPatch + 2
792 topRightBackCellN3, NumberOfFiniteVolumesPerAxisPerPatch + 2
796 bottomLeftBackCellN1, NumberOfFiniteVolumesPerAxisPerPatch + 2
799 bottomLeftBackCellN2, NumberOfFiniteVolumesPerAxisPerPatch + 2
802 bottomLeftBackCellN3, NumberOfFiniteVolumesPerAxisPerPatch + 2
806 bottomRightBackCellN1, NumberOfFiniteVolumesPerAxisPerPatch + 2
809 bottomRightBackCellN2, NumberOfFiniteVolumesPerAxisPerPatch + 2
812 bottomRightBackCellN3, NumberOfFiniteVolumesPerAxisPerPatch + 2
816 topLeftFrontCellN1, NumberOfFiniteVolumesPerAxisPerPatch + 2
819 topLeftFrontCellN2, NumberOfFiniteVolumesPerAxisPerPatch + 2
822 topLeftFrontCellN3, NumberOfFiniteVolumesPerAxisPerPatch + 2
826 topRightFrontCellN1, NumberOfFiniteVolumesPerAxisPerPatch + 2
829 topRightFrontCellN2, NumberOfFiniteVolumesPerAxisPerPatch + 2
832 topRightFrontCellN3, NumberOfFiniteVolumesPerAxisPerPatch + 2
836 bottomLeftFrontCellN1, NumberOfFiniteVolumesPerAxisPerPatch + 2
839 bottomLeftFrontCellN2, NumberOfFiniteVolumesPerAxisPerPatch + 2
842 bottomLeftFrontCellN3, NumberOfFiniteVolumesPerAxisPerPatch + 2
846 bottomRightFrontCellN1, NumberOfFiniteVolumesPerAxisPerPatch + 2
849 bottomRightFrontCellN2, NumberOfFiniteVolumesPerAxisPerPatch + 2
852 bottomRightFrontCellN3, NumberOfFiniteVolumesPerAxisPerPatch + 2
855 for (
int i = 0; i < NumberOfUnknowns + NumberOfAuxiliaryVariables; i++) {
857 Q[(topLeftBackCellSerialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i]
859 * (Q[(topLeftBackCellN1Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i] + Q[(topLeftBackCellN2Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i] + Q[(topLeftBackCellN3Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i]);
861 Q[(topRightBackCellSerialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i]
863 * (Q[(topRightBackCellN1Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i] + Q[(topRightBackCellN2Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i] + Q[(topRightBackCellN3Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i]);
865 Q[(bottomLeftBackCellSerialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i]
867 * (Q[(bottomLeftBackCellN1Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i] + Q[(bottomLeftBackCellN2Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i] + Q[(bottomLeftBackCellN3Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i]);
869 Q[(bottomRightBackCellSerialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i]
871 * (Q[(bottomRightBackCellN1Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i] + Q[(bottomRightBackCellN2Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i] + Q[(bottomRightBackCellN3Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i]);
873 Q[(topLeftFrontCellSerialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i]
875 * (Q[(topLeftFrontCellN1Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i] + Q[(topLeftFrontCellN2Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i] + Q[(topLeftFrontCellN3Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i]);
877 Q[(topRightFrontCellSerialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i]
879 * (Q[(topRightFrontCellN1Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i] + Q[(topRightFrontCellN2Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i] + Q[(topRightFrontCellN3Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i]);
881 Q[(bottomLeftFrontCellSerialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i]
883 * (Q[(bottomLeftFrontCellN1Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i] + Q[(bottomLeftFrontCellN2Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i] + Q[(bottomLeftFrontCellN3Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i]);
885 Q[(bottomRightFrontCellSerialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i]
887 * (Q[(bottomRightFrontCellN1Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i] + Q[(bottomRightFrontCellN2Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i] + Q[(bottomRightFrontCellN3Serialised) * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + i]);
896 auto pressure = [](
double* __restrict__ Q) {
897 return (Gamma - 1) * (Q[
e] - 0.5 * (Q[
u] * Q[
u] + Q[
v] * Q[
v]) / Q[
rho] - Q[
Z]);
900 for (
int x = 0;
x < NumberOfFiniteVolumesPerAxisPerPatch + 1;
x++)
901 for (
int y = 0;
y < NumberOfFiniteVolumesPerAxisPerPatch + 1;
y++) {
907 currentCell, NumberOfFiniteVolumesPerAxisPerPatch + 2
910 xNeighbourCell, NumberOfFiniteVolumesPerAxisPerPatch + 2
913 yNeighbourCell, NumberOfFiniteVolumesPerAxisPerPatch + 2
917 Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + NumberOfUnknowns]
918 = -Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) +
u]
919 + Q[xNeighbourCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) +
u];
921 Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + NumberOfUnknowns + 1]
922 = -Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + 1]
923 + Q[yNeighbourCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + 1];
925 Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + NumberOfUnknowns + 2]
926 = -Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + 2]
927 + Q[xNeighbourCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + 2];
929 Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + NumberOfUnknowns + 3]
930 = -Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + 2]
931 + Q[yNeighbourCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + 2];
933 Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + NumberOfUnknowns + 4]
934 = -
pressure(&Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables)]
935 ) / (R * Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables)])
936 +
pressure(&Q[xNeighbourCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables)]
937 ) / (R * Q[xNeighbourCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables)]);
939 Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + NumberOfUnknowns + 4]
940 = -
pressure(&Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables)]
941 ) / (R * Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables)])
942 +
pressure(&Q[yNeighbourCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables)]
943 ) / (R * Q[yNeighbourCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables)]);
947 double pressure = {[](
double* __restrict__ Q) {
948 return (Gamma - 1) * (Q[
e] - 0.5 * (Q[
u] * Q[
u] + Q[
v] * Q[
v] + Q[
w] * Q[
w]) / Q[
rho] - Q[
Z]);
951 for (
int x = 0;
x < NumberOfFiniteVolumesPerAxisPerPatch + 1;
x++)
952 for (
int y = 0;
y < NumberOfFiniteVolumesPerAxisPerPatch + 1;
y++)
953 for (
int z = 0; z < NumberOfFiniteVolumesPerAxisPerPatch + 1; z++) {
960 currentCell, NumberOfFiniteVolumesPerAxisPerPatch + 2
963 xNeighbourCell, NumberOfFiniteVolumesPerAxisPerPatch + 2
966 yNeighbourCell, NumberOfFiniteVolumesPerAxisPerPatch + 2
969 zNeighbourCell, NumberOfFiniteVolumesPerAxisPerPatch + 2
973 Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + NumberOfUnknowns]
974 = -Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + 1]
975 + Q[xNeighbourCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + 1];
977 Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + NumberOfUnknowns + 1]
978 = -Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + 1]
979 + Q[yNeighbourCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + 1];
981 Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + NumberOfUnknowns + 2]
982 = -Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + 1]
983 + Q[zNeighbourCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + 1];
985 Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + NumberOfUnknowns + 3]
986 = -Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + 2]
987 + Q[xNeighbourCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + 2];
989 Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + NumberOfUnknowns + 4]
990 = -Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + 2]
991 + Q[yNeighbourCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + 2];
993 Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + NumberOfUnknowns + 5]
994 = -Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + 2]
995 + Q[zNeighbourCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + 2];
997 Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + NumberOfUnknowns + 6]
998 = -Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + 3]
999 + Q[xNeighbourCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + 3];
1001 Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + NumberOfUnknowns + 7]
1002 = -Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + 3]
1003 + Q[yNeighbourCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + 3];
1005 Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + NumberOfUnknowns + 8]
1006 = -Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + 3]
1007 + Q[zNeighbourCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + 3];
1009 Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + NumberOfUnknowns + 9]
1010 = -
pressure(&Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables)]
1011 ) / (R * Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables)])
1012 +
pressure(&Q[xNeighbourCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables)]
1013 ) / (R * Q[xNeighbourCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables)]);
1015 Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + NumberOfUnknowns + 10]
1016 = -
pressure(&Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables)]
1017 ) / (R * Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables)])
1018 +
pressure(&Q[yNeighbourCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables)]
1019 ) / (R * Q[yNeighbourCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables)]);
1021 Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables) + NumberOfUnknowns + 11]
1022 = -
pressure(&Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables)]
1023 ) / (R * Q[currentCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables)])
1024 +
pressure(&Q[zNeighbourCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables)]
1025 ) / (R * Q[zNeighbourCellSerialized * (NumberOfUnknowns + NumberOfAuxiliaryVariables)]);