feat(cpp-object-oriented-modular-refactoring): step 4 - model-element-google-style

This commit is contained in:
KOKO\Mimi
2026-08-16 05:37:40 +09:00
parent 34ab8b5bf1
commit 8bc0ea2f8e
46 changed files with 5184 additions and 5323 deletions
+29 -29
View File
@@ -146,7 +146,7 @@ Result<std::vector<EntityIndex>> resolveTarget(
const Domain& domain,
const NodalLoad& load) {
std::vector<const NodeSet*> matchingSets;
for (const auto& set : domain.nodeSets()) {
for (const auto& set : domain.NodeSets()) {
if (equalName(set.name, load.target)) {
matchingSets.push_back(&set);
}
@@ -155,8 +155,8 @@ Result<std::vector<EntityIndex>> resolveTarget(
std::vector<EntityIndex> matchingNodes;
std::int64_t label = 0;
if (tryPositiveInteger(load.target, label)) {
for (std::size_t index = 0U; index < domain.nodes().size(); ++index) {
if (domain.nodes()[index].sourceId.source_label == label) {
for (std::size_t index = 0U; index < domain.Nodes().size(); ++index) {
if (domain.Nodes()[index].source_id.source_label == label) {
matchingNodes.push_back(static_cast<EntityIndex>(index));
}
}
@@ -172,10 +172,10 @@ Result<std::vector<EntityIndex>> resolveTarget(
"The load target must resolve unambiguously to one node or one expanded node set."));
}
if (!matchingSets.empty()) {
const auto& nodes = matchingSets.front()->nodeIndices;
std::vector<unsigned char> seen(domain.nodes().size(), 0U);
const auto& nodes = matchingSets.front()->node_indices;
std::vector<unsigned char> seen(domain.Nodes().size(), 0U);
for (const EntityIndex node : nodes) {
if (node >= domain.nodes().size() || seen[node] != 0U) {
if (node >= domain.Nodes().size() || seen[node] != 0U) {
return Result<std::vector<EntityIndex>>::Failure(loadFailure(
"invalid-load-target",
load.location,
@@ -219,26 +219,26 @@ Status validateFiniteVector(
Status validateShellMoments(
const Domain& domain,
const Vector& fullLoad) {
if (domain.shellElements().empty()) {
if (domain.ShellElements().empty()) {
return Status::Ok();
}
std::vector<const ShellNodeInitialFrame*> frameByNode(
domain.nodes().size(), nullptr);
for (const auto& frame : domain.shellNodeInitialFrames()) {
if (frame.nodeIndex >= frameByNode.size() ||
frameByNode[frame.nodeIndex] != nullptr) {
domain.Nodes().size(), nullptr);
for (const auto& frame : domain.ShellNodeInitialFrames()) {
if (frame.node_index >= frameByNode.size() ||
frameByNode[frame.node_index] != nullptr) {
return loadFailure(
"invalid-shell-director",
{domain.sourcePath(), 0U},
{domain.SourcePath(), 0U},
"NODE",
std::to_string(frame.nodeIndex),
std::to_string(frame.node_index),
"Shell nodal directors must have unique in-range node identities.");
}
frameByNode[frame.nodeIndex] = &frame;
frameByNode[frame.node_index] = &frame;
}
for (std::size_t node = 0U; node < domain.nodes().size(); ++node) {
for (std::size_t node = 0U; node < domain.Nodes().size(); ++node) {
const double momentX = fullLoad[node * dofsPerNode + 3U];
const double momentY = fullLoad[node * dofsPerNode + 4U];
const double momentZ = fullLoad[node * dofsPerNode + 5U];
@@ -250,9 +250,9 @@ Status validateShellMoments(
if (frame == nullptr) {
return loadFailure(
"invalid-shell-director",
domain.nodes()[node].location,
domain.Nodes()[node].location,
"NODE",
domain.nodes()[node].sourceId.source_label_text,
domain.Nodes()[node].source_id.source_label_text,
"A loaded shell node must have an approved initial director.");
}
@@ -271,9 +271,9 @@ Status validateShellMoments(
if (!(projectionRatio <= shellMomentProjectionTolerance)) {
return loadFailure(
"unsupported-drilling-load",
domain.nodes()[node].location,
domain.Nodes()[node].location,
"CLOAD",
domain.nodes()[node].sourceId.source_label_text,
domain.Nodes()[node].source_id.source_label_text,
"The aggregate nodal moment has an unsupported director-parallel component.");
}
}
@@ -286,23 +286,23 @@ Result<Vector> LoadAssembler::assembleFullNodalLoad(
const AnalysisModel& model,
const DofManager& dofs) {
const Domain& domain = model.domain();
if (domain.nodes().size() >
if (domain.Nodes().size() >
(std::numeric_limits<std::size_t>::max)() / dofsPerNode) {
return Result<Vector>::Failure(loadFailure(
"invalid-load-dimensions",
{domain.sourcePath(), 0U},
{domain.SourcePath(), 0U},
"LOAD_ASSEMBLER",
domain.sourceContentIdentity(),
domain.SourceContentIdentity(),
"The semantic node count cannot be represented in full-DOF order."));
}
const std::size_t expectedFullCount =
domain.nodes().size() * dofsPerNode;
domain.Nodes().size() * dofsPerNode;
const Status dofStatus = validateDofOrder(
dofs, expectedFullCount, {domain.sourcePath(), 0U});
dofs, expectedFullCount, {domain.SourcePath(), 0U});
if (!dofStatus.IsOk()) {
return Result<Vector>::Failure(dofStatus);
}
for (std::size_t node = 0U; node < domain.nodes().size(); ++node) {
for (std::size_t node = 0U; node < domain.Nodes().size(); ++node) {
for (std::size_t component = 0U;
component < dofsPerNode;
++component) {
@@ -313,17 +313,17 @@ Result<Vector> LoadAssembler::assembleFullNodalLoad(
node * dofsPerNode + component) {
return Result<Vector>::Failure(loadFailure(
"invalid-load-order",
domain.nodes()[node].location,
domain.Nodes()[node].location,
"LOAD_ASSEMBLER",
domain.nodes()[node].sourceId.source_label_text,
domain.Nodes()[node].source_id.source_label_text,
"DofManager node/component identity must match full-DOF order."));
}
} catch (const std::out_of_range&) {
return Result<Vector>::Failure(loadFailure(
"invalid-load-dimensions",
domain.nodes()[node].location,
domain.Nodes()[node].location,
"LOAD_ASSEMBLER",
domain.nodes()[node].sourceId.source_label_text,
domain.Nodes()[node].source_id.source_label_text,
"DofManager must provide all six DOFs for every semantic node."));
}
}