template<class Scalar>
ConstraintMap class
Read-only expansion map for value and identification constraints.
Identification constraints are stored as rows of the expansion map . For unconstrained DOFs, expand() returns the identity row { { i, 1 } }.
The map supports canonicalization of identification constraints:
- duplicate masters are merged;
- zero coefficients are pruned;
- self-references are removed algebraically;
- identity constraints are ignored;
- constraints such as , , are converted to fixed constraints;
- transitive identifications are flattened by finalize.
After calling finalize, this object can be shared by OpenMP assembly loops as a read-only expansion map.
Public types
Constructors, destructors, conversion operators
- ConstraintMap(size_t size) explicit
- Constructs an identity constraint map.
Public functions
- void reset(size_t size)
- Resets the map to the identity expansion on
sizeDOFs. - auto size() const -> size_t
- Gets the number of DOFs represented by the map.
- auto isFixed(Index i) const -> bool
- Tests whether a DOF is fixed to a value.
- auto isIdentified(Index i) const -> bool
- Tests whether a DOF is identified with master DOFs.
- auto getFixedValue(Index i) const -> Scalar
- Gets the prescribed value for a fixed DOF.
- auto expand(Index i) const -> const Expansion&
- Expands a DOF into its master DOF row.
- auto getIdentifiedRows() const -> const std::vector<Index>&
- Gets the indices of rows carrying identification constraints.
- auto getIdentificationValue(Index i) const -> Scalar
- Gets the affine defect value for an identified DOF.
- void setFixed(Index i, Scalar value)
- Marks a DOF as fixed to a prescribed value.
-
template<class Entries>void setIdentification(Index slave, const Entries& entries)
- Sets a homogeneous identification row.
-
template<class Entries>void setIdentification(Index slave, const Entries& entries, Scalar value)
- Sets an affine identification row.
- void finalize()
- Flattens transitive identification constraints.
Function documentation
template<class Scalar>
Rodin:: Assembly:: ConstraintMap<Scalar>:: ConstraintMap(size_t size) explicit
Constructs an identity constraint map.
| Parameters | |
|---|---|
| size | Number of DOFs represented by the map. |
template<class Scalar>
void Rodin:: Assembly:: ConstraintMap<Scalar>:: reset(size_t size)
Resets the map to the identity expansion on size DOFs.
| Parameters | |
|---|---|
| size | Number of DOFs represented by the map. |
template<class Scalar>
size_t Rodin:: Assembly:: ConstraintMap<Scalar>:: size() const
Gets the number of DOFs represented by the map.
| Returns | Number of expansion rows. |
|---|
template<class Scalar>
bool Rodin:: Assembly:: ConstraintMap<Scalar>:: isIdentified(Index i) const
Tests whether a DOF is identified with master DOFs.
| Parameters | |
|---|---|
| i | DOF index. |
template<class Scalar>
Scalar Rodin:: Assembly:: ConstraintMap<Scalar>:: getFixedValue(Index i) const
Gets the prescribed value for a fixed DOF.
| Parameters | |
|---|---|
| i | Fixed DOF index. |
| Returns | Prescribed scalar value. |
template<class Scalar>
const std::vector<Index>& Rodin:: Assembly:: ConstraintMap<Scalar>:: getIdentifiedRows() const
Gets the indices of rows carrying identification constraints.
| Returns | Identified slave DOF indices. |
|---|
template<class Scalar>
Scalar Rodin:: Assembly:: ConstraintMap<Scalar>:: getIdentificationValue(Index i) const
Gets the affine defect value for an identified DOF.
| Parameters | |
|---|---|
| i | Identified slave DOF index. |
| Returns | Constant term in the identification row. |
template<class Scalar>
template<class Entries>
void Rodin:: Assembly:: ConstraintMap<Scalar>:: setIdentification(Index slave,
const Entries& entries)
Sets a homogeneous identification row.
| Parameters | |
|---|---|
| slave | Slave DOF index. |
| entries | Master expansion entries. |
template<class Scalar>
template<class Entries>
void Rodin:: Assembly:: ConstraintMap<Scalar>:: setIdentification(Index slave,
const Entries& entries,
Scalar value)
Sets an affine identification row.
| Parameters | |
|---|---|
| slave | Slave DOF index. |
| entries | Master expansion entries. |
| value | Constant term in the identification. |
template<class Scalar>
void Rodin:: Assembly:: ConstraintMap<Scalar>:: finalize()
Flattens transitive identification constraints.
Example:
becomes:
Cycles such as , are rejected.