Files
FESADev/include/fesa/analysis/analysis_model.h
T
2026-09-29 18:47:23 +09:00

93 lines
3.7 KiB
C++

#ifndef FESA_ANALYSIS_ANALYSIS_MODEL_H_
#define FESA_ANALYSIS_ANALYSIS_MODEL_H_
#include <vector>
#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<AnalysisModel> 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<EntityIndex>& ActiveElements() const noexcept;
/// @brief Returns active B33 indices in their concrete compatibility view.
const std::vector<EntityIndex>& ActiveBeamElements() const noexcept;
/// @brief Returns reachable material indices in stable internal order.
const std::vector<EntityIndex>& ActiveMaterials() const noexcept;
/// @brief Returns reachable property indices in stable internal order.
const std::vector<EntityIndex>& ActiveProperties() const noexcept;
/// @brief Returns reachable beam-section indices in stable internal order.
const std::vector<EntityIndex>& ActiveSections() const noexcept;
/// @brief Returns boundary-condition indices in source order.
const std::vector<EntityIndex>& ActiveBoundaryConditions() const noexcept;
/// @brief Returns concentrated-load indices in source order.
const std::vector<EntityIndex>& ActiveLoads() const noexcept;
/// @brief Returns connected DS4 element indices in stable Domain order.
const std::vector<EntityIndex>& ActiveThermalElements() const noexcept;
/// @brief Returns connected thermal node indices in stable Domain order.
const std::vector<EntityIndex>& ActiveThermalNodes() const noexcept;
/// @brief Returns thermal-material collection positions in source order.
const std::vector<EntityIndex>& ActiveThermalMaterials() const noexcept;
/// @brief Returns thermal-section collection positions in source order.
const std::vector<EntityIndex>& ActiveThermalSections() const noexcept;
/// @brief Returns active surface pressure records without copying Domain data.
const std::vector<SurfacePressureLoadDefinition>& ActiveSurfacePressureLoads()
const noexcept;
private:
/// @brief Builds stable indices without copying the referenced Domain.
explicit AnalysisModel(const Domain& domain);
const Domain* domain_;
std::vector<EntityIndex> active_elements_;
std::vector<EntityIndex> active_beam_elements_;
std::vector<EntityIndex> active_materials_;
std::vector<EntityIndex> active_properties_;
std::vector<EntityIndex> active_sections_;
std::vector<EntityIndex> active_boundary_conditions_;
std::vector<EntityIndex> active_loads_;
std::vector<EntityIndex> active_thermal_elements_;
std::vector<EntityIndex> active_thermal_nodes_;
std::vector<EntityIndex> active_thermal_materials_;
std::vector<EntityIndex> active_thermal_sections_;
bool is_thermal_{false};
};
} // namespace fesa
#endif // FESA_ANALYSIS_ANALYSIS_MODEL_H_