diff --git a/src/ASM/Test/TestSplineField.C b/src/ASM/Test/TestSplineField.C index 14c8d7f6..c7945d4d 100644 --- a/src/ASM/Test/TestSplineField.C +++ b/src/ASM/Test/TestSplineField.C @@ -16,6 +16,7 @@ #include "SIM3D.h" #include "gtest/gtest.h" +#include TEST(TestSplineField, Value2D) @@ -25,10 +26,10 @@ TEST(TestSplineField, Value2D) std::vector sc = {0.0, 1.0, 1.0, 2.0}; // x + y Field* fscalar = Field::create(sim.getPatch(1), sc); - static std::vector> tests_scalar = {{0.5, 0.5, 1.0}, - {1.0, 0.0, 1.0}, - {0.0, 1.0, 1.0}, - {1.0, 1.0, 2.0}}; + static std::vector> tests_scalar = {{{{0.5, 0.5, 1.0}}, + {{1.0, 0.0, 1.0}}, + {{0.0, 1.0, 1.0}}, + {{1.0, 1.0, 2.0}}}}; for (const auto& it : tests_scalar) { FiniteElement fe; fe.u = it[0]; @@ -37,7 +38,6 @@ TEST(TestSplineField, Value2D) } } - TEST(TestSplineField, Grad2D) { SIM2D sim(1); @@ -45,10 +45,10 @@ TEST(TestSplineField, Grad2D) std::vector sc = {0.0, 1.0, 1.0, 2.0}; // x + y Field* fscalar = Field::create(sim.getPatch(1), sc); - static std::vector> tests_scalar = {{0.5, 0.5}, - {1.0, 0.0}, - {0.0, 1.0}, - {1.0, 1.0}}; + static std::vector> tests_scalar = {{{{0.5, 0.5}}, + {{1.0, 0.0}}, + {{0.0, 1.0}}, + {{1.0, 1.0}}}}; for (const auto& it : tests_scalar) { FiniteElement fe; fe.u = it[0]; @@ -68,15 +68,15 @@ TEST(TestSplineField, Value3D) std::vector sc = {0.0, 1.0, 1.0, 2.0, 1.0, 2.0, 2.0, 3.0}; // x + y + z Field* fscalar = Field::create(sim.getPatch(1), sc); - static std::vector> tests_scalar = {{0.5, 0.5, 0.5, 1.5}, - {0.0, 0.0, 0.0, 0.0}, - {1.0, 0.0, 0.0, 1.0}, - {0.0, 1.0, 0.0, 1.0}, - {1.0, 1.0, 0.0, 2.0}, - {0.0, 0.0, 1.0, 1.0}, - {1.0, 0.0, 1.0, 2.0}, - {0.0, 1.0, 1.0, 2.0}, - {1.0, 1.0, 1.0, 3.0}}; + static std::vector> tests_scalar = {{{{0.5, 0.5, 0.5, 1.5}}, + {{0.0, 0.0, 0.0, 0.0}}, + {{1.0, 0.0, 0.0, 1.0}}, + {{0.0, 1.0, 0.0, 1.0}}, + {{1.0, 1.0, 0.0, 2.0}}, + {{0.0, 0.0, 1.0, 1.0}}, + {{1.0, 0.0, 1.0, 2.0}}, + {{0.0, 1.0, 1.0, 2.0}}, + {{1.0, 1.0, 1.0, 3.0}}}}; for (const auto& it : tests_scalar) { FiniteElement fe; fe.u = it[0]; @@ -94,15 +94,15 @@ TEST(TestSplineField, Grad3D) std::vector sc = {0.0, 1.0, 1.0, 2.0, 1.0, 2.0, 2.0, 3.0}; // x + y + z Field* fscalar = Field::create(sim.getPatch(1), sc); - static std::vector> tests_scalar = {{0.5, 0.5, 0.5}, - {0.0, 0.0, 0.0}, - {1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, - {1.0, 1.0, 0.0}, - {0.0, 0.0, 1.0}, - {1.0, 0.0, 1.0}, - {0.0, 1.0, 1.0}, - {1.0, 1.0, 1.0}}; + static std::vector> tests_scalar = {{{{0.5, 0.5, 0.5}}, + {{0.0, 0.0, 0.0}}, + {{1.0, 0.0, 0.0}}, + {{0.0, 1.0, 0.0}}, + {{1.0, 1.0, 0.0}}, + {{0.0, 0.0, 1.0}}, + {{1.0, 0.0, 1.0}}, + {{0.0, 1.0, 1.0}}, + {{1.0, 1.0, 1.0}}}}; for (const auto& it : tests_scalar) { FiniteElement fe; fe.u = it[0]; diff --git a/src/ASM/Test/TestSplineFields.C b/src/ASM/Test/TestSplineFields.C index 5976fef9..3323f91f 100644 --- a/src/ASM/Test/TestSplineFields.C +++ b/src/ASM/Test/TestSplineFields.C @@ -35,10 +35,10 @@ TEST(TestSplineFields, Value2D) Fields* fvector = Fields::create(sim.getPatch(1), vc); Field* fscalar = Field::create(sim.getPatch(1), vc, 1, 2); static std::vector> tests_vector = - {{0.5, 0.5, 1.25, 0.25}, - {1.0, 0.0, 1.0, 1.0}, - {0.0, 1.0, 1.0, -1.0}, - {1.0, 1.0, 3.0, 1.0}}; + {{{{0.5, 0.5, 1.25, 0.25}}, + {{1.0, 0.0, 1.0, 1.0}}, + {{0.0, 1.0, 1.0, -1.0}}, + {{1.0, 1.0, 3.0, 1.0}}}}; for (const auto& it : tests_vector) { FiniteElement fe; fe.u = it[0]; @@ -78,10 +78,10 @@ TEST(TestSplineFields, Value2Dmx) Fields* fvector = Fields::create(sim.getPatch(1), vc, 12); Field* fscalar = Field::create(sim.getPatch(1), vc, 3, 1); static std::vector> tests_vector = - {{0.5, 0.5, 1.25, 0.25, 1.0}, - {1.0, 0.0, 1.0, 1.0, 1.0}, - {0.0, 1.0, 1.0, -1.0, 1.0}, - {1.0, 1.0, 3.0, 1.0, 2.0}}; + {{{{0.5, 0.5, 1.25, 0.25, 1.0}}, + {{1.0, 0.0, 1.0, 1.0, 1.0}}, + {{0.0, 1.0, 1.0, -1.0, 1.0}}, + {{1.0, 1.0, 3.0, 1.0, 2.0}}}}; for (const auto& it : tests_vector) { FiniteElement fe; fe.u = it[0]; @@ -104,10 +104,10 @@ TEST(TestSplineFields, Grad2D) std::vector vc = {0.0, 0.0, 1.0, 1.0, 1.0, -1.0, 3.0, 1.0}; Fields* fvector = Fields::create(sim.getPatch(1), vc); static std::vector> tests_vector = - {{0.5, 0.5, 1.5, 1.5, 1.5, -0.5}, - {1.0, 0.0, 1.0, 2.0, 1.0, 0.0}, - {0.0, 1.0, 2.0, 1.0, 2.0, -1.0}, - {1.0, 1.0, 2.0, 2.0, 2.0, 0.0}}; + {{{{0.5, 0.5, 1.5, 1.5, 1.5, -0.5}}, + {{1.0, 0.0, 1.0, 2.0, 1.0, 0.0}}, + {{0.0, 1.0, 2.0, 1.0, 2.0, -1.0}}, + {{1.0, 1.0, 2.0, 2.0, 2.0, 0.0}}}}; for (const auto& it : tests_vector) { FiniteElement fe; fe.u = it[0]; @@ -139,15 +139,15 @@ TEST(TestSplineFields, Value3D) Fields* fvector = Fields::create(sim.getPatch(1), vc); Field* fscalar = Field::create(sim.getPatch(1), vc, 1, 2); static std::vector> tests_scalar = - {{0.5, 0.5, 0.5, 1.5, 0.5, 0.5}, - {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, - {1.0, 0.0, 0.0, 1.0, 1.0, 1.0}, - {0.0, 1.0, 0.0, 1.0, 1.0, -1.0}, - {1.0, 1.0, 0.0, 2.0, 2.0, 0.0}, - {0.0, 0.0, 1.0, 1.0, -1.0, 1.0}, - {1.0, 0.0, 1.0, 2.0, 0.0, 2.0}, - {0.0, 1.0, 1.0, 2.0, 0.0, 0.0}, - {1.0, 1.0, 1.0, 3.0, 1.0, 1.0}}; + {{{{0.5, 0.5, 0.5, 1.5, 0.5, 0.5}}, + {{0.0, 0.0, 0.0, 0.0, 0.0, 0.0}}, + {{1.0, 0.0, 0.0, 1.0, 1.0, 1.0}}, + {{0.0, 1.0, 0.0, 1.0, 1.0, -1.0}}, + {{1.0, 1.0, 0.0, 2.0, 2.0, 0.0}}, + {{0.0, 0.0, 1.0, 1.0, -1.0, 1.0}}, + {{1.0, 0.0, 1.0, 2.0, 0.0, 2.0}}, + {{0.0, 1.0, 1.0, 2.0, 0.0, 0.0}}, + {{1.0, 1.0, 1.0, 3.0, 1.0, 1.0}}}}; for (const auto& it : tests_scalar) { FiniteElement fe; fe.u = it[0]; @@ -180,33 +180,33 @@ TEST(TestSplineFields, Grad3D) Fields* fvector = Fields::create(sim.getPatch(1), vc); static std::vector, std::array>> tests_vector = - {{{0.5, 0.5, 0.5}, {1.25, 1.25, 1.25, - 1.25, 1.25, -0.75, - 1.25, -0.75, 1.25}}, - {{0.0, 0.0, 0.0}, {1.0, 1.0, 1.0, - 1.0, 1.0, -1.0, - 1.0, -1.0, 1.0}}, - {{1.0, 0.0, 0.0}, {1.0, 1.0, 1.0, - 1.0, 1.0, -1.0, - 1.0, -1.0, 1.0}}, - {{0.0, 1.0, 0.0}, {1.0, 1.0, 1.0, - 1.0, 1.0, -1.0, - 1.0, -1.0, 1.0}}, - {{1.0, 1.0, 0.0}, {1.0, 1.0, 2.0, - 1.0, 1.0, 0.0, - 1.0, -1.0, 2.0}}, - {{0.0, 0.0, 1.0}, {1.0, 1.0, 1.0, - 1.0, 1.0, -1.0, - 1.0, -1.0, 1.0}}, - {{1.0, 0.0, 1.0}, {1.0, 2.0, 1.0, - 1.0, 2.0, -1.0, - 1.0, 0.0, 1.0}}, - {{0.0, 1.0, 1.0}, {2.0, 1.0, 1.0, - 2.0, 1.0, -1.0, - 2.0, -1.0, 1.0}}, - {{1.0, 1.0, 1.0}, {2.0, 2.0, 2.0, - 2.0, 2.0, 0.0, - 2.0, 0.0, 2.0}}}; + {{{{{0.5, 0.5, 0.5}}, {{1.25, 1.25, 1.25, + 1.25, 1.25, -0.75, + 1.25, -0.75, 1.25}}}, + {{{0.0, 0.0, 0.0}}, {{1.0, 1.0, 1.0, + 1.0, 1.0, -1.0, + 1.0, -1.0, 1.0}}}, + {{{1.0, 0.0, 0.0}}, {{1.0, 1.0, 1.0, + 1.0, 1.0, -1.0, + 1.0, -1.0, 1.0}}}, + {{{0.0, 1.0, 0.0}}, {{1.0, 1.0, 1.0, + 1.0, 1.0, -1.0, + 1.0, -1.0, 1.0}}}, + {{{1.0, 1.0, 0.0}}, {{1.0, 1.0, 2.0, + 1.0, 1.0, 0.0, + 1.0, -1.0, 2.0}}}, + {{{0.0, 0.0, 1.0}}, {{1.0, 1.0, 1.0, + 1.0, 1.0, -1.0, + 1.0, -1.0, 1.0}}}, + {{{1.0, 0.0, 1.0}}, {{1.0, 2.0, 1.0, + 1.0, 2.0, -1.0, + 1.0, 0.0, 1.0}}}, + {{{0.0, 1.0, 1.0}}, {{2.0, 1.0, 1.0, + 2.0, 1.0, -1.0, + 2.0, -1.0, 1.0}}}, + {{{1.0, 1.0, 1.0}}, {{2.0, 2.0, 2.0, + 2.0, 2.0, 0.0, + 2.0, 0.0, 2.0}}}}}; for (const auto& it : tests_vector) { FiniteElement fe; fe.u = it.first[0]; @@ -252,15 +252,15 @@ TEST(TestSplineFields, Value3Dmx) Fields* fvector = Fields::create(sim.getPatch(1), vc, 123); Field* fscalar = Field::create(sim.getPatch(1), vc, 4, 1); static std::vector> tests_vector = - {{0.5, 0.5, 0.5, 1.625, 0.625, 0.625, 1.5}, - {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, - {1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0}, - {0.0, 1.0, 0.0, 1.0, 1.0, -1.0, 1.0}, - {1.0, 1.0, 0.0, 2.0, 2.0, 0.0, 2.0}, - {0.0, 0.0, 1.0, 1.0, -1.0, 1.0, 1.0}, - {1.0, 0.0, 1.0, 2.0, 0.0, 2.0, 2.0}, - {0.0, 1.0, 1.0, 2.0, 0.0, 0.0, 2.0}, - {1.0, 1.0, 1.0, 4.0, 2.0, 2.0, 3.0}}; + {{{{0.5, 0.5, 0.5, 1.625, 0.625, 0.625, 1.5}}, + {{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}}, + {{1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0}}, + {{0.0, 1.0, 0.0, 1.0, 1.0, -1.0, 1.0}}, + {{1.0, 1.0, 0.0, 2.0, 2.0, 0.0, 2.0}}, + {{0.0, 0.0, 1.0, 1.0, -1.0, 1.0, 1.0}}, + {{1.0, 0.0, 1.0, 2.0, 0.0, 2.0, 2.0}}, + {{0.0, 1.0, 1.0, 2.0, 0.0, 0.0, 2.0}}, + {{1.0, 1.0, 1.0, 4.0, 2.0, 2.0, 3.0}}}}; for (const auto& it : tests_vector) { FiniteElement fe; fe.u = it[0];