void testDofOrdering() { EquationSystems es(*_mesh); es.add_system<LinearImplicitSystem>("TestDofSystem"); es.get_system("TestDofSystem").add_variable("u",FIRST); es.init(); DofMap& dof_map = es.get_system("TestDofSystem").get_dof_map(); std::vector<dof_id_type> top_quad_dof_indices, bottom_quad_dof_indices, edge_dof_indices; dof_map.dof_indices( _mesh->elem(0), top_quad_dof_indices ); dof_map.dof_indices( _mesh->elem(1), bottom_quad_dof_indices ); dof_map.dof_indices( _mesh->elem(2), edge_dof_indices ); /* The dofs for the EDGE2 element should be the same as the bottom edge of the top QUAD4 dofs */ CPPUNIT_ASSERT_EQUAL( edge_dof_indices[0], top_quad_dof_indices[0] ); CPPUNIT_ASSERT_EQUAL( edge_dof_indices[1], top_quad_dof_indices[1] ); /* The dofs for the EDGE2 element should be the same as the top edge of the bottom QUAD4 dofs */ CPPUNIT_ASSERT_EQUAL( edge_dof_indices[0], bottom_quad_dof_indices[3] ); CPPUNIT_ASSERT_EQUAL( edge_dof_indices[1], bottom_quad_dof_indices[2] ); /* The nodes for the bottom edge of the top QUAD4 element should have the same global ids as the top edge of the bottom QUAD4 element */ CPPUNIT_ASSERT_EQUAL( top_quad_dof_indices[0], bottom_quad_dof_indices[3] ); CPPUNIT_ASSERT_EQUAL( top_quad_dof_indices[1], bottom_quad_dof_indices[2] ); }
void testMesh() { // There'd better be 3 elements CPPUNIT_ASSERT_EQUAL( (dof_id_type)3, _mesh->n_elem() ); // There'd better be only 6 nodes CPPUNIT_ASSERT_EQUAL( (dof_id_type)6, _mesh->n_nodes() ); /* The nodes for the EDGE2 element should have the same global ids as the bottom edge of the top QUAD4 element */ CPPUNIT_ASSERT_EQUAL( _mesh->elem(2)->node(0), _mesh->elem(0)->node(0) ); CPPUNIT_ASSERT_EQUAL( _mesh->elem(2)->node(1), _mesh->elem(0)->node(1) ); /* The nodes for the EDGE2 element should have the same global ids as the top edge of the bottom QUAD4 element */ CPPUNIT_ASSERT_EQUAL( _mesh->elem(2)->node(0), _mesh->elem(1)->node(3) ); CPPUNIT_ASSERT_EQUAL( _mesh->elem(2)->node(1), _mesh->elem(1)->node(2) ); /* The nodes for the bottom edge of the top QUAD4 element should have the same global ids as the top edge of the bottom QUAD4 element */ CPPUNIT_ASSERT_EQUAL( _mesh->elem(0)->node(0), _mesh->elem(1)->node(3) ); CPPUNIT_ASSERT_EQUAL( _mesh->elem(0)->node(1), _mesh->elem(1)->node(2) ); // We didn't set an interior_parent on the edge element, so it // should default to NULL CPPUNIT_ASSERT( !_mesh->elem(2)->interior_parent() ); }
void testMesh() { // There'd better be 3 elements CPPUNIT_ASSERT_EQUAL( (dof_id_type)3, _mesh->n_elem() ); // There'd better be only 6 nodes CPPUNIT_ASSERT_EQUAL( (dof_id_type)6, _mesh->n_nodes() ); /* The nodes for the EDGE2 element should have the same global ids as the bottom edge of the top QUAD4 element */ CPPUNIT_ASSERT_EQUAL( _mesh->elem(2)->node(0), _mesh->elem(0)->node(0) ); CPPUNIT_ASSERT_EQUAL( _mesh->elem(2)->node(1), _mesh->elem(0)->node(1) ); /* The nodes for the EDGE2 element should have the same global ids as the top edge of the bottom QUAD4 element */ CPPUNIT_ASSERT_EQUAL( _mesh->elem(2)->node(0), _mesh->elem(1)->node(3) ); CPPUNIT_ASSERT_EQUAL( _mesh->elem(2)->node(1), _mesh->elem(1)->node(2) ); /* The nodes for the bottom edge of the top QUAD4 element should have the same global ids as the top edge of the bottom QUAD4 element */ CPPUNIT_ASSERT_EQUAL( _mesh->elem(0)->node(0), _mesh->elem(1)->node(3) ); CPPUNIT_ASSERT_EQUAL( _mesh->elem(0)->node(1), _mesh->elem(1)->node(2) ); }