Files
2026-08-16 02:49:35 +09:00

4.4 KiB

Step 12: Material and Element Property Hierarchy

담당 역할과 필수 스킬

  • 담당 역할: implementation-agent
  • 필수 스킬: harness, fesa-cpp-msvc-tdd
  • 이 Step만 RED -> observed failure -> minimal GREEN -> focused/full VERIFY로 수행한다.

읽어야 할 파일

  • /AGENTS.md
  • /docs/CODINGSTYLE.md
  • /docs/ARCHITECTURE.md
  • /docs/ADR.md
  • /docs/superpowers/specs/2026-08-16-cpp-object-oriented-modular-refactoring-design.md
  • /docs/cpp-object-oriented-modular-refactoring/implementation-plan.md
  • /include/fesa/model/model_types.h
  • /include/fesa/model/domain.h, /src/fesa/model/domain.cpp
  • /tests/unit/model/model_types_test.cpp, /tests/unit/model/domain_test.cpp
  • /src/fesa/CMakeLists.txt, /tests/CMakeLists.txt
  • /phases/cpp-object-oriented-modular-refactoring/index.json
  • /phases/cpp-object-oriented-modular-refactoring/step12.md

작업

Requirement R-MODEL-001의 material/property type system만 구현한다. Domain polymorphic ownership migration은 Step 13에서 수행한다.

  1. /tests/unit/materials/material_test.cpp/tests/unit/properties/element_property_test.cpp를 먼저 만든다.
  2. C-MODEL-001 tests create each concrete through std::unique_ptr<Base>, verify virtual destruction, source/internal identity, concrete kind, exact current fields and invalid input rejection. Missing base headers cause RED compile failure.
  3. Candidate interfaces:
enum class MaterialKind { kIsotropicLinearElastic };

class Material {
 public:
  virtual ~Material() = default;
  virtual MaterialKind Kind() const noexcept = 0;
  virtual const SourceEntityId& SourceId() const noexcept = 0;
};

class IsotropicLinearElasticMaterial final : public Material {
 public:
  double YoungsModulus() const noexcept;
  double PoissonsRatio() const noexcept;
};

enum class ElementPropertyKind { kGeneralBeamSection, kShellSection };

class ElementProperty {
 public:
  virtual ~ElementProperty() = default;
  virtual ElementPropertyKind Kind() const noexcept = 0;
  virtual const SourceEntityId& SourceId() const noexcept = 0;
};
  1. Create these exact production files and register their .cpp sources in CMake:
    • /include/fesa/materials/material.h
    • /include/fesa/materials/isotropic_linear_elastic_material.h
    • /src/fesa/materials/isotropic_linear_elastic_material.cpp
    • /include/fesa/properties/element_property.h
    • /include/fesa/properties/general_beam_section.h
    • /include/fesa/properties/shell_section.h
    • /src/fesa/properties/general_beam_section.cpp
    • /src/fesa/properties/shell_section.cpp
  2. Add concrete GeneralBeamSection and ShellSection classes preserving their current validated fields, units, source identity and optional frame meaning.
  3. Move concrete record responsibility out of unrelated model_types.h only as required to avoid duplicate definitions; update current compile consumers minimally.
  4. No base contains density, plastic state, anisotropic tensor, thickness, area or no-op virtual methods that are not common to every concrete.

Acceptance Criteria

cmake --build .harness/build --config Debug --target fesa_unit_tests
ctest --test-dir .harness/build -C Debug `
  -R "Material|ElementProperty|DomainModel" --output-on-failure
& "C:/Program Files/LLVM/bin/clang-format.exe" --dry-run --Werror `
  (rg --files include/fesa/materials include/fesa/properties -g "*.h") `
  (rg --files src/fesa/materials src/fesa/properties -g "*.cpp") `
  tests/unit/materials/material_test.cpp `
  tests/unit/properties/element_property_test.cpp
cmake --build .harness/build --config Debug
ctest --test-dir .harness/build -C Debug --show-only=json-v1
ctest --test-dir .harness/build -C Debug --output-on-failure

검증 및 상태 갱신

  • RED missing interfaces, concrete validation, virtual ownership and full CTest를 summary에 기록한다.
  • Any future-only field/interface or current property regression is an error.
  • 성공 시 현재 Step만 completed로 갱신한다.
  • timestamp, retry, commit, advancement는 Executor 소유다.

금지사항

  • Density/plasticity/anisotropy APIs를 추가하지 마라. 이유: 승인된 현재 behavior가 아니다.
  • Domain을 shared_ptr repository로 바꾸지 마라.
  • ElementFactory 또는 numerical kernel을 수정하지 마라. 이유: Step 14 소유다.
  • 직접 commit하거나 hook script를 수동 실행하지 마라.