376 _mesh->write(
"slit_mesh.xda");
377 _es->write(
"slit_solution.xda",
378 EquationSystems::WRITE_DATA |
379 EquationSystems::WRITE_SERIAL_FILES);
382 mesh2.read(
"slit_mesh.xda");
384 es2.read(
"slit_solution.xda");
386 System & sys2 = es2.get_system<
System> (
"SimpleSystem");
388 unsigned int dim = 2;
390 CPPUNIT_ASSERT_EQUAL( sys2.
n_vars(), 1u );
394 context.get_element_fe( 0, fe,
dim );
395 const std::vector<Point> & xyz = fe->
get_xyz();
400 std::unique_ptr<PointLocatorBase> locator =
_mesh->sub_point_locator();
402 if (!
_mesh->is_serial())
403 locator->enable_out_of_mesh_mode();
405 for (
const auto & elem : mesh2.active_local_element_ptr_range())
407 const Elem * mesh1_elem = (*locator)(elem->vertex_average());
410 CPPUNIT_ASSERT_EQUAL( elem->unique_id(),
413 for (
unsigned int n=0; n != elem->n_nodes(); ++n)
415 const Node & node = elem->node_ref(n);
422 context.pre_fe_reinit(sys2, elem);
423 context.elem_fe_reinit();
425 const unsigned int n_qp = xyz.size();
427 for (
unsigned int qp=0; qp != n_qp; ++qp)
429 const Number exact_val = slitfunc(context, xyz[qp]);
431 const Number discrete_val = context.interior_value(0, qp);
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