Definition at line 236 of file slit_mesh_test.C.
◆ build_mesh()
void SlitMeshTest::build_mesh |
( |
| ) |
|
|
inlineprotectedinherited |
◆ CPPUNIT_TEST() [1/3]
SlitMeshRefinedSystemTest::CPPUNIT_TEST |
( |
testMesh |
| ) |
|
◆ CPPUNIT_TEST() [2/3]
SlitMeshRefinedSystemTest::CPPUNIT_TEST |
( |
testRestart |
| ) |
|
◆ CPPUNIT_TEST() [3/3]
SlitMeshRefinedSystemTest::CPPUNIT_TEST |
( |
testSystem |
| ) |
|
◆ CPPUNIT_TEST_SUITE() [1/2]
The goal of this test is the same as the previous, but now we create a system and set dof values to make sure they are properly interpolated after refinement.
◆ CPPUNIT_TEST_SUITE() [2/2]
The goal of this test is to ensure that a 2D mesh with nodes overlapping on opposite sides of an internal, "slit" edge is usable.
◆ CPPUNIT_TEST_SUITE_END()
SlitMeshRefinedSystemTest::CPPUNIT_TEST_SUITE_END |
( |
| ) |
|
◆ setUp()
void SlitMeshRefinedSystemTest::setUp |
( |
| ) |
|
|
inline |
◆ tearDown()
void SlitMeshRefinedSystemTest::tearDown |
( |
| ) |
|
|
inline |
◆ testMesh()
void SlitMeshRefinedSystemTest::testMesh |
( |
| ) |
|
|
inline |
◆ testRestart()
void SlitMeshRefinedSystemTest::testRestart |
( |
| ) |
|
|
inline |
Definition at line 343 of file slit_mesh_test.C.
349 EquationSystems::WRITE_DATA |
350 EquationSystems::WRITE_SERIAL_FILES);
353 mesh2.read(
"slit_mesh.xda");
355 es2.read(
"slit_solution.xda");
357 System & sys2 = es2.get_system<
System> (
"SimpleSystem");
359 unsigned int dim = 2;
361 CPPUNIT_ASSERT_EQUAL( sys2.
n_vars(), 1u );
365 context.get_element_fe( 0, fe,
dim );
366 const std::vector<Point> & xyz = fe->
get_xyz();
374 locator->enable_out_of_mesh_mode();
376 for (
const auto & elem : mesh2.active_local_element_ptr_range())
378 const Elem * mesh1_elem = (*locator)(elem->centroid());
381 CPPUNIT_ASSERT_EQUAL( elem->unique_id(),
384 for (
unsigned int n=0; n != elem->n_nodes(); ++n)
386 const Node & node = elem->node_ref(n);
393 context.pre_fe_reinit(sys2, elem);
394 context.elem_fe_reinit();
396 const unsigned int n_qp = xyz.
size();
398 for (
unsigned int qp=0; qp != n_qp; ++qp)
400 const Number exact_val = slitfunc(context, xyz[qp]);
402 const Number discrete_val = context.interior_value(0, qp);
References libMesh::DistributedMesh::active_local_element_ptr_range(), dim, libMesh::FEGenericBase< OutputType >::get_phi(), libMesh::EquationSystems::get_system(), libMesh::FEAbstract::get_xyz(), libMesh::libmesh_real(), libMesh::System::n_vars(), libMesh::Elem::node_ref(), libMesh::UnstructuredMesh::read(), libMesh::EquationSystems::read(), libMesh::TypeVector< T >::size(), TestCommWorld, libMesh::TOLERANCE, libMesh::DofObject::unique_id(), libMesh::EquationSystems::write(), libMesh::EquationSystems::WRITE_DATA, and libMesh::EquationSystems::WRITE_SERIAL_FILES.
◆ testSystem()
void SlitMeshRefinedSystemTest::testSystem |
( |
| ) |
|
|
inline |
Definition at line 309 of file slit_mesh_test.C.
313 unsigned int dim = 2;
319 context.get_element_fe( 0, fe,
dim );
320 const std::vector<Point> & xyz = fe->
get_xyz();
325 context.pre_fe_reinit(*
_sys, elem);
326 context.elem_fe_reinit();
328 const unsigned int n_qp = xyz.size();
330 for (
unsigned int qp=0; qp != n_qp; ++qp)
332 const Number exact_val = slitfunc(context, xyz[qp]);
334 const Number discrete_val = context.interior_value(0, qp);
References dim, libMesh::FEGenericBase< OutputType >::get_phi(), libMesh::FEAbstract::get_xyz(), libMesh::libmesh_real(), libMesh::System::n_vars(), and libMesh::TOLERANCE.
◆ _es
◆ _mesh
Mesh* SlitMeshTest::_mesh |
|
protectedinherited |
◆ _sys
System* SlitMeshRefinedSystemTest::_sys |
|
protected |
The documentation for this class was generated from the following file:
Manages consistently variables, degrees of freedom, and coefficient vectors.
unsigned int n_vars() const
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
const std::vector< Point > & get_xyz() const
virtual System & add_system(const std::string &system_type, const std::string &name)
Add the system of type system_type named name to the systems array.
virtual SimpleRange< element_iterator > active_local_element_ptr_range() override
virtual Node * add_point(const Point &p, const dof_id_type id=DofObject::invalid_id, const processor_id_type proc_id=DofObject::invalid_processor_id) override
functions for adding /deleting nodes elements.
This class forms the foundation from which generic finite elements may be derived.
static const Real TOLERANCE
auto size() const -> decltype(std::norm(T()))
virtual void write(const std::string &name) override
Write the file specified by name.
Implements (adaptive) mesh refinement algorithms for a MeshBase.
virtual dof_id_type n_nodes() const override
virtual dof_id_type n_elem() const override
unsigned int add_variable(const std::string &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.
libMesh::Parallel::Communicator * TestCommWorld
virtual void init()
Initialize all the systems.
A Point defines a location in LIBMESH_DIM dimensional Real space.
virtual Elem * add_elem(Elem *e) override
Add elem e to the end of the element array.
A Node is like a Point, but with more information.
The QUAD4 is an element in 2D composed of 4 nodes.
unique_id_type unique_id() const
This is the EquationSystems class.
virtual Node *& set_node(const unsigned int i)
virtual void reinit()
Handle any mesh changes and reinitialize all the systems on the updated mesh.
std::unique_ptr< PointLocatorBase > sub_point_locator() const
This is the base class from which all geometric element types are derived.
void write(const std::string &name, const XdrMODE, const unsigned int write_flags=(WRITE_DATA), bool partition_agnostic=true) const
Write the systems to disk using the XDR data format.
virtual bool is_serial() const override
const std::vector< std::vector< OutputShape > > & get_phi() const
void allow_renumbering(bool allow)
If false is passed in then this mesh will no longer be renumbered when being prepared for use.
const Node & node_ref(const unsigned int i) const
void prepare_for_use(const bool skip_renumber_nodes_and_elements=false, const bool skip_find_neighbors=false)
Prepare a newly ecreated (or read) mesh for use.
void project_solution(FunctionBase< Number > *f, FunctionBase< Gradient > *g=nullptr) const
Projects arbitrary functions onto the current solution.
void set_mesh_dimension(unsigned char d)
Resets the logical dimension of the mesh.
void uniformly_refine(unsigned int n=1)
Uniformly refines the mesh n times.
virtual dof_id_type n_active_elem() const override
virtual const Node * node_ptr(const dof_id_type i) const override
This class provides all data required for a physics package (e.g.