291 mesh_function.
init();
294 out_of_mesh_value(0) = -99.0;
295 out_of_mesh_value(1) = 5.25;
296 out_of_mesh_value(2) = 42;
297 mesh_function.enable_out_of_mesh_mode(out_of_mesh_value);
299 std::vector<Tensor> hessians;
300 const Point p(0.4, 0.6, 0.0);
305 bool someone_found_elem = elem;
307 CPPUNIT_ASSERT(someone_found_elem);
309 mesh_function.hessian(p, 0.0, hessians);
311 CPPUNIT_ASSERT_EQUAL(std::size_t(3), hessians.size());
317 LIBMESH_ASSERT_NUMBERS_EQUAL(15.0, hessians[0](0,0), tol);
318 LIBMESH_ASSERT_NUMBERS_EQUAL(0.75, hessians[0](0,1), tol);
319 LIBMESH_ASSERT_NUMBERS_EQUAL(0.75, hessians[0](1,0), tol);
320 LIBMESH_ASSERT_NUMBERS_EQUAL(150.0, hessians[0](1,1), tol);
323 for (
unsigned int d = 0; d < LIBMESH_DIM; ++d)
324 for (
unsigned int d2 = 0; d2 < LIBMESH_DIM; ++d2)
326 LIBMESH_ASSERT_NUMBERS_EQUAL(0, hessians[0](d,d2),
330 for (
unsigned int d = 0; d < LIBMESH_DIM; ++d)
331 for (
unsigned int d2 = 0; d2 < LIBMESH_DIM; ++d2)
332 LIBMESH_ASSERT_NUMBERS_EQUAL(0, hessians[1](d,d2), tol);
334 LIBMESH_ASSERT_NUMBERS_EQUAL(out_of_mesh_value(2),
337 for (
unsigned int d = 0; d < LIBMESH_DIM; ++d)
338 for (
unsigned int d2 = 0; d2 < LIBMESH_DIM; ++d2)
340 LIBMESH_ASSERT_NUMBERS_EQUAL(0, hessians[2](d,d2),
343 const Point bad_p(1.375, 0.625, 0.0);
344 mesh_function.hessian(bad_p, 0.0, hessians);
346 for (
unsigned int vn = 0; vn != 2; ++vn)
348 LIBMESH_ASSERT_NUMBERS_EQUAL(out_of_mesh_value(vn),
349 hessians[vn](0,0), tol);
350 for (
unsigned int d = 0; d < LIBMESH_DIM; ++d)
351 for (
unsigned int d2 = 0; d2 < LIBMESH_DIM; ++d2)
353 LIBMESH_ASSERT_NUMBERS_EQUAL(0, hessians[vn](d,d2), tol);
Number biquadratic_function(const Point &p, const Parameters &, const std::string &, const std::string &)
This is the EquationSystems class.
The ReplicatedMesh class is derived from the MeshBase class, and is used to store identical copies of...
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
std::unique_ptr< PointLocatorBase > sub_point_locator() const
libMesh::Parallel::Communicator * TestCommWorld
static constexpr Real TOLERANCE
This is the base class from which all geometric element types are derived.
const Parallel::Communicator & comm() const
Manages consistently variables, degrees of freedom, and coefficient vectors.
virtual void init() override
Override the FunctionBase::init() member function.
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.
void project_solution(FunctionBase< Number > *f, FunctionBase< Gradient > *g=nullptr, std::optional< ConstElemRange > active_local_range=std::nullopt, std::optional< std::vector< unsigned int >> variable_numbers=std::nullopt) const
Projects arbitrary functions onto the current solution.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void max(const T &r, T &o, Request &req) const
std::unique_ptr< NumericVector< Number > > current_local_solution
All the values I need to compute my contribution to the simulation at hand.
This class provides function-like objects for data distributed over a mesh.
processor_id_type processor_id() const
const DofMap & get_dof_map() const
processor_id_type processor_id() const
A Point defines a location in LIBMESH_DIM dimensional Real space.