2.1 KiB
2.1 KiB
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
beam2tofesa::model::ElementTopology. - Preserve existing
truss2,bar2, andunknownbehavior. - Do not store equation IDs on
Element. - Do not add section constants to
Elementin 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::beam2element.node_ids().size() == 2- existing
bar2behavior still works or the test still covers it
RED command:
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:
ctest --test-dir build/msvc-debug --output-on-failure -C Debug -R model_element_test
Acceptance Criteria
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
- Confirm the test failed before editing production code.
- Confirm no unrelated model refactor was made.
- Update
phases/euler-beam-3d/index.jsonstep 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>"
- success:
Forbidden
- Do not create parser code.
- Do not add beam stiffness code in this step.