libMesh
Public Member Functions | List of all members
DofMapTest Class Reference
Inheritance diagram for DofMapTest:
[legend]

Public Member Functions

 CPPUNIT_TEST_SUITE (DofMapTest)
 
 CPPUNIT_TEST (testDofOwnerOnEdge3)
 
 CPPUNIT_TEST (testDofOwnerOnQuad9)
 
 CPPUNIT_TEST (testDofOwnerOnTri6)
 
 CPPUNIT_TEST (testDofOwnerOnHex27)
 
 CPPUNIT_TEST_SUITE_END ()
 
void setUp ()
 
void tearDown ()
 
void testDofOwner (const ElemType elem_type)
 
void testDofOwnerOnEdge3 ()
 
void testDofOwnerOnQuad9 ()
 
void testDofOwnerOnTri6 ()
 
void testDofOwnerOnHex27 ()
 

Detailed Description

Definition at line 29 of file dof_map_test.C.

Member Function Documentation

DofMapTest::CPPUNIT_TEST ( testDofOwnerOnEdge3  )
DofMapTest::CPPUNIT_TEST ( testDofOwnerOnQuad9  )
DofMapTest::CPPUNIT_TEST ( testDofOwnerOnTri6  )
DofMapTest::CPPUNIT_TEST ( testDofOwnerOnHex27  )
DofMapTest::CPPUNIT_TEST_SUITE ( DofMapTest  )
DofMapTest::CPPUNIT_TEST_SUITE_END ( )
void DofMapTest::setUp ( )

Definition at line 43 of file dof_map_test.C.

44  {}
void DofMapTest::tearDown ( )

Definition at line 46 of file dof_map_test.C.

47  {}
void DofMapTest::testDofOwner ( const ElemType  elem_type)

Definition at line 49 of file dof_map_test.C.

References libMesh::EquationSystems::add_system(), libMesh::System::add_variable(), libMesh::Elem::build(), libMesh::MeshTools::Generation::build_cube(), libMesh::DofMap::dof_owner(), libMesh::DofMap::end_dof(), libMesh::DofMap::first_dof(), libMesh::System::get_dof_map(), libMesh::HIERARCHIC, libMesh::EquationSystems::init(), mesh, libMesh::DofMap::n_dofs(), libMesh::Real, libMesh::sys, TestCommWorld, and libMesh::THIRD.

50  {
52 
54  System &sys = es.add_system<System> ("SimpleSystem");
55  sys.add_variable("u", THIRD, HIERARCHIC);
56 
57  const unsigned n_elem_per_side = 3;
58  const UniquePtr<Elem> test_elem = Elem::build(elem_type);
59  const Real ymax = test_elem->dim() > 1;
60  const Real zmax = test_elem->dim() > 2;
61  const unsigned int ny = ymax * n_elem_per_side;
62  const unsigned int nz = zmax * n_elem_per_side;
63 
65  n_elem_per_side,
66  ny,
67  nz,
68  0., 1.,
69  0., ymax,
70  0., zmax,
71  elem_type);
72 
73  es.init();
74 
75  DofMap & dof_map = sys.get_dof_map();
76  for (dof_id_type id = 0; id != dof_map.n_dofs(); ++id)
77  {
78  const processor_id_type pid = dof_map.dof_owner(id);
79  CPPUNIT_ASSERT(dof_map.first_dof(pid) <= id);
80  CPPUNIT_ASSERT(id < dof_map.end_dof(pid));
81  }
82  }
This is the EquationSystems class.
libMesh::Parallel::Communicator * TestCommWorld
Definition: driver.C:28
ImplicitSystem & sys
unsigned int add_variable(const std::string &var, const FEType &type, const std::set< subdomain_id_type > *const active_subdomains=libmesh_nullptr)
Adds the variable var to the list of variables for this system.
Definition: system.C:1101
MeshBase & mesh
uint8_t processor_id_type
Definition: id_types.h:99
processor_id_type dof_owner(const dof_id_type dof) const
Definition: dof_map.h:586
dof_id_type n_dofs() const
Definition: dof_map.h:510
std::unique_ptr< T > UniquePtr
Definition: auto_ptr.h:46
This class handles the numbering of degrees of freedom on a mesh.
Definition: dof_map.h:167
dof_id_type first_dof(const processor_id_type proc) const
Definition: dof_map.h:535
dof_id_type end_dof(const processor_id_type proc) const
Definition: dof_map.h:577
const DofMap & get_dof_map() const
Definition: system.h:2030
This is the base class for classes which contain information related to any physical process that mig...
Definition: system.h:76
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
Definition: mesh.h:50
void build_cube(UnstructuredMesh &mesh, const unsigned int nx=0, const unsigned int ny=0, const unsigned int nz=0, const Real xmin=0., const Real xmax=1., const Real ymin=0., const Real ymax=1., const Real zmin=0., const Real zmax=1., const ElemType type=INVALID_ELEM, const bool gauss_lobatto_grid=false)
Builds a (elements) cube.
uint8_t dof_id_type
Definition: id_types.h:64
void DofMapTest::testDofOwnerOnEdge3 ( )

Definition at line 86 of file dof_map_test.C.

References libMesh::EDGE3.

86 { testDofOwner(EDGE3); }
void testDofOwner(const ElemType elem_type)
Definition: dof_map_test.C:49
void DofMapTest::testDofOwnerOnHex27 ( )

Definition at line 89 of file dof_map_test.C.

References CPPUNIT_TEST_SUITE_REGISTRATION(), and libMesh::HEX27.

89 { testDofOwner(HEX27); }
void testDofOwner(const ElemType elem_type)
Definition: dof_map_test.C:49
void DofMapTest::testDofOwnerOnQuad9 ( )

Definition at line 87 of file dof_map_test.C.

References libMesh::QUAD9.

87 { testDofOwner(QUAD9); }
void testDofOwner(const ElemType elem_type)
Definition: dof_map_test.C:49
void DofMapTest::testDofOwnerOnTri6 ( )

Definition at line 88 of file dof_map_test.C.

References libMesh::TRI6.

88 { testDofOwner(TRI6); }
void testDofOwner(const ElemType elem_type)
Definition: dof_map_test.C:49

The documentation for this class was generated from the following file: