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_fem_function.h"
8#include "libmesh/system.h"
10#ifdef LIBMESH_HAVE_FPARSER
29 es = std::make_unique<EquationSystems>(*
mesh);
42 Elem *elem =
mesh->query_elem_ptr(0);
89 c = std::make_unique<FEMContext>(*
sys);
90 s = std::make_unique<FEMContext>(*
sys);
93 c->get_element_fe(0)->get_phi();
94 c->get_element_fe(0)->get_dphi();
95#ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
96 c->get_element_fe(0)->get_d2phi();
98 c->pre_fe_reinit(*
sys, elem);
101 s->get_side_fe(0)->get_normals();
102 s->pre_fe_reinit(*
sys, elem);
121#ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
133 std::unique_ptr<UnstructuredMesh>
mesh;
134 std::unique_ptr<EquationSystems>
es;
136 std::unique_ptr<FEMContext>
c,
s;
146 std::vector<ParsedFEMFunction<Number>> pfvec;
155 pfvec.push_back(xy8_stolen);
157 LIBMESH_ASSERT_NUMBERS_EQUAL
161 LIBMESH_ASSERT_NUMBERS_EQUAL
182 LIBMESH_ASSERT_NUMBERS_EQUAL
187 LIBMESH_ASSERT_NUMBERS_EQUAL
192 LIBMESH_ASSERT_NUMBERS_EQUAL
207 LIBMESH_ASSERT_NUMBERS_EQUAL
212 LIBMESH_ASSERT_NUMBERS_EQUAL
217 LIBMESH_ASSERT_NUMBERS_EQUAL
231 LIBMESH_ASSERT_NUMBERS_EQUAL
234 LIBMESH_ASSERT_NUMBERS_EQUAL
238 (*
sys,
"a := 4 ; b := a/2+1; c:=b-a+3.5; c*x2*y4");
240 LIBMESH_ASSERT_NUMBERS_EQUAL
243 LIBMESH_ASSERT_NUMBERS_EQUAL
246 LIBMESH_ASSERT_NUMBERS_EQUAL
261 LIBMESH_ASSERT_NUMBERS_EQUAL
264 LIBMESH_ASSERT_NUMBERS_EQUAL
268 (*
sys,
"a := 4 ; b := a/2+1; c:=b-a+3.5; c*x2*y4");
272 LIBMESH_ASSERT_NUMBERS_EQUAL
275 LIBMESH_ASSERT_NUMBERS_EQUAL
278 LIBMESH_ASSERT_NUMBERS_EQUAL
297 const std::vector<Point> & xyz =
s->get_side_fe(0)->get_xyz();
300 for (std::size_t qp=0; qp != xyz.size(); ++qp)
302 LIBMESH_ASSERT_NUMBERS_EQUAL
304 LIBMESH_ASSERT_NUMBERS_EQUAL
306 LIBMESH_ASSERT_NUMBERS_EQUAL
std::unique_ptr< EquationSystems > es
CPPUNIT_TEST(testNormals)
std::unique_ptr< FEMContext > s
LIBMESH_CPPUNIT_TEST_SUITE(ParsedFEMFunctionTest)
CPPUNIT_TEST(testInlineGetter)
std::unique_ptr< FEMContext > c
CPPUNIT_TEST(testHessians)
CPPUNIT_TEST(testGradients)
std::unique_ptr< UnstructuredMesh > mesh
CPPUNIT_TEST(testInlineSetter)
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
processor_id_type processor_id() const
This is the base class from which all geometric element types are derived.
const Node & node_ref(const unsigned int i) const
Provides a uniform interface to vector storage schemes for different linear algebra libraries.
virtual void set(const numeric_index_type i, const T value)=0
Sets v(i) = value.
virtual void close()=0
Calls the NumericVector's internal assembly routines, ensuring that the values are consistent across ...
ParsedFEMFunction provides support for FParser-based parsed functions in FEMSystem.
Output get_inline_value(std::string_view inline_var_name) const
void set_inline_value(std::string_view inline_var_name, Output newval)
Changes the value of an inline variable.
A Point defines a location in LIBMESH_DIM dimensional Real space.
Manages consistently variables, degrees of freedom, and coefficient vectors.
unsigned int add_variable(std::string_view var, const FEType &type, const std::set< subdomain_id_type > *const active_subdomains=nullptr)
Adds the variable var to the list of variables for this system.
std::unique_ptr< NumericVector< Number > > solution
Data structure to hold solution values.
virtual void update()
Update the local values to reflect the solution on neighboring processors.
Communicator * TestCommWorld
The libMesh namespace provides an interface to certain functionality in the library.
static constexpr Real TOLERANCE
CPPUNIT_TEST_SUITE_REGISTRATION(ParsedFEMFunctionTest)