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> 17 #ifdef LIBMESH_ENABLE_CONSTRAINTS 36 constraint_row[1] = 1.0;
42 constraint_row[0] = 1.0;
54 CPPUNIT_TEST( testDofOwnerOnEdge3 );
56 CPPUNIT_TEST( testDofOwnerOnQuad9 );
57 CPPUNIT_TEST( testDofOwnerOnTri6 );
60 CPPUNIT_TEST( testDofOwnerOnHex27 );
63 #if defined(LIBMESH_ENABLE_EXCEPTIONS) 64 CPPUNIT_TEST( testBadElemFECombo );
67 #if defined(LIBMESH_ENABLE_CONSTRAINTS) && defined(LIBMESH_ENABLE_EXCEPTIONS) && LIBMESH_DIM > 1 68 CPPUNIT_TEST( testConstraintLoopDetection );
71 CPPUNIT_TEST_SUITE_END();
90 const unsigned int n_elem_per_side = 3;
91 const std::unique_ptr<Elem> test_elem =
Elem::build(elem_type);
92 const unsigned int ymax = test_elem->dim() > 1;
93 const unsigned int zmax = test_elem->dim() > 2;
94 const unsigned int ny = ymax * n_elem_per_side;
95 const unsigned int nz = zmax * n_elem_per_side;
112 CPPUNIT_ASSERT(dof_map.
first_dof(pid) <= id);
113 CPPUNIT_ASSERT(
id < dof_map.
end_dof(pid));
124 #if defined(LIBMESH_ENABLE_EXCEPTIONS) 149 bool threw_desired_exception =
false;
154 std::regex msg_regex(
"only supports FEInterface::max_order");
155 CPPUNIT_ASSERT(std::regex_search(e.what(), msg_regex));
156 threw_desired_exception =
true;
159 CPPUNIT_ASSERT_MESSAGE(
"Unexpected exception type thrown",
false);
166 CPPUNIT_ASSERT(threw_desired_exception);
170 #if defined(LIBMESH_ENABLE_CONSTRAINTS) && defined(LIBMESH_ENABLE_EXCEPTIONS) ElemType
Defines an enum for geometric element types.
dof_id_type end_dof(const processor_id_type proc) const
This is the EquationSystems class.
void testDofOwnerOnQuad9()
processor_id_type dof_owner(const dof_id_type dof) const
void testConstraintLoopDetection()
libMesh::Parallel::Communicator * TestCommWorld
const Parallel::Communicator & comm() const
dof_id_type n_dofs(const unsigned int vn) const
The libMesh namespace provides an interface to certain functionality in the library.
void set_error_on_constraint_loop(bool error_on_constraint_loop)
dof_id_type n_local_elem() const
void testDofOwnerOnEdge3()
void attach_constraint_object(Constraint &constrain)
Register a user object for imposing constraints.
void testDofOwner(const ElemType elem_type)
This class handles the numbering of degrees of freedom on a mesh.
uint8_t processor_id_type
void testDofOwnerOnTri6()
void min(const T &r, T &o, Request &req) const
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 ...
Manages consistently variables, degrees of freedom, and coefficient vectors.
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
unsigned int add_variable(std::string_view 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.
void max(const T &r, T &o, Request &req) const
A class to represent the internal "this should never happen" errors, to be thrown by "libmesh_error()...
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.
void constrain()
Constraint function.
Abstract base class to be used for system constraints.
void testBadElemFECombo()
virtual void init()
Initialize all the systems.
dof_id_type first_dof(const processor_id_type proc) const
virtual System & add_system(std::string_view system_type, std::string_view name)
Add the system of type system_type named name to the systems array.
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
void testDofOwnerOnHex27()
const DofMap & get_dof_map() const
CPPUNIT_TEST_SUITE_REGISTRATION(DofMapTest)
MyConstraint(System &sys)