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 15 of file dof_map_test.C.

Constructor & Destructor Documentation

◆ MyConstraint()

MyConstraint::MyConstraint ( System sys)
inline

Definition at line 23 of file dof_map_test.C.

23 : Constraint(), _sys(sys) {}

◆ ~MyConstraint()

virtual MyConstraint::~MyConstraint ( )
inlinevirtual

Definition at line 25 of file dof_map_test.C.

25 {}

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 27 of file dof_map_test.C.

28  {
29  {
30  const dof_id_type constrained_dof_index = 0;
31  DofConstraintRow constraint_row;
32  constraint_row[1] = 1.0;
33  _sys.get_dof_map().add_constraint_row( constrained_dof_index, constraint_row, 0., true);
34  }
35  {
36  const dof_id_type constrained_dof_index = 1;
37  DofConstraintRow constraint_row;
38  constraint_row[0] = 1.0;
39  _sys.get_dof_map().add_constraint_row( constrained_dof_index, constraint_row, 0., true);
40  }
41  }

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

Member Data Documentation

◆ _sys

System& MyConstraint::_sys
private

Definition at line 19 of file dof_map_test.C.


The documentation for this class was generated from the following file:
libMesh::dof_id_type
uint8_t dof_id_type
Definition: id_types.h:67
libMesh::System::get_dof_map
const DofMap & get_dof_map() const
Definition: system.h:2099
MyConstraint::_sys
System & _sys
Definition: dof_map_test.C:19
libMesh::DofMap::add_constraint_row
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 ...
Definition: dof_map_constraints.C:1364
libMesh::DofConstraintRow
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:97