feat(cpp-object-oriented-modular-refactoring): step 13 - element-definition-domain

This commit is contained in:
KOKO\Mimi
2026-08-16 09:10:38 +09:00
parent cf6fc6e1d9
commit 19ba02a6a4
26 changed files with 740 additions and 242 deletions
+26 -4
View File
@@ -37,11 +37,21 @@ const std::vector<EntityIndex>& AnalysisModel::ActiveElements() const noexcept {
return active_elements_;
}
const std::vector<EntityIndex>& AnalysisModel::ActiveBeamElements()
const noexcept {
return active_beam_elements_;
}
const std::vector<EntityIndex>& AnalysisModel::ActiveMaterials()
const noexcept {
return active_materials_;
}
const std::vector<EntityIndex>& AnalysisModel::ActiveProperties()
const noexcept {
return active_properties_;
}
const std::vector<EntityIndex>& AnalysisModel::ActiveSections() const noexcept {
return active_sections_;
}
@@ -56,13 +66,20 @@ const std::vector<EntityIndex>& AnalysisModel::ActiveLoads() const noexcept {
}
AnalysisModel::AnalysisModel(const Domain& domain) : domain_{&domain} {
std::vector<bool> reachable_materials(domain.Materials().size(), false);
std::vector<bool> reachable_sections(domain.Sections().size(), false);
std::vector<bool> reachable_materials(domain.Materials().Size(), false);
std::vector<bool> reachable_properties(domain.Properties().Size(), false);
std::vector<bool> reachable_sections(domain.Sections().Size(), false);
for (std::size_t index = 0U; index < domain.Elements().size(); ++index) {
for (std::size_t index = 0U; index < domain.Elements().Size(); ++index) {
const auto& element = domain.Elements()[index];
active_elements_.push_back(static_cast<EntityIndex>(index));
reachable_materials[element.material_index] = true;
reachable_materials[element.MaterialIndex()] = true;
reachable_properties[element.PropertyIndex()] = true;
}
for (std::size_t index = 0U; index < domain.BeamElements().Size(); ++index) {
const auto& element = domain.BeamElements()[index];
active_beam_elements_.push_back(static_cast<EntityIndex>(index));
reachable_sections[element.section_index] = true;
}
@@ -73,6 +90,11 @@ AnalysisModel::AnalysisModel(const Domain& domain) : domain_{&domain} {
active_materials_.push_back(static_cast<EntityIndex>(index));
}
}
for (std::size_t index = 0U; index < reachable_properties.size(); ++index) {
if (reachable_properties[index]) {
active_properties_.push_back(static_cast<EntityIndex>(index));
}
}
for (std::size_t index = 0U; index < reachable_sections.size(); ++index) {
if (reachable_sections[index]) {
active_sections_.push_back(static_cast<EntityIndex>(index));