2.1 KiB
2.1 KiB
Step 4: element-definition-storage
Read First
Read these files before editing:
/AGENTS.md/docs/AGENT_RULES.md/docs/ADR.md/docs/ARCHITECTURE.md/docs/implementation-plans/domain-model-foundation-implementation-plan.md/include/fesa/core/Domain.hpp/include/fesa/core/Node.hpp/include/fesa/core/ModelTypes.hpp/tests/core/domain_storage_test.cpp
Task
Add element definition storage without implementing element stiffness or MITC4 formulation.
Allowed files:
- Create
/include/fesa/core/ElementDefinition.hpp - Modify
/include/fesa/core/Domain.hpp - Modify
/src/core/Domain.cpp - Modify
/tests/core/domain_storage_test.cpp
Required behavior:
ElementDefinitionstoresElementId, type enum/string forMITC4, fourNodeIdconnectivity entries, and aPropertyId.Domain::addElement(ElementDefinition)inserts an element.- Duplicate element ids throw
std::invalid_argument. - Element connectivity must contain exactly four node ids for the MITC4 definition.
- Adding an element with a missing node id throws
std::invalid_argument. Domain::findElement(ElementId)returns pointer ornullptr.Domain::element(ElementId)returns const reference or throwsstd::out_of_range.Domain::elementCount()returns the stored element count.
Tests To Write First
Write failing tests before production changes:
- Add an element with four existing nodes and retrieve connectivity in order.
- Duplicate element id throws.
- Element referencing a missing node throws.
- Missing element lookup follows the
findElementandelementcontracts.
Run targeted CTest and verify RED before implementation.
Acceptance Criteria
Run:
cmake --build build/msvc-debug --config Debug
ctest --test-dir build/msvc-debug --output-on-failure -C Debug -R domain
python scripts/validate_workspace.py
Update /phases/domain-model-foundation/index.json step 4 with completed, error, or blocked.
Do Not
- Do not implement element stiffness, Jacobians, shape functions, sparse assembly, or solver behavior.
- Do not add parser behavior.