feat(cpp-object-oriented-modular-refactoring): step 4 - model-element-google-style
This commit is contained in:
@@ -6,18 +6,18 @@
|
||||
namespace fesa {
|
||||
|
||||
Result<AnalysisModel> AnalysisModel::create(const Domain& domain) {
|
||||
if (domain.steps().empty()) {
|
||||
if (domain.Steps().empty()) {
|
||||
return Result<AnalysisModel>::Failure(Status::Failure(
|
||||
FailureCategory::kInput,
|
||||
{{Severity::kError,
|
||||
"invalid-model-cardinality",
|
||||
{domain.sourcePath(), 0U},
|
||||
{domain.SourcePath(), 0U},
|
||||
"STEP",
|
||||
"0",
|
||||
"AnalysisModel requires exactly one static step."}}));
|
||||
}
|
||||
if (domain.steps().size() > 1U) {
|
||||
const auto& secondStep = domain.steps()[1];
|
||||
if (domain.Steps().size() > 1U) {
|
||||
const auto& secondStep = domain.Steps()[1];
|
||||
return Result<AnalysisModel>::Failure(Status::Failure(
|
||||
FailureCategory::kInput,
|
||||
{{Severity::kError,
|
||||
@@ -35,7 +35,7 @@ const Domain& AnalysisModel::domain() const noexcept {
|
||||
}
|
||||
|
||||
const StaticStepDefinition& AnalysisModel::step() const noexcept {
|
||||
return domain_->steps().front();
|
||||
return domain_->Steps().front();
|
||||
}
|
||||
|
||||
const std::vector<EntityIndex>& AnalysisModel::activeElements() const noexcept {
|
||||
@@ -60,14 +60,14 @@ const std::vector<EntityIndex>& AnalysisModel::activeLoads() const noexcept {
|
||||
}
|
||||
|
||||
AnalysisModel::AnalysisModel(const Domain& domain) : domain_{&domain} {
|
||||
std::vector<bool> reachableMaterials(domain.materials().size(), false);
|
||||
std::vector<bool> reachableSections(domain.sections().size(), false);
|
||||
std::vector<bool> reachableMaterials(domain.Materials().size(), false);
|
||||
std::vector<bool> reachableSections(domain.Sections().size(), false);
|
||||
|
||||
for (std::size_t index = 0U; index < domain.elements().size(); ++index) {
|
||||
const auto& element = domain.elements()[index];
|
||||
for (std::size_t index = 0U; index < domain.Elements().size(); ++index) {
|
||||
const auto& element = domain.Elements()[index];
|
||||
activeElements_.push_back(static_cast<EntityIndex>(index));
|
||||
reachableMaterials[element.materialIndex] = true;
|
||||
reachableSections[element.sectionIndex] = true;
|
||||
reachableMaterials[element.material_index] = true;
|
||||
reachableSections[element.section_index] = true;
|
||||
}
|
||||
|
||||
// Ascending vector positions are the stable internal order, independent
|
||||
|
||||
@@ -76,7 +76,7 @@ Status LinearStaticAnalysis::initialize(const AnalysisRequest& request) {
|
||||
}
|
||||
|
||||
domain_ = std::make_unique<Domain>(std::move(domain.Value()));
|
||||
diagnostics_ = domain_->warnings();
|
||||
diagnostics_ = domain_->Warnings();
|
||||
SortDiagnostics(diagnostics_);
|
||||
return Status::Ok();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user