2 #include "libmesh/elem.h" 3 #include "libmesh/equation_systems.h" 4 #include "libmesh/mesh.h" 5 #include "libmesh/mesh_generation.h" 6 #include "libmesh/numeric_vector.h" 7 #include "libmesh/parsed_function.h" 8 #include "libmesh/system.h" 10 #ifdef LIBMESH_HAVE_FPARSER 29 CPPUNIT_TEST(testValues);
30 CPPUNIT_TEST(testInlineGetter);
31 CPPUNIT_TEST(testInlineSetter);
32 CPPUNIT_TEST(testTimeDependence);
35 CPPUNIT_TEST_SUITE_END();
45 std::vector<ParsedFunction<Number>> pfvec;
53 pfvec.push_back(xy8_stolen);
55 LIBMESH_ASSERT_NUMBERS_EQUAL
58 LIBMESH_ASSERT_NUMBERS_EQUAL
70 ax2_stolen = std::move(ax2);
72 LIBMESH_ASSERT_NUMBERS_EQUAL
75 LIBMESH_ASSERT_NUMBERS_EQUAL
79 (
"a := 4 ; b := a/2+1; c:=b-a+3.5; c*x*2*y*4");
81 LIBMESH_ASSERT_NUMBERS_EQUAL
84 LIBMESH_ASSERT_NUMBERS_EQUAL
87 LIBMESH_ASSERT_NUMBERS_EQUAL
98 LIBMESH_ASSERT_NUMBERS_EQUAL
101 LIBMESH_ASSERT_NUMBERS_EQUAL
105 (
"a := 4 ; b := a/2+1; c:=b-a+3.5; c*x*2*y*4");
106 cxy8.set_inline_value(
"a", 2);
108 LIBMESH_ASSERT_NUMBERS_EQUAL
111 LIBMESH_ASSERT_NUMBERS_EQUAL
114 LIBMESH_ASSERT_NUMBERS_EQUAL
126 CPPUNIT_ASSERT(xyt.is_time_dependent());
129 CPPUNIT_ASSERT(x2y2t2.is_time_dependent());
132 CPPUNIT_ASSERT(ztanht.is_time_dependent());
139 #endif // #ifdef LIBMESH_HAVE_FPARSER void set_inline_value(std::string_view inline_var_name, Output newval)
Changes the value of an inline variable.
Output get_inline_value(std::string_view inline_var_name) const
A Function generated (via FParser) by parsing a mathematical expression.
static constexpr Real TOLERANCE
CPPUNIT_TEST_SUITE_REGISTRATION(ParsedFunctionTest)
The libMesh namespace provides an interface to certain functionality in the library.
void testTimeDependence()
bool is_time_dependent() const
A Point defines a location in LIBMESH_DIM dimensional Real space.