feat(cpp-object-oriented-modular-refactoring): step 5 - solver-workflow-google-style

This commit is contained in:
KOKO\Mimi
2026-08-16 06:20:08 +09:00
parent e1c0e357dd
commit 24f006fe4a
52 changed files with 5817 additions and 6369 deletions
@@ -0,0 +1,41 @@
#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_
@@ -1,35 +0,0 @@
#pragma once
#include "fesa/core/status.h"
#include "fesa/math/sparse_matrix.h"
#include "fesa/math/vector.h"
namespace fesa {
class DofManager;
struct PartitionedStiffness {
SparseMatrix kff;
SparseMatrix kfc;
SparseMatrix kcf;
SparseMatrix kcc;
};
// Applies the DofManager's stable elimination order without owning equation
// numbering, load assembly, or a solver policy.
class EssentialConstraints {
public:
static Result<PartitionedStiffness> partition(
const SparseMatrix& full,
const DofManager& dofs);
static Vector gatherFree(const Vector& full, const DofManager& dofs);
static Vector gatherConstrained(
const Vector& full,
const DofManager& dofs);
static Vector reconstructFull(
const Vector& freeValues,
const Vector& constrainedValues,
const DofManager& dofs);
};
} // namespace fesa