ConstraintMap
Read-only expansion map for value and identification constraints.
Defined in Rodin/Assembly/ConstraintMap.h
template < class Scalar> class ConstraintMap;
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
ConstraintMap(size_t size) explicit
Constructs an identity constraint map.
| Parameters | |
|---|---|
| size | Number of DOFs represented by the map. |
void reset(size_t size)
Resets the map to the identity expansion on size DOFs.
| Parameters | |
|---|---|
| size | Number of DOFs represented by the map. |
size_t size() const
Gets the number of DOFs represented by the map.
| Returns | Number of expansion rows. |
|---|
bool isIdentified(Index i) const
Tests whether a DOF is identified with master DOFs.
| Parameters | |
|---|---|
| i | DOF index. |
| Returns | Whether the degree of freedom is identified with master degrees of freedom. |
Scalar getFixedValue(Index i) const
Gets the prescribed value for a fixed DOF.
| Parameters | |
|---|---|
| i | Fixed DOF index. |
| Returns | Prescribed scalar value. |
const std::vector<Index>& getIdentifiedRows() const
Gets the indices of rows carrying identification constraints.
| Returns | Identified slave DOF indices. |
|---|
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 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 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. |
void finalize()
Flattens transitive identification constraints.
Example:
becomes:
Cycles such as , are rejected.