feat(nonlinear-static-newton-raphson): step 10 - prepared-analysis-flow-and-full-procedure

This commit is contained in:
KOKO\Mimi
2026-08-24 15:49:08 +09:00
parent 3a443e08af
commit f0f38b9803
16 changed files with 1373 additions and 223 deletions
+3 -43
View File
@@ -1,18 +1,7 @@
#ifndef FESA_ANALYSIS_LINEAR_STATIC_ANALYSIS_H_
#define FESA_ANALYSIS_LINEAR_STATIC_ANALYSIS_H_
#include <memory>
#include <vector>
#include "fesa/analysis/analysis.h"
#include "fesa/analysis/analysis_model.h"
#include "fesa/analysis/analysis_state.h"
#include "fesa/constraints/essential_constraint_policy.h"
#include "fesa/elements/element.h"
#include "fesa/fem/dof_manager.h"
#include "fesa/math/sparse_matrix.h"
#include "fesa/math/vector.h"
#include "fesa/model/domain.h"
namespace fesa {
@@ -20,9 +9,8 @@ class LinearSolver;
class ParallelFor;
class ResultsWriter;
/// @brief Orchestrates the single-step linear-static procedure.
/// @note Factorization, substitution, recovery, and writing remain separately
/// observable through injected backend boundaries.
/// @brief Retains the legacy Analysis facade for linear-static callers.
/// @note Numerical stages are owned by LinearStaticProcedureExecutor.
class LinearStaticAnalysis final : public Analysis {
public:
/// @brief Creates a procedure using non-owned backend adapters.
@@ -31,42 +19,14 @@ class LinearStaticAnalysis final : public Analysis {
LinearSolver& linear_solver,
ResultsWriter& results_writer);
/// @brief Runs the approved eight-stage linear-static lifecycle.
/// @brief Prepares, executes, and writes a linear-static analysis.
/// @return The first stage failure or successful result finalization.
Status Run(const AnalysisRequest& request) override;
private:
/// @brief Initializes owned input and Domain state for a run candidate.
Status InitializeCandidate(const AnalysisRequest& request);
/// @brief Builds the non-owning active-model view.
Status BuildAnalysisModel();
/// @brief Creates runtime elements, stable DOFs, and the sparse pattern.
Status BuildDofMapAndSparsePattern();
/// @brief Assembles full stiffness and stable constraint partitions.
Status AssembleAndPartitionStiffness();
/// @brief Factorizes Kff before any load assembly.
Status FactorizeFreeSystem();
/// @brief Assembles loads and forms Ff-Kfc*dc without solving.
Status AssembleLoadsAndEffectiveRhs();
/// @brief Substitutes the retained factorization and reconstructs full d.
Status SubstituteAndReconstruct();
/// @brief Recovers a complete candidate before writing authoritative output.
Status RecoverAndWrite();
const ParallelFor& parallel_for_;
LinearSolver& linear_solver_;
ResultsWriter& results_writer_;
AnalysisRequest request_;
std::unique_ptr<Domain> domain_;
std::unique_ptr<AnalysisModel> model_;
std::vector<std::unique_ptr<Element>> elements_;
ElementView element_view_;
std::unique_ptr<DofManager> dofs_;
std::unique_ptr<AnalysisState> state_;
std::unique_ptr<SparseMatrix> full_stiffness_;
std::unique_ptr<PartitionedStiffness> partitioned_stiffness_;
std::unique_ptr<Vector> effective_rhs_;
std::vector<Diagnostic> diagnostics_;
};
} // namespace fesa