style(thermal): apply repository formatting to semantic additions

This commit is contained in:
KOKO\Mimi
2026-09-29 19:09:28 +09:00
parent 7b9a36c457
commit 8ba4d18e3b
3 changed files with 41 additions and 35 deletions
+35 -31
View File
@@ -1,5 +1,3 @@
#include "fesa/model/domain.h"
#include <gtest/gtest.h>
#include <array>
@@ -11,6 +9,7 @@
#include "fesa/analysis/analysis_model.h"
#include "fesa/elements/ds4_thermal.h"
#include "fesa/materials/isotropic_thermal_material.h"
#include "fesa/model/domain.h"
namespace {
@@ -19,24 +18,31 @@ fesa::SourceLocation Location() { return {"models/thermal.inp", 10U}; }
fesa::ModelDefinition ValidDefinition() {
fesa::ModelDefinition definition{};
definition.source_path = "models/thermal.inp";
definition.nodes = {
{{"Plate", 1, "1"}, {0.0, 0.0, 0.0}, Location()},
{{"Plate", 2, "2"}, {1.0, 0.0, 0.0}, Location()},
{{"Plate", 3, "3"}, {1.0, 1.0, 0.0}, Location()},
{{"Plate", 4, "4"}, {0.0, 1.0, 0.0}, Location()},
{{"Plate", 5, "5"}, {2.0, 2.0, 0.0}, Location()}};
definition.thermal_materials = {
{{"", 1, "Thermal-Steel"}, "Thermal-Steel", 45.0, 7800.0, 500.0,
Location()}};
definition.nodes = {{{"Plate", 1, "1"}, {0.0, 0.0, 0.0}, Location()},
{{"Plate", 2, "2"}, {1.0, 0.0, 0.0}, Location()},
{{"Plate", 3, "3"}, {1.0, 1.0, 0.0}, Location()},
{{"Plate", 4, "4"}, {0.0, 1.0, 0.0}, Location()},
{{"Plate", 5, "5"}, {2.0, 2.0, 0.0}, Location()}};
definition.thermal_materials = {{{"", 1, "Thermal-Steel"},
"Thermal-Steel",
45.0,
7800.0,
500.0,
Location()}};
definition.thermal_sections = {
{{"", 1, "Section"}, "Section", 0.01, 0U, Location()}};
definition.thermal_elements = {{{"Plate", 8, "8"}, {0U, 1U, 2U, 3U},
0U, Location()}};
definition.thermal_elements = {
{{"Plate", 8, "8"}, {0U, 1U, 2U, 3U}, 0U, Location()}};
definition.thermal_initial_conditions = {{0U, 12.5, Location()}};
definition.thermal_model_boundaries = {{0U, 11, 10.0, Location()}};
definition.thermal_step = {"Heat", 0.2, 1.0, 100U, false,
definition.thermal_step = {"Heat",
0.2,
1.0,
100U,
false,
{{0U, 11, 20.0, Location()}},
{{0U, 15, -5.0, Location()}}, Location()};
{{0U, 15, -5.0, Location()}},
Location()};
return definition;
}
@@ -66,9 +72,9 @@ TEST(IsotropicThermalMaterial, RequiresFinitePositivePropertiesAndIdentity) {
ASSERT_FALSE(invalid.HasValue());
EXPECT_EQ(invalid.GetStatus().Category(), fesa::FailureCategory::kModel);
EXPECT_FALSE(fesa::IsotropicThermalMaterial::Create(
{"", 7, "Thermal-Steel"}, "Thermal-Steel", 45.0, 0.0,
500.0, Location())
EXPECT_FALSE(fesa::IsotropicThermalMaterial::Create({"", 7, "Thermal-Steel"},
"Thermal-Steel", 45.0,
0.0, 500.0, Location())
.HasValue());
EXPECT_FALSE(fesa::IsotropicThermalMaterial::Create(
{"", 7, "Thermal-Steel"}, "Thermal-Steel", 45.0, 7800.0,
@@ -114,8 +120,7 @@ TEST(ThermalDomain, RejectsInactiveTargetsConflictsAndMixedElements) {
EXPECT_EQ(conflicting.GetStatus().Category(), fesa::FailureCategory::kModel);
invalid = ValidDefinition();
invalid.elements.push_back(
{{"Plate", 9, "9"}, {0U, 1U}, 0U, 0U, Location()});
invalid.elements.push_back({{"Plate", 9, "9"}, {0U, 1U}, 0U, 0U, Location()});
const auto mixed = fesa::Domain::Create(std::move(invalid));
ASSERT_FALSE(mixed.HasValue());
EXPECT_EQ(mixed.GetStatus().Category(), fesa::FailureCategory::kModel);
@@ -189,20 +194,19 @@ TEST(ThermalAnalysisModel,
KeepsThermalSectionMaterialIndicesSeparateFromDomainMaterials) {
auto definition = ValidDefinition();
definition.materials = {{"Unused-Structural", 210.0e9, 0.3, Location()}};
definition.thermal_materials.push_back(
{{"", 2, "Thermal-Aluminum"}, "Thermal-Aluminum", 120.0, 2700.0,
900.0, Location()});
definition.thermal_materials.push_back({{"", 2, "Thermal-Aluminum"},
"Thermal-Aluminum",
120.0,
2700.0,
900.0,
Location()});
definition.thermal_sections = {
{{"", 1, "Section-A"}, "Section-A", 0.01, 1U, Location()},
{{"", 2, "Section-B"}, "Section-B", 0.02, 0U, Location()}};
definition.nodes.push_back(
{{"Plate", 6, "6"}, {3.0, 0.0, 0.0}, Location()});
definition.nodes.push_back(
{{"Plate", 7, "7"}, {4.0, 0.0, 0.0}, Location()});
definition.nodes.push_back(
{{"Plate", 8, "8"}, {4.0, 1.0, 0.0}, Location()});
definition.nodes.push_back(
{{"Plate", 9, "9"}, {3.0, 1.0, 0.0}, Location()});
definition.nodes.push_back({{"Plate", 6, "6"}, {3.0, 0.0, 0.0}, Location()});
definition.nodes.push_back({{"Plate", 7, "7"}, {4.0, 0.0, 0.0}, Location()});
definition.nodes.push_back({{"Plate", 8, "8"}, {4.0, 1.0, 0.0}, Location()});
definition.nodes.push_back({{"Plate", 9, "9"}, {3.0, 1.0, 0.0}, Location()});
definition.thermal_elements = {
{{"Plate", 8, "8"}, {0U, 1U, 2U, 3U}, 0U, Location()},
{{"Plate", 9, "9"}, {5U, 6U, 7U, 8U}, 1U, Location()}};