77 lines
1.7 KiB
Markdown
77 lines
1.7 KiB
Markdown
# Step 2: core-id-types
|
|
|
|
## 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`
|
|
- `/CMakeLists.txt`
|
|
- `/tests/core/domain_bootstrap_test.cpp`
|
|
|
|
## Task
|
|
|
|
Introduce core id aliases and DOF ordering constants.
|
|
|
|
Allowed files:
|
|
|
|
- Create `/include/fesa/core/ModelTypes.hpp`
|
|
- Modify `/tests/core/domain_bootstrap_test.cpp` or create `/tests/core/model_types_test.cpp`
|
|
- Modify `/CMakeLists.txt` only to register the new test file if a separate test executable is created
|
|
|
|
Required API:
|
|
|
|
```cpp
|
|
namespace fesa::core {
|
|
using Id = std::int64_t;
|
|
using NodeId = Id;
|
|
using ElementId = Id;
|
|
using MaterialId = Id;
|
|
using PropertyId = Id;
|
|
using StepId = Id;
|
|
|
|
enum class Dof : std::uint8_t {
|
|
U1 = 0,
|
|
U2 = 1,
|
|
U3 = 2,
|
|
UR1 = 3,
|
|
UR2 = 4,
|
|
UR3 = 5
|
|
};
|
|
|
|
constexpr std::size_t kDofPerNode = 6;
|
|
}
|
|
```
|
|
|
|
## Tests To Write First
|
|
|
|
Write a failing C++ test that includes `fesa/core/ModelTypes.hpp` before creating the header.
|
|
|
|
The test must verify:
|
|
|
|
- `sizeof(fesa::core::Id) == 8`
|
|
- `kDofPerNode == 6`
|
|
- `Dof::U1` through `Dof::UR3` have ordinal values 0 through 5
|
|
|
|
Run the targeted CTest and verify it fails because the header is missing. Then implement the header.
|
|
|
|
## Acceptance Criteria
|
|
|
|
Run:
|
|
|
|
```powershell
|
|
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 2 with `completed`, `error`, or `blocked`.
|
|
|
|
## Do Not
|
|
|
|
- Do not add model storage in this step.
|
|
- Do not add equation numbering or solver state.
|