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
+26 -26
View File
@@ -102,9 +102,9 @@ Result<ShellGeometry> geometryFailure(
std::string keyword,
std::string identity,
std::string message) {
return Result<ShellGeometry>::failure(Status::failure(
FailureCategory::model,
{{Severity::error,
return Result<ShellGeometry>::Failure(Status::Failure(
FailureCategory::kModel,
{{Severity::kError,
std::move(code),
location,
std::move(keyword),
@@ -153,14 +153,14 @@ bool sourceIdentityLess(
const Mitc4ShellDefinition& right,
std::size_t rightIndex) {
return std::tie(
left.sourceId.instanceName,
left.sourceId.sourceLabel,
left.sourceId.sourceLabelText,
left.sourceId.instance_name,
left.sourceId.source_label,
left.sourceId.source_label_text,
leftIndex) <
std::tie(
right.sourceId.instanceName,
right.sourceId.sourceLabel,
right.sourceId.sourceLabelText,
right.sourceId.instance_name,
right.sourceId.source_label,
right.sourceId.source_label_text,
rightIndex);
}
@@ -218,7 +218,7 @@ Result<ShellGeometry> preprocessShellGeometry(
if (element.nodeIndices[localNode] >= nodes.size()) {
return geometryFailure(
"invalid-shell-geometry", element.location, "ELEMENT",
element.sourceId.sourceLabelText,
element.sourceId.source_label_text,
"Shell geometry references an unavailable internal node.");
}
current.coordinates[localNode] =
@@ -226,7 +226,7 @@ Result<ShellGeometry> preprocessShellGeometry(
if (!isFinite(current.coordinates[localNode])) {
return geometryFailure(
"invalid-shell-geometry", element.location, "ELEMENT",
element.sourceId.sourceLabelText,
element.sourceId.source_label_text,
"Shell geometry contains a nonfinite source coordinate.");
}
}
@@ -237,7 +237,7 @@ Result<ShellGeometry> preprocessShellGeometry(
current.coordinates[first], current.coordinates[second])) {
return geometryFailure(
"invalid-shell-geometry", element.location, "ELEMENT",
element.sourceId.sourceLabelText,
element.sourceId.source_label_text,
"Shell geometry contains duplicate nodes.");
}
}
@@ -255,7 +255,7 @@ Result<ShellGeometry> preprocessShellGeometry(
!(centerMeasure > 0.0)) {
return geometryFailure(
"invalid-shell-geometry", element.location, "ELEMENT",
element.sourceId.sourceLabelText,
element.sourceId.source_label_text,
"Shell center has no finite nonzero normal candidate.");
}
current.normal = scale(1.0 / centerMeasure, centerCross);
@@ -268,7 +268,7 @@ Result<ShellGeometry> preprocessShellGeometry(
current.coordinates[3], current.coordinates[0], current.normal)) {
return geometryFailure(
"invalid-shell-geometry", element.location, "ELEMENT",
element.sourceId.sourceLabelText,
element.sourceId.source_label_text,
"Shell boundary is self-intersecting in the center-normal projection.");
}
@@ -286,7 +286,7 @@ Result<ShellGeometry> preprocessShellGeometry(
!(measure > 0.0) || !(dot(areaVector, current.normal) > 0.0)) {
return geometryFailure(
"invalid-shell-geometry", element.location, "ELEMENT",
element.sourceId.sourceLabelText,
element.sourceId.source_label_text,
"Shell surface is zero-area or locally reversed at a required point.");
}
areaWeight += measure;
@@ -294,7 +294,7 @@ Result<ShellGeometry> preprocessShellGeometry(
if (!std::isfinite(areaWeight) || !(areaWeight > 0.0)) {
return geometryFailure(
"invalid-shell-geometry", element.location, "ELEMENT",
element.sourceId.sourceLabelText,
element.sourceId.source_label_text,
"Shell surface-area weight is nonfinite or zero.");
}
current.areaWeight = areaWeight;
@@ -335,7 +335,7 @@ Result<ShellGeometry> preprocessShellGeometry(
if (!std::isfinite(pairDot) || !(pairDot > 0.0)) {
return geometryFailure(
"opposed-incident-normal", nodes[nodeIndex].location,
"NODE", nodes[nodeIndex].sourceId.sourceLabelText,
"NODE", nodes[nodeIndex].sourceId.source_label_text,
"Incident shell normal candidates do not share a positive orientation hemisphere.");
}
}
@@ -358,7 +358,7 @@ Result<ShellGeometry> preprocessShellGeometry(
!(directorNorm > 0.0)) {
return geometryFailure(
"invalid-shell-director", nodes[nodeIndex].location, "NODE",
nodes[nodeIndex].sourceId.sourceLabelText,
nodes[nodeIndex].sourceId.source_label_text,
"Area-weighted shell director is nonfinite or zero.");
}
const Vector3 director = scale(1.0 / directorNorm, directorSum);
@@ -384,7 +384,7 @@ Result<ShellGeometry> preprocessShellGeometry(
!(tangentNorm > 0.0)) {
return geometryFailure(
"invalid-shell-director", nodes[nodeIndex].location, "NODE",
nodes[nodeIndex].sourceId.sourceLabelText,
nodes[nodeIndex].sourceId.source_label_text,
"Least-aligned-axis tangent frame construction failed.");
}
const Vector3 tangentA = scale(1.0 / tangentNorm, tangentCandidate);
@@ -392,7 +392,7 @@ Result<ShellGeometry> preprocessShellGeometry(
if (!isFinite(tangentB) || !(norm(tangentB) > 0.0)) {
return geometryFailure(
"invalid-shell-director", nodes[nodeIndex].location, "NODE",
nodes[nodeIndex].sourceId.sourceLabelText,
nodes[nodeIndex].sourceId.source_label_text,
"Right-handed shell tangent frame construction failed.");
}
geometry.nodalFrames.push_back({
@@ -412,7 +412,7 @@ Result<ShellGeometry> preprocessShellGeometry(
if (element.sectionIndex >= sections.size()) {
return geometryFailure(
"invalid-shell-jacobian", element.location, "ELEMENT",
element.sourceId.sourceLabelText,
element.sourceId.source_label_text,
"Shell geometry cannot resolve its thickness for Jacobian validation.");
}
const double thickness = sections[element.sectionIndex].thickness;
@@ -422,7 +422,7 @@ Result<ShellGeometry> preprocessShellGeometry(
if (frame == nullptr) {
return geometryFailure(
"invalid-shell-director", element.location, "ELEMENT",
element.sourceId.sourceLabelText,
element.sourceId.source_label_text,
"Shell element is missing a nodal director.");
}
directors[localNode] = frame->director;
@@ -445,7 +445,7 @@ Result<ShellGeometry> preprocessShellGeometry(
!(dot(areaVector, work[elementIndex].normal) > 0.0)) {
return geometryFailure(
"invalid-shell-geometry", element.location, "ELEMENT",
element.sourceId.sourceLabelText,
element.sourceId.source_label_text,
"Shell surface basis is nonfinite, zero, or reversed at a required point.");
}
@@ -466,7 +466,7 @@ Result<ShellGeometry> preprocessShellGeometry(
!(jacobian > 0.0)) {
return geometryFailure(
"invalid-shell-jacobian", element.location, "ELEMENT",
element.sourceId.sourceLabelText,
element.sourceId.source_label_text,
"Shell Jacobian is nonfinite or nonpositive at a required point.");
}
const Vector3 reciprocalXi =
@@ -479,13 +479,13 @@ Result<ShellGeometry> preprocessShellGeometry(
!isFinite(reciprocalZeta)) {
return geometryFailure(
"invalid-shell-jacobian", element.location, "ELEMENT",
element.sourceId.sourceLabelText,
element.sourceId.source_label_text,
"Shell reciprocal basis is nonfinite at a required point.");
}
}
}
return Result<ShellGeometry>::success(std::move(geometry));
return Result<ShellGeometry>::Success(std::move(geometry));
}
} // namespace fesa