libMesh
tensor_traits_test.C
Go to the documentation of this file.
1 #include "libmesh_cppunit.h"
2 #include <libmesh/tensor_tools.h>
3 
4 using namespace libMesh;
5 using namespace TensorTools;
6 
7 class TensorTraitsTest : public CppUnit::TestCase {
8 public:
9  LIBMESH_CPPUNIT_TEST_SUITE( TensorTraitsTest );
10 
11  CPPUNIT_TEST( test );
12 
13  CPPUNIT_TEST_SUITE_END();
14 
15 public:
16  void
17  test()
18  {
19  LOG_UNIT_TEST;
20 
21  CPPUNIT_ASSERT_EQUAL(static_cast<unsigned char>(0), TensorTraits<Real>::rank);
22  CPPUNIT_ASSERT_EQUAL(static_cast<unsigned char>(1), TensorTraits<VectorValue<Real>>::rank);
23  CPPUNIT_ASSERT_EQUAL(static_cast<unsigned char>(1), TensorTraits<TypeVector<Real>>::rank);
24  CPPUNIT_ASSERT_EQUAL(static_cast<unsigned char>(2), TensorTraits<TensorValue<Real>>::rank);
25  CPPUNIT_ASSERT_EQUAL(static_cast<unsigned char>(2), TensorTraits<TypeTensor<Real>>::rank);
26  typedef TypeNTensor<3, Real> TypeNTensorTestType;
27  CPPUNIT_ASSERT_EQUAL(static_cast<unsigned char>(3), TensorTraits<TypeNTensorTestType>::rank);
28  }
29 };
30 
CPPUNIT_TEST_SUITE_REGISTRATION(TensorTraitsTest)
The libMesh namespace provides an interface to certain functionality in the library.
This class defines a tensor in LIBMESH_DIM dimensional space of type T.
Definition: tensor_tools.h:36
This class will eventually define a rank-N tensor in LIBMESH_DIM dimensional space of type T...
Definition: tensor_tools.h:38
This class defines a tensor in LIBMESH_DIM dimensional Real or Complex space.