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

Public Member Functions

 MyConstraint (System &sys)
 
virtual ~MyConstraint ()
 
void constrain ()
 Constraint function. More...
 

Private Attributes

System_sys
 

Detailed Description

Definition at line 19 of file dof_map_test.C.

Constructor & Destructor Documentation

◆ MyConstraint()

MyConstraint::MyConstraint ( System sys)
inline

Definition at line 27 of file dof_map_test.C.

27 : Constraint(), _sys(sys) {}
System & _sys
Definition: dof_map_test.C:23

◆ ~MyConstraint()

virtual MyConstraint::~MyConstraint ( )
inlinevirtual

Definition at line 29 of file dof_map_test.C.

29 {}

Member Function Documentation

◆ constrain()

void MyConstraint::constrain ( )
inlinevirtual

Constraint function.

This function will be called to constrain the system prior to a solve and must be provided by the user in a derived class.

Implements libMesh::System::Constraint.

Definition at line 31 of file dof_map_test.C.

References libMesh::DofMap::add_constraint_row(), and libMesh::System::get_dof_map().

32  {
33  {
34  const dof_id_type constrained_dof_index = 0;
35  DofConstraintRow constraint_row;
36  constraint_row[1] = 1.0;
37  _sys.get_dof_map().add_constraint_row( constrained_dof_index, constraint_row, 0., true);
38  }
39  {
40  const dof_id_type constrained_dof_index = 1;
41  DofConstraintRow constraint_row;
42  constraint_row[0] = 1.0;
43  _sys.get_dof_map().add_constraint_row( constrained_dof_index, constraint_row, 0., true);
44  }
45  }
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 ...
System & _sys
Definition: dof_map_test.C:23
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.
Definition: dof_map.h:100
const DofMap & get_dof_map() const
Definition: system.h:2374
uint8_t dof_id_type
Definition: id_types.h:67

Member Data Documentation

◆ _sys

System& MyConstraint::_sys
private

Definition at line 23 of file dof_map_test.C.


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