402 _mesh->write(
"slit_mesh.xda");
403 _es->write(
"slit_solution.xda",
404 EquationSystems::WRITE_DATA |
405 EquationSystems::WRITE_SERIAL_FILES);
408 mesh2.read(
"slit_mesh.xda");
410 es2.read(
"slit_solution.xda");
412 System & sys2 = es2.get_system<
System> (
"SimpleSystem");
414 unsigned int dim = 2;
416 CPPUNIT_ASSERT_EQUAL( sys2.
n_vars(), 1u );
420 context.get_element_fe( 0, fe,
dim );
421 const std::vector<Point> & xyz = fe->
get_xyz();
426 std::unique_ptr<PointLocatorBase> locator =
_mesh->sub_point_locator();
428 if (!
_mesh->is_serial())
429 locator->enable_out_of_mesh_mode();
431 for (
const auto & elem : mesh2.active_local_element_ptr_range())
433 const Elem * mesh1_elem = (*locator)(elem->vertex_average());
436 CPPUNIT_ASSERT_EQUAL( elem->unique_id(),
439 for (
unsigned int n=0; n != elem->n_nodes(); ++n)
441 const Node & node = elem->node_ref(n);
448 context.pre_fe_reinit(sys2, elem);
449 context.elem_fe_reinit();
451 const unsigned int n_qp = xyz.size();
453 for (
unsigned int qp=0; qp != n_qp; ++qp)
455 const Number exact_val = slitfunc(context, xyz[qp]);
457 const Number discrete_val = context.interior_value(0, qp);
459 LIBMESH_ASSERT_NUMBERS_EQUAL
This is the EquationSystems class.
A Node is like a Point, but with more information.
std::unique_ptr< EquationSystems > _es
libMesh::Parallel::Communicator * TestCommWorld
static constexpr Real TOLERANCE
This is the base class from which all geometric element types are derived.
unique_id_type unique_id() const
const Node & node_ref(const unsigned int i) const
Manages consistently variables, degrees of freedom, and coefficient vectors.
std::unique_ptr< Mesh > _mesh
This class provides all data required for a physics package (e.g.
virtual_for_inffe const std::vector< Point > & get_xyz() const
unsigned int n_vars() const
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
This class forms the foundation from which generic finite elements may be derived.
const std::vector< std::vector< OutputShape > > & get_phi() const