42 lines
1.3 KiB
C++
42 lines
1.3 KiB
C++
#ifndef FESA_CONSTRAINTS_ESSENTIAL_CONSTRAINTS_H_
|
|
#define FESA_CONSTRAINTS_ESSENTIAL_CONSTRAINTS_H_
|
|
|
|
#include "fesa/core/status.h"
|
|
#include "fesa/math/sparse_matrix.h"
|
|
#include "fesa/math/vector.h"
|
|
|
|
namespace fesa {
|
|
|
|
class DofManager;
|
|
|
|
/// @brief Stores full-stiffness blocks in stable free/constrained order.
|
|
struct PartitionedStiffness {
|
|
SparseMatrix kff;
|
|
SparseMatrix kfc;
|
|
SparseMatrix kcf;
|
|
SparseMatrix kcc;
|
|
};
|
|
|
|
/// @brief Applies stable prescribed-displacement elimination.
|
|
class EssentialConstraints {
|
|
public:
|
|
/// @brief Partitions full stiffness into Kff, Kfc, Kcf, and Kcc.
|
|
static Result<PartitionedStiffness> Partition(const SparseMatrix& full,
|
|
const DofManager& dofs);
|
|
|
|
/// @brief Gathers a full vector in stable free-equation order.
|
|
static Vector GatherFree(const Vector& full, const DofManager& dofs);
|
|
|
|
/// @brief Gathers a full vector in stable constrained-DOF order.
|
|
static Vector GatherConstrained(const Vector& full, const DofManager& dofs);
|
|
|
|
/// @brief Reconstructs full d from stable df and exact prescribed dc.
|
|
static Vector ReconstructFull(const Vector& free_values,
|
|
const Vector& constrained_values,
|
|
const DofManager& dofs);
|
|
};
|
|
|
|
} // namespace fesa
|
|
|
|
#endif // FESA_CONSTRAINTS_ESSENTIAL_CONSTRAINTS_H_
|