Files
FESADev/phases/euler-beam-3d/step6.md
T
2026-06-12 17:26:01 +09:00

80 lines
2.1 KiB
Markdown

# Step 6: model-beam-topology
## Read These Files First
Read the following files before editing:
- `/AGENTS.md`
- `/docs/ARCHITECTURE.md`
- `/docs/ADR.md`
- `/docs/implementation-plans/euler-beam-3d-implementation-plan.md`
- `/src/fesa/model/element.hpp`
- `/src/fesa/model/element.cpp`
- `/tests/unit/model_element_test.cpp`
## Task
Use TDD to add a semantic model topology for a two-node 3D beam.
Required production behavior:
- Add `beam2` to `fesa::model::ElementTopology`.
- Preserve existing `truss2`, `bar2`, and `unknown` behavior.
- Do not store equation IDs on `Element`.
- Do not add section constants to `Element` in this step.
## Tests To Write First
Modify `/tests/unit/model_element_test.cpp` first.
Add a failing assertion that constructs an element with:
- id `ElementId{10}`
- topology `ElementTopology::beam2`
- node ids `{NodeId{1}, NodeId{2}}`
- property id `PropertyId{7}`
The test must verify:
- `element.topology() == ElementTopology::beam2`
- `element.node_ids().size() == 2`
- existing `bar2` behavior still works or the test still covers it
RED command:
```powershell
ctest --test-dir build/msvc-debug --output-on-failure -C Debug -R model_element_test
```
Expected RED: compile failure because `ElementTopology::beam2` is not defined.
Then implement the minimal enum addition.
GREEN command:
```powershell
ctest --test-dir build/msvc-debug --output-on-failure -C Debug -R model_element_test
```
## Acceptance Criteria
```powershell
ctest --test-dir build/msvc-debug --output-on-failure -C Debug -R model_element_test
python -m unittest discover -s scripts -p "test_*.py"
python scripts/validate_workspace.py
```
## Verification Notes
1. Confirm the test failed before editing production code.
2. Confirm no unrelated model refactor was made.
3. Update `phases/euler-beam-3d/index.json` step 6:
- success: `"status": "completed"`, `"summary": "beam2 model topology added with unit test"`
- failure after retries: `"status": "error"`, `"error_message": "<specific error>"`
- blocked: `"status": "blocked"`, `"blocked_reason": "<specific reason>"`
## Forbidden
- Do not create parser code.
- Do not add beam stiffness code in this step.