#ifndef FESA_ANALYSIS_ANALYSIS_MODEL_H_ #define FESA_ANALYSIS_ANALYSIS_MODEL_H_ #include #include "fesa/model/domain.h" namespace fesa { /// @brief Provides the active-step view into a non-owned Domain. /// @note The referenced Domain must outlive this object and retains all /// semantic ownership. class AnalysisModel { public: /// @brief Creates the sole active-step view for a valid Domain. /// @param domain Domain that remains alive for the returned view's lifetime. /// @return A stable view or an input-cardinality failure. static Result Create(const Domain& domain); /// @brief Returns the non-owned Domain backing this view. const Domain& GetDomain() const noexcept; /// @brief Returns the sole active static step. const StaticStepDefinition& Step() const noexcept; /// @brief Returns active beam element indices in stable internal order. const std::vector& ActiveElements() const noexcept; /// @brief Returns reachable material indices in stable internal order. const std::vector& ActiveMaterials() const noexcept; /// @brief Returns reachable beam-section indices in stable internal order. const std::vector& ActiveSections() const noexcept; /// @brief Returns boundary-condition indices in source order. const std::vector& ActiveBoundaryConditions() const noexcept; /// @brief Returns concentrated-load indices in source order. const std::vector& ActiveLoads() const noexcept; private: /// @brief Builds stable indices without copying the referenced Domain. explicit AnalysisModel(const Domain& domain); const Domain* domain_; std::vector active_elements_; std::vector active_materials_; std::vector active_sections_; std::vector active_boundary_conditions_; std::vector active_loads_; }; } // namespace fesa #endif // FESA_ANALYSIS_ANALYSIS_MODEL_H_