84 lines
3.5 KiB
Markdown
84 lines
3.5 KiB
Markdown
# Step 19: Essential Constraints and Matrix Partition
|
|
|
|
> 과거 개발 계획이다. 아래 작업·상태·예시는 현재 실행 지시가 아니다.
|
|
> 현재 구현과 검증 한계는 [기능 요약](../../docs/linear-static-3d-euler-beam/README.md)을 따른다.
|
|
|
|
## 읽어야 할 파일
|
|
|
|
- `/AGENTS.md`
|
|
- `../../docs/solver-core/README.md`
|
|
- `../../docs/solver-core/README.md`
|
|
- `../../docs/linear-static-3d-euler-beam/README.md`
|
|
- `../../docs/linear-static-3d-euler-beam/formulation.md`
|
|
- `../../docs/linear-static-3d-euler-beam/README.md`
|
|
- `/include/fesa/math/vector.hpp`
|
|
- `/include/fesa/math/sparse_matrix.hpp`
|
|
- `/include/fesa/fem/dof_manager.hpp`
|
|
- `/include/fesa/assembly/sparse_assembler.hpp`
|
|
- `/src/fesa/assembly/sparse_assembler.cpp`
|
|
|
|
## 소유 파일
|
|
|
|
- Create: `/include/fesa/constraints/essential_constraints.hpp`
|
|
- Create: `/src/fesa/constraints/essential_constraints.cpp`
|
|
- Create: `/tests/unit/constraints/essential_constraints_test.cpp`
|
|
- Modify: `/src/fesa/CMakeLists.txt`
|
|
- Modify: `/tests/CMakeLists.txt`
|
|
|
|
## 작업
|
|
|
|
조립된 full CSR matrix를 DofManager의 stable free/constrained ordering으로 partition하고
|
|
full/reduced vector를 mapping하는 essential-constraint module을 구현하라.
|
|
|
|
```cpp
|
|
struct PartitionedStiffness {
|
|
SparseMatrix kff;
|
|
SparseMatrix kfc;
|
|
SparseMatrix kcf;
|
|
SparseMatrix kcc;
|
|
};
|
|
class EssentialConstraints {
|
|
public:
|
|
static Result<PartitionedStiffness> partition(const SparseMatrix& full,
|
|
const DofManager& dofs);
|
|
static Vector gatherFree(const Vector& full, const DofManager& dofs);
|
|
static Vector gatherConstrained(const Vector& full, const DofManager& dofs);
|
|
static Vector reconstructFull(const Vector& freeValues,
|
|
const Vector& constrainedValues,
|
|
const DofManager& dofs);
|
|
};
|
|
```
|
|
|
|
Partition은 numeric value와 row/column order를 보존하고 0-based CSR invariants를 다시
|
|
검증한다. `dc`는 DofManager prescribed values에서 가져오며 zero로 가정하지 않는다.
|
|
이 step은 load vector나 RHS를 조립하지 않고 matrix/vector mapping만 소유한다.
|
|
|
|
Tests는 hand-computed block extraction, no/all/mixed constraints, nonzero prescribed values,
|
|
full-free-constrained round trip, invalid dimensions/order를 검증하고
|
|
`EssentialConstraints` regex로 등록한다.
|
|
|
|
## Acceptance Criteria
|
|
|
|
과거 도구 실행·출력 지시는 정리했으며, 현재 검증 방법은 기능 요약을 따른다.
|
|
|
|
RED 후 GREEN/VERIFY:
|
|
|
|
과거 도구 실행·출력 지시는 정리했으며, 현재 검증 방법은 기능 요약을 따른다.
|
|
|
|
## 검증 절차
|
|
|
|
1. partition/mapping tests를 먼저 추가하고 RED를 확인한다.
|
|
2. elimination에 필요한 최소 block extraction으로 GREEN을 만든다.
|
|
3. nonzero `dc`와 전체 VERIFY를 확인한다.
|
|
4. `../../docs/linear-static-3d-euler-beam/README.md`의
|
|
Step 19 section에 실제 RED/GREEN/VERIFY command, exit code,
|
|
핵심 output과 변경 파일을 기록한다.
|
|
5. Step 19를 `completed`로 갱신하고 partition/reconstruction evidence를 summary에 기록한다.
|
|
|
|
## 금지사항
|
|
|
|
- prescribed displacement를 zero로 덮어쓰지 마라. 이유: 승인된 nonzero BC를 깨뜨린다.
|
|
- penalty/MPC solver를 추가하지 마라. 이유: V0는 essential partition만 지원한다.
|
|
- RHS/load assembly를 이 step에 섞지 마라. 이유: factorization-before-load 순서를 검증해야 한다.
|
|
- 직접 commit하지 마라. 이유: Harness executor가 담당한다.
|