feat(cpp-object-oriented-modular-refactoring): step 22 - result-recovery-modules

This commit is contained in:
KOKO\Mimi
2026-08-16 12:52:11 +09:00
parent 2b0f556a79
commit f60d4edc26
14 changed files with 1373 additions and 369 deletions
+39
View File
@@ -0,0 +1,39 @@
#include "results/recovery_candidate.h"
#include <cstddef>
#include <string>
namespace fesa::results_internal {
RecoveryCandidate::RecoveryCandidate(const std::size_t full_dof_count)
: displacement{full_dof_count},
external_force{full_dof_count},
internal_force{full_dof_count},
residual{full_dof_count},
reaction{full_dof_count} {}
Status RecoveryFailure(const std::string& code, const SourceLocation& location,
const std::string& identity,
const std::string& message) {
return Status::Failure(FailureCategory::kModel,
{{Severity::kError, code, location, "RESULT_RECOVERY",
identity, message}});
}
bool SameSourceIdentity(const SourceEntityId& left,
const SourceEntityId& right) {
return left.instance_name == right.instance_name &&
left.source_label == right.source_label &&
left.source_label_text == right.source_label_text;
}
bool IsFiniteVector(const Vector& values) {
for (std::size_t index = 0U; index < values.Size(); ++index) {
if (!std::isfinite(values[index])) {
return false;
}
}
return true;
}
} // namespace fesa::results_internal