libMesh
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
GhostDofConstraint Class Reference
Inheritance diagram for GhostDofConstraint:
[legend]

Public Member Functions

 GhostDofConstraint (System &sys)
 
void constrain () override
 

Private Attributes

System & _sys
 

Detailed Description

Definition at line 50 of file dof_map_test.C.

Constructor & Destructor Documentation

◆ GhostDofConstraint()

GhostDofConstraint::GhostDofConstraint ( System &  sys)
inline

Definition at line 58 of file dof_map_test.C.

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

Member Function Documentation

◆ constrain()

void GhostDofConstraint::constrain ( )
inlineoverride

Definition at line 60 of file dof_map_test.C.

61 {
62 const unsigned int sys_num = _sys.number();
63
64 // Constrain the interface DOF on node 3 by the distant DOF on node 0.
65 // On the processor owning element 3, both DOFs are nonlocal, but only
66 // node 3 is directly needed by the local element.
67 const dof_id_type constrained_dof =
68 _sys.get_mesh().node_ref(3).dof_number(sys_num, 0, 0);
69 const dof_id_type dependency_dof =
70 _sys.get_mesh().node_ref(0).dof_number(sys_num, 0, 0);
71
72 // This represents constrained_dof = dependency_dof.
73 DofConstraintRow constraint_row;
74 constraint_row[dependency_dof] = 1.;
75 _sys.get_dof_map().add_constraint_row(constrained_dof, constraint_row);
76 }
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 ...
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
virtual const Node & node_ref(const dof_id_type i) const
Definition mesh_base.h:742
const DofMap & get_dof_map() const
Definition system.h:2417
unsigned int number() const
Definition system.h:2393
const MeshBase & get_mesh() const
Definition system.h:2401
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
uint8_t dof_id_type
Definition id_types.h:67

References _sys, libMesh::DofMap::add_constraint_row(), libMesh::DofObject::dof_number(), libMesh::System::get_dof_map(), libMesh::System::get_mesh(), libMesh::MeshBase::node_ref(), and libMesh::System::number().

Member Data Documentation

◆ _sys

System& GhostDofConstraint::_sys
private

Definition at line 54 of file dof_map_test.C.

Referenced by constrain().


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