1 #include <libmesh/vector_value.h> 10 #define VECTORVALUETEST \ 12 CPPUNIT_TEST( testScalarInit ); \ 19 this->libmesh_suite_name =
"TypeVectorTest";
21 this->libmesh_suite_name =
"RealVectorValueTest";
28 CPPUNIT_TEST_SUITE_END();
35 this->libmesh_suite_name =
"NumberVectorValueTest";
42 CPPUNIT_TEST_SUITE_END();
49 this->libmesh_suite_name =
"ComplexVectorValueTest";
56 CPPUNIT_TEST_SUITE_END();
63 CPPUNIT_TEST( testCompareTypes );
65 CPPUNIT_TEST_SUITE_END();
68 template <
typename T,
typename T2>
72 return (val1 + val2) / 2;
84 [[maybe_unused]]
auto ftype = fvec * 1;
85 [[maybe_unused]]
auto dtype = dvec * 1;
88 bool assertion = std::is_same<decltype(ftype), TypeVector<float>>
::value;
89 CPPUNIT_ASSERT(assertion);
92 bool assertion = std::is_same<decltype(dtype), TypeVector<double>>
::value;
93 CPPUNIT_ASSERT(assertion);
96 bool assertion = std::is_same<decltype(average(ftype, ftype)), TypeVector<float>>
::value;
97 CPPUNIT_ASSERT(assertion);
100 bool assertion = std::is_same<decltype(average(ftype, dtype)), TypeVector<double>>
::value;
101 CPPUNIT_ASSERT(assertion);
104 bool assertion = std::is_same<decltype(average(fvec, fvec)), VectorValue<float>>
::value;
105 CPPUNIT_ASSERT(assertion);
108 bool assertion = std::is_same<decltype(average(fvec, dvec)), VectorValue<double>>
::value;
109 CPPUNIT_ASSERT(assertion);
112 bool assertion = std::is_same<decltype(average(fvec, dtype)), VectorValue<double>>
::value;
113 CPPUNIT_ASSERT(assertion);
116 bool assertion = std::is_same<decltype(average(ftype, dvec)), VectorValue<double>>
::value;
117 CPPUNIT_ASSERT(assertion);
119 #ifdef LIBMESH_HAVE_METAPHYSICL 121 typedef typename MetaPhysicL::ReplaceAlgebraicType<
124 typename MetaPhysicL::ValueType<std::vector<double>>::type>::type>::type
126 constexpr
bool assertion =
127 std::is_same<ReplacedType, std::vector<VectorValue<double>>>
::value;
128 CPPUNIT_ASSERT(assertion);
131 typedef typename MetaPhysicL::ReplaceAlgebraicType<
132 std::vector<VectorValue<double>>,
134 typename MetaPhysicL::ValueType<std::vector<VectorValue<double>>>::type>::type>::type
136 constexpr
bool assertion =
137 std::is_same<ReplacedType, std::vector<TensorValue<double>>>
::value;
138 CPPUNIT_ASSERT(assertion);
This class defines a vector in LIBMESH_DIM dimensional Real or Complex space.
The libMesh namespace provides an interface to certain functionality in the library.
bool summarized_logs_enabled()
CompareTypes< T, T2 >::supertype average(const T &val1, const T2 &val2)
std::complex< Real > Complex
libMesh::PerfLog * unitlog
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
CPPUNIT_TEST_SUITE_REGISTRATION(RealVectorValueTest)