Go to the documentation of this file. 1 #include <libmesh/equation_systems.h>
2 #include <libmesh/mesh.h>
3 #include <libmesh/mesh_generation.h>
4 #include <libmesh/elem.h>
5 #include <libmesh/dof_map.h>
13 #ifdef LIBMESH_ENABLE_CONSTRAINTS
32 constraint_row[1] = 1.0;
38 constraint_row[0] = 1.0;
50 CPPUNIT_TEST( testDofOwnerOnEdge3 );
52 CPPUNIT_TEST( testDofOwnerOnQuad9 );
53 CPPUNIT_TEST( testDofOwnerOnTri6 );
56 CPPUNIT_TEST( testDofOwnerOnHex27 );
59 #if defined(LIBMESH_ENABLE_CONSTRAINTS) && defined(LIBMESH_ENABLE_EXCEPTIONS) && LIBMESH_DIM > 1
60 CPPUNIT_TEST( testConstraintLoopDetection );
63 CPPUNIT_TEST_SUITE_END();
82 const unsigned int n_elem_per_side = 3;
83 const std::unique_ptr<Elem> test_elem =
Elem::build(elem_type);
84 const unsigned int ymax = test_elem->dim() > 1;
85 const unsigned int zmax = test_elem->dim() > 2;
86 const unsigned int ny = ymax * n_elem_per_side;
87 const unsigned int nz = zmax * n_elem_per_side;
104 CPPUNIT_ASSERT(dof_map.
first_dof(pid) <= id);
105 CPPUNIT_ASSERT(
id < dof_map.
end_dof(pid));
116 #if defined(LIBMESH_ENABLE_CONSTRAINTS) && defined(LIBMESH_ENABLE_EXCEPTIONS)
Manages consistently variables, degrees of freedom, and coefficient vectors.
void constrain()
Constraint function.
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
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.
dof_id_type n_dofs() const
MyConstraint(System &sys)
The libMesh namespace provides an interface to certain functionality in the library.
A class to represent the internal "this should never happen" errors, to be thrown by "libmesh_error()...
dof_id_type first_dof(const processor_id_type proc) const
void attach_constraint_object(Constraint &constrain)
Register a user object for imposing constraints.
void testDofOwnerOnHex27()
void set_error_on_constraint_loop(bool error_on_constraint_loop)
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.
uint8_t processor_id_type
void testDofOwnerOnQuad9()
This is the EquationSystems class.
Abstract base class to be used for system constraints.
void testConstraintLoopDetection()
This class handles the numbering of degrees of freedom on a mesh.
CPPUNIT_TEST_SUITE_REGISTRATION(DofMapTest)
void testDofOwnerOnEdge3()
const DofMap & get_dof_map() const
void testDofOwner(const ElemType elem_type)
void testDofOwnerOnTri6()
void add_constraint_row(const dof_id_type dof_number, const DofConstraintRow &constraint_row, const Number constraint_rhs, const bool forbid_constraint_overwrite)
Adds a copy of the user-defined row to the constraint matrix, using an inhomogeneous right-hand-side ...
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
processor_id_type dof_owner(const dof_id_type dof) const
std::map< dof_id_type, Real, std::less< dof_id_type >, Threads::scalable_allocator< std::pair< const dof_id_type, Real > > > DofConstraintRow
A row of the Dof constraint matrix.
ElemType
Defines an enum for geometric element types.
dof_id_type end_dof(const processor_id_type proc) const