refactor: store runtime objects in domain
This commit is contained in:
+2
-2
@@ -64,9 +64,9 @@
|
||||
**Tradeoff**: Implementation can be blocked until required reference artifacts are supplied.
|
||||
|
||||
## ADR-010: Domain, AnalysisModel, And AnalysisState Are Separate
|
||||
**Decision**: `Domain` owns parsed model definition, `AnalysisModel` owns the active step execution view, and `AnalysisState` owns mutable solution and iteration state.
|
||||
**Decision**: `Domain` owns the validated runtime model object graph created from parsed input, `AnalysisModel` owns the active step execution view, and `AnalysisState` owns mutable solution and iteration state.
|
||||
|
||||
**Reason**: This prevents equation ids, displacement vectors, residuals, and future nonlinear/time states from leaking into input model objects. It also keeps the static solver compatible with future nonlinear, dynamic, and thermal workflows.
|
||||
**Reason**: This prevents parser DTOs, equation ids, displacement vectors, residuals, and future nonlinear/time states from leaking into the persistent domain model. It also keeps the static solver compatible with future nonlinear, dynamic, and thermal workflows.
|
||||
|
||||
**Tradeoff**: The initial implementation has more object boundaries than a single monolithic model container.
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ tests/
|
||||
The current repository may not yet contain all directories. They are intended ownership boundaries for implementation planning.
|
||||
|
||||
## Core Runtime Objects
|
||||
- `Domain`: owns model definitions from input: nodes, elements, materials, properties, sets, boundary conditions, loads, and step definitions.
|
||||
- `Domain`: owns the validated runtime model object graph created from input: nodes, elements, materials, properties, sets, boundary conditions, loads, and step definitions.
|
||||
- `AnalysisModel`: step-local execution view over active elements, loads, boundary conditions, properties, materials, and equation system view.
|
||||
- `AnalysisState`: owns changing physical quantities and iteration/time state such as displacement, velocity, acceleration, temperature, forces, residual, current time, increment, and element/integration-point state.
|
||||
- `Node`: stores node id, coordinates, and six DOF values in order `U1, U2, U3, UR1, UR2, UR3`.
|
||||
@@ -100,7 +100,7 @@ The current repository may not yet contain all directories. They are intended ow
|
||||
## State Ownership
|
||||
|
||||
### Domain
|
||||
`Domain` represents parsed model definition and should not store equation ids, solver vectors, current displacement, or iteration state.
|
||||
`Domain` represents the validated model definition as runtime objects and should not store parser DTOs, equation ids, solver vectors, current displacement, or iteration state.
|
||||
|
||||
Included:
|
||||
- nodes and elements
|
||||
@@ -109,6 +109,8 @@ Included:
|
||||
- loads and boundary conditions
|
||||
- analysis step definitions
|
||||
|
||||
Parser-style definition records may exist as temporary input or factory records, but they are not persistent `Domain` storage. `Domain` owns runtime objects such as `Element`, `Material`, `ShellProperty`, `Load`, and `BoundaryCondition`.
|
||||
|
||||
### AnalysisModel
|
||||
`AnalysisModel` is built per active step. It references `Domain` objects by id or stable reference and defines what participates in the current solve.
|
||||
|
||||
@@ -152,8 +154,9 @@ Results use:
|
||||
```text
|
||||
Abaqus input file
|
||||
-> InputParser
|
||||
-> temporary parsed records
|
||||
-> Factory/Registry object creation
|
||||
-> Domain
|
||||
-> Domain runtime object graph
|
||||
-> StepDefinition loop
|
||||
-> AnalysisModel
|
||||
-> DofManager
|
||||
|
||||
@@ -34,6 +34,10 @@
|
||||
- Added identity-only model object base classes and concrete skeletons for `Element`/`Mitc4Element`, `Material`/`LinearElasticMaterial`, `ShellProperty`, `Load`/`NodalLoad`, and `BoundaryCondition`/`SinglePointConstraint`.
|
||||
- Extended `Domain` with RAII `std::unique_ptr` ownership APIs for polymorphic element, material, load, and boundary model objects while preserving existing `*Definition` storage APIs.
|
||||
- Added `fesa_model_object_tests` CTest target and model-object tests under `tests/element/`, `tests/material/`, `tests/property/`, `tests/load/`, and `tests/boundary/`.
|
||||
- Created `docs/implementation-plans/domain-runtime-storage-implementation-plan.md` and `phases/domain-runtime-storage/`.
|
||||
- Migrated `Domain` canonical storage away from parser-style definition DTOs to runtime model objects for elements, materials, shell properties, loads, and boundary conditions.
|
||||
- Moved `ElementType` into `ModelTypes.hpp` so runtime element interfaces no longer include `ElementDefinition.hpp`.
|
||||
- Updated Domain storage tests so element sets and linear static step indices validate against runtime element, load, and boundary containers.
|
||||
|
||||
## In Progress
|
||||
- Ready for the next upstream MITC4 stage: new solver feature requirements analysis for `mitc4-linear-static-shell`.
|
||||
@@ -51,6 +55,10 @@
|
||||
- 2026-06-09: After analysis model object implementation, `python scripts/validate_workspace.py` configured CMake with Visual Studio 17 2022 x64, built Debug targets, ran CTest, and passed.
|
||||
- 2026-06-09: After analysis model object implementation, `ctest --test-dir build/msvc-debug --output-on-failure -C Debug -R "domain|model-object"` passed. 2 CTest executables ran successfully.
|
||||
- 2026-06-09: After analysis model object implementation, `git diff --check` passed.
|
||||
- 2026-06-09: After Domain runtime storage migration, `ctest --test-dir build/msvc-debug --output-on-failure -C Debug -R "domain|model-object"` passed. 2 CTest executables ran successfully.
|
||||
- 2026-06-09: After Domain runtime storage migration, `python -m unittest discover -s scripts -p "test_*.py"` passed. 89 tests ran successfully.
|
||||
- 2026-06-09: After Domain runtime storage migration, `python scripts/validate_workspace.py` configured CMake with Visual Studio 17 2022 x64, built Debug targets, ran CTest, and passed.
|
||||
- 2026-06-09: After Domain runtime storage migration, `git diff --check` passed with only Git line-ending normalization warnings.
|
||||
- 2026-06-08: After Domain model foundation implementation, `python -m unittest discover -s scripts -p "test_*.py"` passed. 89 tests ran successfully.
|
||||
- 2026-06-08: After Domain model foundation implementation, `python scripts/validate_workspace.py` configured CMake with Visual Studio 17 2022 x64, built Debug targets, ran CTest, and passed.
|
||||
- 2026-06-08: After Domain model foundation implementation, `ctest --test-dir build/msvc-debug --output-on-failure -C Debug -R domain` passed. 1 domain/core test executable ran successfully.
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
# Domain Runtime Storage Implementation Plan
|
||||
|
||||
## Objective
|
||||
|
||||
Make `Domain` store runtime model objects as its canonical model representation instead of persisting parser-style definition DTOs.
|
||||
|
||||
This follows the approved direction:
|
||||
|
||||
```text
|
||||
Abaqus .inp parser
|
||||
-> temporary parsed or semantic records
|
||||
-> factory / DomainBuilder
|
||||
-> Domain owns runtime objects
|
||||
```
|
||||
|
||||
The parser and factory are not implemented in this phase. Definition DTOs may remain as temporary parser/factory-local records, but `Domain` must not use them as persistent storage.
|
||||
|
||||
## Phase Overview
|
||||
|
||||
1. `runtime-storage-contract`
|
||||
- Record the migration contract and clarify which model objects are canonical in `Domain`.
|
||||
- Keep parser/factory work out of scope.
|
||||
|
||||
2. `element-material-property-runtime-storage`
|
||||
- Store elements as `fesa::element::Element`.
|
||||
- Store materials as `fesa::material::Material`.
|
||||
- Store shell properties as `fesa::property::ShellProperty`.
|
||||
- Move `ElementType` to `ModelTypes.hpp` so runtime element interfaces do not depend on `ElementDefinition`.
|
||||
|
||||
3. `load-boundary-runtime-storage`
|
||||
- Store loads as `fesa::load::Load`.
|
||||
- Store boundary conditions as `fesa::boundary::BoundaryCondition`.
|
||||
- Validate runtime `NodalLoad` and `SinglePointConstraint` node references during insertion.
|
||||
|
||||
4. `step-and-set-runtime-references`
|
||||
- Validate element sets against runtime elements.
|
||||
- Validate step load and boundary indices against runtime containers.
|
||||
- Keep `LinearStaticStepDefinition` as a step configuration record until a dedicated runtime step object is designed.
|
||||
|
||||
5. `legacy-definition-extraction`
|
||||
- Remove `core::*Definition` DTOs from `Domain` includes, fields, and public API.
|
||||
- Keep focused DTO tests only for parser/factory-local record compatibility.
|
||||
|
||||
6. `validation-report-handoff`
|
||||
- Run harness and CMake/CTest validation.
|
||||
- Update project handoff documents with concrete evidence.
|
||||
|
||||
## Canonical Domain Storage
|
||||
|
||||
`Domain` stores:
|
||||
|
||||
- `fesa::core::Node` values;
|
||||
- `std::unique_ptr<fesa::element::Element>`;
|
||||
- `std::unique_ptr<fesa::material::Material>`;
|
||||
- `fesa::property::ShellProperty` values;
|
||||
- `std::unique_ptr<fesa::load::Load>`;
|
||||
- `std::unique_ptr<fesa::boundary::BoundaryCondition>`;
|
||||
- node sets and element sets by id;
|
||||
- `LinearStaticStepDefinition` as a temporary step configuration record.
|
||||
|
||||
`Domain` must not store:
|
||||
|
||||
- `ElementDefinition`;
|
||||
- `LinearElasticMaterialDefinition`;
|
||||
- `ShellPropertyDefinition`;
|
||||
- `NodalLoadDefinition`;
|
||||
- `fesa::core::BoundaryCondition`.
|
||||
|
||||
## Non-Goals
|
||||
|
||||
- No Abaqus parser implementation.
|
||||
- No factory/registry implementation.
|
||||
- No MITC4 stiffness, mass, residual, stress, or tangent implementation.
|
||||
- No equation numbering or solver state in `Domain`.
|
||||
- No HDF5, MKL, TBB, reference artifact, tolerance, or formulation changes.
|
||||
|
||||
## Tests
|
||||
|
||||
Primary C++ tests:
|
||||
|
||||
- `/tests/core/domain_storage_test.cpp`
|
||||
- `/tests/core/domain_model_object_test.cpp`
|
||||
- `/tests/core/model_types_test.cpp`
|
||||
- `/tests/element/element_base_test.cpp`
|
||||
- `/tests/element/mitc4_element_model_test.cpp`
|
||||
- `/tests/material/material_base_test.cpp`
|
||||
- `/tests/property/shell_property_test.cpp`
|
||||
- `/tests/load/load_base_test.cpp`
|
||||
- `/tests/boundary/boundary_base_test.cpp`
|
||||
|
||||
Required validation:
|
||||
|
||||
```powershell
|
||||
ctest --test-dir build/msvc-debug --output-on-failure -C Debug -R "domain|model-object"
|
||||
python -m unittest discover -s scripts -p "test_*.py"
|
||||
python scripts/validate_workspace.py
|
||||
git diff --check
|
||||
```
|
||||
Reference in New Issue
Block a user