Skip to content

Commit fb12680

Browse files
committed
Add base input for type N tensor unit test
1 parent 87f80c0 commit fb12680

1 file changed

Lines changed: 80 additions & 0 deletions

File tree

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
// libmesh includes
2+
#include <libmesh/tensor_value.h>
3+
#include <libmesh/vector_value.h>
4+
#include <libmesh/point.h>
5+
6+
#include "libmesh_cppunit.h"
7+
8+
using namespace libMesh;
9+
10+
class TypeNTensorTest : public CppUnit::TestCase
11+
{
12+
public:
13+
void setUp() {}
14+
15+
void tearDown() {}
16+
17+
LIBMESH_CPPUNIT_TEST_SUITE(TypeNTensorTest);
18+
19+
CPPUNIT_TEST(testOperatorsScalar);
20+
CPPUNIT_TEST(testOperatorsTensor);
21+
CPPUNIT_TEST(testCastVector);
22+
CPPUNIT_TEST(testZero);
23+
CPPUNIT_TEST(testSlice);
24+
25+
CPPUNIT_TEST_SUITE_END();
26+
27+
private:
28+
void testOperatorsScalar()
29+
{
30+
LOG_UNIT_TEST;
31+
32+
// Add a number
33+
34+
// Subtract a number
35+
36+
// Multiply by a number
37+
38+
// Divide by a number
39+
40+
// TensorValue<Real> tensor(1, 2, 0, 3, 4, 0);
41+
// VectorValue<Real> vector(5, 6, 0);
42+
// auto left_mult = vector * tensor;
43+
// auto right_mult = tensor * vector;
44+
// LIBMESH_ASSERT_FP_EQUAL(23, left_mult(0), 1e-12);
45+
// LIBMESH_ASSERT_FP_EQUAL(34, left_mult(1), 1e-12);
46+
// LIBMESH_ASSERT_FP_EQUAL(17, right_mult(0), 1e-12);
47+
// LIBMESH_ASSERT_FP_EQUAL(39, right_mult(1), 1e-12);
48+
}
49+
50+
void testOperatorsTensor()
51+
{
52+
// Add a tensor
53+
54+
// Return sum of two tensors
55+
56+
// Subtract a tensor
57+
58+
// Return subtraction of one tensor by another
59+
60+
// Add a scaled tensor
61+
62+
}
63+
64+
void ttestCastVector()
65+
{
66+
67+
}
68+
69+
void testZero()
70+
{
71+
72+
}
73+
74+
void testSlice()
75+
{
76+
77+
}
78+
};
79+
80+
CPPUNIT_TEST_SUITE_REGISTRATION(TypeNTensorTest);

0 commit comments

Comments
 (0)