diff --git a/src/gpu/VirtualFluids_GPU/GPU/GridScaling/interpolateRotatingToStaticInlinesTest.cpp b/src/gpu/VirtualFluids_GPU/GPU/GridScaling/interpolateRotatingToStaticInlinesTest.cpp index 2742493934d63713f14717152938ff1ae21786a2..17b0c5ede57ef1b7dd167888bbfb683bc696c16d 100644 --- a/src/gpu/VirtualFluids_GPU/GPU/GridScaling/interpolateRotatingToStaticInlinesTest.cpp +++ b/src/gpu/VirtualFluids_GPU/GPU/GridScaling/interpolateRotatingToStaticInlinesTest.cpp @@ -104,7 +104,7 @@ TEST_F(RotateSecondOrderMomentsFromGlobalToRotatingTest, xAngleIsPiHalf_momentsC EXPECT_THAT(mxxMyy, RealNear(mxxMzzBeforeRotation, 1e-6)); EXPECT_THAT(mxxMzz, RealNear(mxxMyyBeforeRotation, 1e-6)); EXPECT_THAT(m110, RealNear(m101BeforeRotation, 1e-6)); - + // switched and reversed EXPECT_THAT(m101, RealNear(-m110BeforeRotation, 1e-6)); } @@ -116,13 +116,13 @@ TEST_F(RotateSecondOrderMomentsFromGlobalToRotatingTest, xAngleIsMinusPiHalf_mom rotateSecondOrderMomentsGlobalToRotating(m011, m101, m110, mxxMyy, mxxMzz, angles[0], angles[1], angles[2]); // reversed - EXPECT_THAT(-m011, RealNear(m011BeforeRotation, 1e-6)); + EXPECT_THAT(m011, RealNear(-m011BeforeRotation, 1e-6)); // switched EXPECT_THAT(mxxMyy, RealNear(mxxMzzBeforeRotation, 1e-6)); EXPECT_THAT(mxxMzz, RealNear(mxxMyyBeforeRotation, 1e-6)); EXPECT_THAT(m101, RealNear(m110BeforeRotation, 1e-6)); - + // switched and reversed EXPECT_THAT(m110, RealNear(-m101BeforeRotation, 1e-6)); } diff --git a/src/gpu/VirtualFluids_GPU/GPU/GridScaling/interpolateStaticToRotatingInlinesTest.cpp b/src/gpu/VirtualFluids_GPU/GPU/GridScaling/interpolateStaticToRotatingInlinesTest.cpp index 60c70af75db7dd0ec8b743f5f8d7ec544e1cc0f7..e5596496852fd6e0bdcad6414c3d53cc2034fe7e 100644 --- a/src/gpu/VirtualFluids_GPU/GPU/GridScaling/interpolateStaticToRotatingInlinesTest.cpp +++ b/src/gpu/VirtualFluids_GPU/GPU/GridScaling/interpolateStaticToRotatingInlinesTest.cpp @@ -30,7 +30,7 @@ TEST_F(RotateSecondOrderMomentsFromRotatingToGlobalTest, angleIsZero_momentsDoNo EXPECT_THAT(m110, RealEq(m110BeforeRotation)); } -TEST_F(RotateSecondOrderMomentsFromRotatingToGlobalTest, angleIs2Pi_momentsDoNotChange) +TEST_F(RotateSecondOrderMomentsFromRotatingToGlobalTest, anglesAre2Pi_momentsDoNotChange) { std::array<real, 3> angles = { c2Pi, c2Pi, c2Pi }; @@ -97,6 +97,7 @@ TEST_F(RotateSecondOrderMomentsFromRotatingToGlobalTest, xAngleIsPiHalf_momentsC rotateSecondOrderMomentsRotatingToGlobal(m011, m101, m110, mxxMyy, mxxMzz, angles[0], angles[1], angles[2]); + // reversed EXPECT_THAT(m011, RealNear(-m011BeforeRotation, 1e-6)); @@ -107,6 +108,19 @@ TEST_F(RotateSecondOrderMomentsFromRotatingToGlobalTest, xAngleIsPiHalf_momentsC // switched and reversed EXPECT_THAT(m110, RealNear(-m101BeforeRotation, 1e-6)); + + real mxxPyyPzz = 0.0; + real useNEQ = 1.0; + real m200BeforeRotation = c1o3 * ( mxxMyyBeforeRotation + mxxMzzBeforeRotation + mxxPyyPzz) * useNEQ; + real m020BeforeRotation = c1o3 * (-c2o1 * mxxMyyBeforeRotation + mxxMzzBeforeRotation + mxxPyyPzz) * useNEQ; + real m002BeforeRotation = c1o3 * ( mxxMyyBeforeRotation - c2o1 * mxxMzzBeforeRotation + mxxPyyPzz) * useNEQ; + real m200 = c1o3 * ( mxxMyy + mxxMzz + mxxPyyPzz) * useNEQ; + real m020 = c1o3 * (-c2o1 * mxxMyy + mxxMzz + mxxPyyPzz) * useNEQ; + real m002 = c1o3 * ( mxxMyy - c2o1 * mxxMzz + mxxPyyPzz) * useNEQ; + + EXPECT_THAT(m200, RealNear(m200BeforeRotation, 1e-6)); + EXPECT_THAT(m020, RealNear(m002BeforeRotation, 1e-6)); + EXPECT_THAT(m002, RealNear(m020BeforeRotation, 1e-6)); } TEST_F(RotateSecondOrderMomentsFromRotatingToGlobalTest, xAngleIsMinusPiHalf_momentsChange) @@ -116,7 +130,7 @@ TEST_F(RotateSecondOrderMomentsFromRotatingToGlobalTest, xAngleIsMinusPiHalf_mom rotateSecondOrderMomentsRotatingToGlobal(m011, m101, m110, mxxMyy, mxxMzz, angles[0], angles[1], angles[2]); // reversed - EXPECT_THAT(-m011, RealNear(m011BeforeRotation, 1e-6)); + EXPECT_THAT(m011, RealNear(-m011BeforeRotation, 1e-6)); // switched EXPECT_THAT(mxxMyy, RealNear(mxxMzzBeforeRotation, 1e-6)); @@ -125,6 +139,19 @@ TEST_F(RotateSecondOrderMomentsFromRotatingToGlobalTest, xAngleIsMinusPiHalf_mom // switched and reversed EXPECT_THAT(m101, RealNear(-m110BeforeRotation, 1e-6)); + + real mxxPyyPzz = 0.0; + real useNEQ = 1.0; + real m200BeforeRotation = c1o3 * ( mxxMyyBeforeRotation + mxxMzzBeforeRotation + mxxPyyPzz) * useNEQ; + real m020BeforeRotation = c1o3 * (-c2o1 * mxxMyyBeforeRotation + mxxMzzBeforeRotation + mxxPyyPzz) * useNEQ; + real m002BeforeRotation = c1o3 * ( mxxMyyBeforeRotation - c2o1 * mxxMzzBeforeRotation + mxxPyyPzz) * useNEQ; + real m200 = c1o3 * ( mxxMyy + mxxMzz + mxxPyyPzz) * useNEQ; + real m020 = c1o3 * (-c2o1 * mxxMyy + mxxMzz + mxxPyyPzz) * useNEQ; + real m002 = c1o3 * ( mxxMyy - c2o1 * mxxMzz + mxxPyyPzz) * useNEQ; + + EXPECT_THAT(m200, RealNear(m200BeforeRotation, 1e-6)); + EXPECT_THAT(m020, RealNear(m002BeforeRotation, 1e-6)); + EXPECT_THAT(m002, RealNear(m020BeforeRotation, 1e-6)); } TEST_F(RotateSecondOrderMomentsFromRotatingToGlobalTest, yAngleIsPiHalf_momentsChange)