#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 structural step. /// @throws std::logic_error when this is a thermal view. /// @note Thermal callers must use ThermalStep(). const StepDefinition& Step() const; /// @brief Reports whether this view selects the uncoupled thermal step. bool IsThermal() const noexcept; /// @brief Returns the selected thermal step, or null for structural views. const ThermalStepDefinition* ThermalStep() const noexcept; /// @brief Returns active element-definition indices in stable Domain order. const std::vector& ActiveElements() const noexcept; /// @brief Returns active B33 indices in their concrete compatibility view. const std::vector& ActiveBeamElements() const noexcept; /// @brief Returns reachable material indices in stable internal order. const std::vector& ActiveMaterials() const noexcept; /// @brief Returns reachable property indices in stable internal order. const std::vector& ActiveProperties() 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; /// @brief Returns connected DS4 element indices in stable Domain order. const std::vector& ActiveThermalElements() const noexcept; /// @brief Returns connected thermal node indices in stable Domain order. const std::vector& ActiveThermalNodes() const noexcept; /// @brief Returns thermal-material collection positions in source order. const std::vector& ActiveThermalMaterials() const noexcept; /// @brief Returns thermal-section collection positions in source order. const std::vector& ActiveThermalSections() const noexcept; /// @brief Returns active surface pressure records without copying Domain data. const std::vector& ActiveSurfacePressureLoads() 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_beam_elements_; std::vector active_materials_; std::vector active_properties_; std::vector active_sections_; std::vector active_boundary_conditions_; std::vector active_loads_; std::vector active_thermal_elements_; std::vector active_thermal_nodes_; std::vector active_thermal_materials_; std::vector active_thermal_sections_; bool is_thermal_{false}; }; } // namespace fesa #endif // FESA_ANALYSIS_ANALYSIS_MODEL_H_