fix: enforce thermal boundary dof endpoints

This commit is contained in:
KOKO\Mimi
2026-09-29 18:47:23 +09:00
parent 254247efc1
commit 283628ecda
6 changed files with 188 additions and 5 deletions
+12 -2
View File
@@ -20,8 +20,10 @@ class AnalysisModel {
/// @brief Returns the non-owned Domain backing this view.
const Domain& GetDomain() const noexcept;
/// @brief Returns the sole active static step.
const StepDefinition& Step() 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;
@@ -56,6 +58,12 @@ class AnalysisModel {
/// @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;
@@ -74,6 +82,8 @@ class AnalysisModel {
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};
};
+5 -1
View File
@@ -2,6 +2,7 @@
#define FESA_ELEMENTS_DS4_THERMAL_H_
#include <array>
#include <limits>
#include <utility>
#include <vector>
@@ -14,6 +15,9 @@ namespace fesa {
/// state.
class Ds4ThermalDefinition final : public ElementDefinition {
public:
/// @brief Marks that DS4 has no entry in Domain::Properties().
static constexpr EntityIndex kNoPropertyIndex =
(std::numeric_limits<EntityIndex>::max)();
Ds4ThermalDefinition(SourceEntityId source_id,
std::array<EntityIndex, 4> node_indices,
EntityIndex section_index, SourceLocation location);
@@ -74,7 +78,7 @@ inline EntityIndex Ds4ThermalDefinition::MaterialIndex() const noexcept {
}
inline EntityIndex Ds4ThermalDefinition::PropertyIndex() const noexcept {
return section_index_;
return kNoPropertyIndex;
}
inline EntityIndex Ds4ThermalDefinition::ThermalSectionIndex() const noexcept {
+12
View File
@@ -239,6 +239,8 @@ struct ThermalMaterialDefinition {
};
/// @brief Stores one centered homogeneous thermal shell assignment.
/// @note material_index addresses ModelDefinition::thermal_materials and,
/// after Domain construction, Domain::ThermalMaterials(), never Properties().
struct ThermalShellSectionDefinition {
SourceEntityId source_id;
std::string name;
@@ -268,6 +270,16 @@ struct ThermalInitialConditionDefinition {
SourceLocation location;
};
/// @brief Identifies the fixed bottom-to-top thermal station source DOFs.
/// @note This is separate from the six-component structural DofComponent.
enum class ThermalDofComponent : int {
kBottom = 11,
kLower = 12,
kMiddle = 13,
kUpper = 14,
kTop = 15
};
/// @brief Stores one prescribed thermal source DOF value.
struct ThermalBoundaryConditionDefinition {
EntityIndex node_index;