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
+11 -11
View File
@@ -1,11 +1,11 @@
#include "reference_comparison.hpp"
#include "fesa/analysis/analysis_model.hpp"
#include "fesa/assembly/load_assembler.hpp"
#include "fesa/fem/dof_manager.hpp"
#include "fesa/analysis/analysis_model.h"
#include "fesa/assembly/load_assembler.h"
#include "fesa/fem/dof_manager.h"
#include "fesa/io/abaqus/domain_mapper.hpp"
#include "fesa/io/abaqus/input_reader.hpp"
#include "fesa/results/result_recovery.hpp"
#include "fesa/results/result_recovery.h"
#include <hdf5.h>
@@ -962,7 +962,7 @@ std::vector<NodeStationResultRow> normalizeStations(
const Domain& domain,
const HdfProjection& hdf,
const ReferenceTable& sectionTable) {
auto modelResult = AnalysisModel::create(domain);
auto modelResult = AnalysisModel::Create(domain);
if (!modelResult.HasValue()) {
fail("schema-mismatch", "The approved input cannot create an analysis view.");
}
@@ -991,7 +991,7 @@ std::vector<NodeStationResultRow> normalizeStations(
values});
}
}
auto normalized = ResultRecovery::normalizeSectionResultantsToNodeStations(
auto normalized = ResultRecovery::NormalizeSectionResultantsToNodeStations(
model, endpoints, tolerances);
if (!normalized.HasValue()) {
const auto& diagnostics = normalized.GetStatus().Diagnostics();
@@ -1079,7 +1079,7 @@ void appendSectionRows(
for (std::size_t component = 0U; component < components.size(); ++component) {
auto fesa = canonicalRow(
hdf.nodes[node], ComparisonQuantity::sectionResultant,
components[component], station.sectionResultant[component],
components[component], station.section_resultant[component],
units[component], "beam-local", kSectionPath);
auto abaqus = canonicalRow(
hdf.nodes[node], ComparisonQuantity::sectionResultant,
@@ -1164,17 +1164,17 @@ void evaluateGroup(
PhysicsEvidence makePhysicsEvidence(
const Domain& domain,
const HdfProjection& hdf) {
auto modelResult = AnalysisModel::create(domain);
auto modelResult = AnalysisModel::Create(domain);
if (!modelResult.HasValue()) {
fail("schema-mismatch", "The approved input cannot create physics evidence.");
}
const AnalysisModel model = std::move(modelResult.Value());
auto dofsResult = DofManager::create(model);
auto dofsResult = DofManager::Create(model);
if (!dofsResult.HasValue()) {
fail("schema-mismatch", "The approved input cannot create a DOF map.");
}
const DofManager dofs = std::move(dofsResult.Value());
auto loadResult = LoadAssembler::assembleFullNodalLoad(model, dofs);
auto loadResult = LoadAssembler::AssembleFullNodalLoad(model, dofs);
if (!loadResult.HasValue()) {
fail("schema-mismatch", "The approved input load cannot be assembled.");
}
@@ -1185,7 +1185,7 @@ PhysicsEvidence makePhysicsEvidence(
PhysicsEvidence evidence{};
long double residualSquared = 0.0L;
for (const std::size_t freeDof : dofs.freeDofs()) {
for (const std::size_t freeDof : dofs.FreeDofs()) {
const long double value =
static_cast<long double>(hdf.reaction[freeDof]);
residualSquared += value * value;
+15 -15
View File
@@ -1,8 +1,8 @@
#include "reference_comparison.hpp"
#include "fesa/analysis/analysis_model.hpp"
#include "fesa/analysis/analysis_state.hpp"
#include "fesa/fem/dof_manager.hpp"
#include "fesa/analysis/analysis_model.h"
#include "fesa/analysis/analysis_state.h"
#include "fesa/fem/dof_manager.h"
#include "fesa/io/abaqus/input_reader.hpp"
#include "fesa/io/hdf5/hdf5_results_writer.hpp"
#include "fesa/model/domain.h"
@@ -223,42 +223,42 @@ void writeResultsFixture(
throw std::runtime_error{"Reference fixture Domain construction failed."};
}
fesa::Domain domain = std::move(domainResult.Value());
auto modelResult = fesa::AnalysisModel::create(domain);
auto modelResult = fesa::AnalysisModel::Create(domain);
if (!modelResult.HasValue()) {
throw std::runtime_error{"Reference fixture AnalysisModel construction failed."};
}
fesa::AnalysisModel model = std::move(modelResult.Value());
auto dofsResult = fesa::DofManager::create(model);
auto dofsResult = fesa::DofManager::Create(model);
if (!dofsResult.HasValue()) {
throw std::runtime_error{"Reference fixture DofManager construction failed."};
}
fesa::DofManager dofs = std::move(dofsResult.Value());
fesa::AnalysisState state =
fesa::AnalysisState::create(dofs, {"Step-1", 0U});
fesa::AnalysisState::Create(dofs, {"Step-1", 0U});
for (std::size_t node = 0U; node < kNodeCount; ++node) {
for (std::size_t component = 0U; component < 6U; ++component) {
const std::size_t index = node * 6U + component;
state.displacement()[index] = values.displacement[node][component];
state.reaction()[index] = values.reaction[node][component];
state.residual()[index] = values.reaction[node][component];
state.Displacement()[index] = values.displacement[node][component];
state.Reaction()[index] = values.reaction[node][component];
state.Residual()[index] = values.reaction[node][component];
}
}
for (std::size_t element = 0U; element < kElementCount; ++element) {
for (std::size_t endpoint = 0U; endpoint < 2U; ++endpoint) {
const std::size_t node = element + endpoint;
state.endpointResults().push_back({
state.EndpointResults().push_back({
static_cast<fesa::EntityIndex>(element),
static_cast<int>(endpoint),
domain.Nodes()[node].source_id,
{},
values.sectionResultants[element][endpoint]});
}
state.gaussResults().push_back(
state.GaussResults().push_back(
{static_cast<fesa::EntityIndex>(element), 1, {}, {}});
state.gaussResults().push_back(
state.GaussResults().push_back(
{static_cast<fesa::EntityIndex>(element), 2, {}, {}});
state.stressResults().push_back({
state.StressResults().push_back({
static_cast<fesa::EntityIndex>(element),
1,
0U,
@@ -266,7 +266,7 @@ void writeResultsFixture(
0.0,
0.0,
"fesa-default"});
state.stressResults().push_back({
state.StressResults().push_back({
static_cast<fesa::EntityIndex>(element),
2,
0U,
@@ -277,7 +277,7 @@ void writeResultsFixture(
}
fesa::Hdf5ResultsWriter writer;
const fesa::Status status = writer.write(output, domain, state, {});
const fesa::Status status = writer.Write(output, domain, state, {});
if (!status.IsOk()) {
throw std::runtime_error{"Reference fixture HDF5 write failed."};
}