feat(linear-static-3d-euler-beam): step 15 - analysis-state

This commit is contained in:
KOKO\Mimi
2026-08-09 17:32:06 +09:00
parent 25bbfd5ac2
commit 90a2f64ba4
8 changed files with 514 additions and 0 deletions
+52
View File
@@ -0,0 +1,52 @@
#pragma once
#include "fesa/fem/dof_manager.hpp"
#include "fesa/math/vector.hpp"
#include "fesa/results/result_records.hpp"
#include <cstddef>
#include <vector>
namespace fesa {
// Owns only the mutable quantities required by the V0 linear-static frame.
class AnalysisState {
public:
static AnalysisState create(
const DofManager& dofs, StepFrameIdentity identity);
Vector& displacement() noexcept;
const Vector& displacement() const noexcept;
Vector& externalForce() noexcept;
const Vector& externalForce() const noexcept;
Vector& internalForce() noexcept;
const Vector& internalForce() const noexcept;
Vector& residual() noexcept;
const Vector& residual() const noexcept;
Vector& reaction() noexcept;
const Vector& reaction() const noexcept;
const StepFrameIdentity& identity() const noexcept;
std::vector<EndpointResultRow>& endpointResults() noexcept;
const std::vector<EndpointResultRow>& endpointResults() const noexcept;
std::vector<GaussResultRow>& gaussResults() noexcept;
const std::vector<GaussResultRow>& gaussResults() const noexcept;
std::vector<StressS11Row>& stressResults() noexcept;
const std::vector<StressS11Row>& stressResults() const noexcept;
private:
AnalysisState(std::size_t fullDofCount, StepFrameIdentity identity);
StepFrameIdentity identity_;
Vector displacement_;
Vector externalForce_;
Vector internalForce_;
Vector residual_;
// Reactions retain full-index space so free residual components remain visible.
Vector reaction_;
// Recovery appends rows in stable element/location order.
std::vector<EndpointResultRow> endpointResults_;
std::vector<GaussResultRow> gaussResults_;
std::vector<StressS11Row> stressResults_;
};
} // namespace fesa
+41
View File
@@ -0,0 +1,41 @@
#pragma once
#include "fesa/model/model_types.hpp"
#include <array>
#include <cstddef>
#include <string>
namespace fesa {
struct StepFrameIdentity {
std::string stepName;
std::size_t frameIndex;
};
struct EndpointResultRow {
EntityIndex element;
int endpoint;
SourceEntityId node;
std::array<double, 6> endAction;
std::array<double, 4> sectionResultant;
};
struct GaussResultRow {
EntityIndex element;
int gaussPoint;
std::array<double, 4> generalizedStrain;
std::array<double, 4> generalizedResultant;
};
struct StressS11Row {
EntityIndex element;
int gaussPoint;
std::size_t sectionPoint;
double x1;
double x2;
double s11;
std::string source;
};
} // namespace fesa