2 #include <libmesh/composite_function.h> 3 #include <libmesh/const_function.h> 4 #include <libmesh/dense_vector.h> 5 #include <libmesh/parsed_function.h> 6 #include <libmesh/zero_function.h> 7 #include <libmesh/analytic_function.h> 23 CPPUNIT_TEST(testRemap);
25 CPPUNIT_TEST(testTimeDependence);
28 CPPUNIT_TEST_SUITE_END();
36 std::vector<std::vector<unsigned int>> index_sets(4);
37 index_sets[0].resize(2);
40 index_sets[1].resize(3);
44 index_sets[2].resize(3);
48 index_sets[3].resize(5);
71 (composite_inner, index_sets[3]);
75 composite_inner(
Point(0), 0, test_one);
77 LIBMESH_ASSERT_FP_EQUAL(2, test_one(0), 1.e-12);
78 LIBMESH_ASSERT_FP_EQUAL(2, test_one(1), 1.e-12);
79 LIBMESH_ASSERT_FP_EQUAL(2, test_one(2), 1.e-12);
80 LIBMESH_ASSERT_FP_EQUAL(1, test_one(3), 1.e-12);
81 LIBMESH_ASSERT_FP_EQUAL(1, test_one(4), 1.e-12);
87 cf_three_copy_assign = cf_three;
88 cf_three_move_assign = std::move(cf_three_copy_assign);
98 composite_outer_copy2 = std::move(composite_outer_copy1);
101 composite_outer_copy2(
Point(0), 0, test_two);
103 LIBMESH_ASSERT_FP_EQUAL(3, test_two(0), 1.e-12);
104 LIBMESH_ASSERT_FP_EQUAL(3, test_two(2), 1.e-12);
105 LIBMESH_ASSERT_FP_EQUAL(3, test_two(4), 1.e-12);
106 LIBMESH_ASSERT_FP_EQUAL(2, test_two(5), 1.e-12);
107 LIBMESH_ASSERT_FP_EQUAL(2, test_two(1), 1.e-12);
108 LIBMESH_ASSERT_FP_EQUAL(2, test_two(3), 1.e-12);
109 LIBMESH_ASSERT_FP_EQUAL(1, test_two(6), 1.e-12);
110 LIBMESH_ASSERT_FP_EQUAL(1, test_two(7), 1.e-12);
115 #ifdef LIBMESH_HAVE_FPARSER 131 {
return p(0)*p(0) + p(1)*p(1) + t*t; };
134 std::vector<unsigned int> index_set(1,0);
154 x2y2t2_copy2 = x2y2t2_copy1;
182 x2y2t2_move2 = std::move(x2y2t2_move1);
205 #endif // #ifdef LIBMESH_HAVE_FPARSER
ConstFunction that simply returns 0.
A Function generated (via FParser) by parsing a mathematical expression.
The libMesh namespace provides an interface to certain functionality in the library.
Wraps a function pointer into a FunctionBase object.
void testTimeDependence()
A function that returns a vector whose components are defined by multiple functions.
bool is_time_dependent() const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
CPPUNIT_TEST_SUITE_REGISTRATION(CompositeFunctionTest)
Function that returns a single value that never changes.
Defines a dense vector for use in Finite Element-type computations.
A Point defines a location in LIBMESH_DIM dimensional Real space.
void attach_subfunction(const FunctionBase< Output > &f, std::vector< unsigned int > index_map)
Attach a new subfunction, along with a map from the indices of the attached subfunction to the indice...