feat(cpp-object-oriented-modular-refactoring): step 3 - foundation-google-style

This commit is contained in:
KOKO\Mimi
2026-08-16 04:26:14 +09:00
parent 2628ed3488
commit 042edadffb
93 changed files with 3144 additions and 3175 deletions
+23 -23
View File
@@ -35,9 +35,9 @@ Result<SparseMatrix> assemblyFailure(
const SourceLocation& location,
const std::string& identity,
const std::string& message) {
return Result<SparseMatrix>::failure(Status::failure(
FailureCategory::model,
{{Severity::error,
return Result<SparseMatrix>::Failure(Status::Failure(
FailureCategory::kModel,
{{Severity::kError,
code,
location,
"*ELEMENT",
@@ -112,7 +112,7 @@ Result<SparseMatrix> SparseAssembler::assembleStiffness(
return assemblyFailure(
"invalid-assembly-element",
element.location,
element.sourceId.sourceLabelText,
element.sourceId.source_label_text,
"Shell element references an entity outside the Domain.");
}
@@ -126,7 +126,7 @@ Result<SparseMatrix> SparseAssembler::assembleStiffness(
return assemblyFailure(
"invalid-assembly-scatter",
element.location,
element.sourceId.sourceLabelText,
element.sourceId.source_label_text,
"DofManager does not contain the active shell scatter.");
}
for (std::size_t nodePosition = 0U;
@@ -138,7 +138,7 @@ Result<SparseMatrix> SparseAssembler::assembleStiffness(
return assemblyFailure(
"invalid-assembly-element",
element.location,
element.sourceId.sourceLabelText,
element.sourceId.source_label_text,
"Shell element requires a valid node and initial director.");
}
input.nodes[nodePosition] = &domain.nodes()[nodeIndex];
@@ -156,7 +156,7 @@ Result<SparseMatrix> SparseAssembler::assembleStiffness(
return assemblyFailure(
"invalid-assembly-scatter",
element.location,
element.sourceId.sourceLabelText,
element.sourceId.source_label_text,
"Shell scatter does not match the active model topology.");
}
}
@@ -175,13 +175,13 @@ Result<SparseMatrix> SparseAssembler::assembleStiffness(
input.directors,
*input.section,
*input.material);
if (!shell.hasValue()) {
localFailures[elementOrder] = shell.status();
if (!shell.HasValue()) {
localFailures[elementOrder] = shell.GetStatus();
return;
}
const auto stiffness = shell.value().stiffness();
if (!stiffness.hasValue()) {
localFailures[elementOrder] = stiffness.status();
const auto stiffness = shell.Value().stiffness();
if (!stiffness.HasValue()) {
localFailures[elementOrder] = stiffness.GetStatus();
return;
}
@@ -197,7 +197,7 @@ Result<SparseMatrix> SparseAssembler::assembleStiffness(
buffer[localOrder] = {
input.scatter[localRow],
input.scatter[localColumn],
stiffness.value().stabilizedGlobal24(
stiffness.Value().stabilizedGlobal24(
localRow, localColumn),
elementOrder,
localOrder};
@@ -209,7 +209,7 @@ Result<SparseMatrix> SparseAssembler::assembleStiffness(
elementOrder < localFailures.size();
++elementOrder) {
if (localFailures[elementOrder]) {
return Result<SparseMatrix>::failure(
return Result<SparseMatrix>::Failure(
*localFailures[elementOrder]);
}
}
@@ -223,7 +223,7 @@ Result<SparseMatrix> SparseAssembler::assembleStiffness(
contributions.insert(
contributions.end(), buffer.begin(), buffer.end());
}
return SparseMatrix::fromCoo(
return SparseMatrix::FromCoo(
dofs.fullDofCount(),
dofs.fullDofCount(),
std::move(contributions),
@@ -258,7 +258,7 @@ Result<SparseMatrix> SparseAssembler::assembleStiffness(
return assemblyFailure(
"invalid-assembly-element",
element.location,
element.sourceId.sourceLabelText,
element.sourceId.source_label_text,
"Element references an entity outside the Domain.");
}
@@ -269,7 +269,7 @@ Result<SparseMatrix> SparseAssembler::assembleStiffness(
return assemblyFailure(
"invalid-assembly-scatter",
element.location,
element.sourceId.sourceLabelText,
element.sourceId.source_label_text,
"DofManager does not contain the active element scatter.");
}
for (std::size_t endpoint = 0U; endpoint < 2U; ++endpoint) {
@@ -286,7 +286,7 @@ Result<SparseMatrix> SparseAssembler::assembleStiffness(
return assemblyFailure(
"invalid-assembly-scatter",
element.location,
element.sourceId.sourceLabelText,
element.sourceId.source_label_text,
"Element scatter does not match the active model topology.");
}
}
@@ -307,12 +307,12 @@ Result<SparseMatrix> SparseAssembler::assembleStiffness(
domain.nodes()[definition.nodeIndices[1U]],
domain.sections()[definition.sectionIndex],
domain.materials()[definition.materialIndex]);
if (!beam.hasValue()) {
localFailures[elementOrder] = beam.status();
if (!beam.HasValue()) {
localFailures[elementOrder] = beam.GetStatus();
return;
}
const Matrix stiffness = beam.value().globalStiffness();
const Matrix stiffness = beam.Value().globalStiffness();
auto& buffer = localBuffers[elementOrder];
const auto& scatter = scatters[elementOrder];
for (std::size_t localRow = 0U;
@@ -337,7 +337,7 @@ Result<SparseMatrix> SparseAssembler::assembleStiffness(
elementOrder < localFailures.size();
++elementOrder) {
if (localFailures[elementOrder]) {
return Result<SparseMatrix>::failure(
return Result<SparseMatrix>::Failure(
*localFailures[elementOrder]);
}
}
@@ -350,7 +350,7 @@ Result<SparseMatrix> SparseAssembler::assembleStiffness(
contributions.insert(
contributions.end(), buffer.begin(), buffer.end());
}
return SparseMatrix::fromCoo(
return SparseMatrix::FromCoo(
dofs.fullDofCount(),
dofs.fullDofCount(),
std::move(contributions),