56 lines
1.9 KiB
Markdown
56 lines
1.9 KiB
Markdown
# Step 1: Essential BC Elimination
|
|
|
|
## 읽어야 할 파일
|
|
|
|
- `/AGENTS.md`
|
|
- `/docs/PRD.md`
|
|
- `/docs/ARCHITECTURE.md`
|
|
- `/docs/ADR.md`
|
|
- `/include/fesa/assembly/symmetric_csr.hpp`
|
|
- `/include/fesa/assembly/equation_system.hpp`
|
|
- `/include/fesa/fem/dof_manager.hpp`
|
|
|
|
## 작업
|
|
|
|
`DofManager`가 소유한 equation mapping과 지정변위로 essential-BC elimination을
|
|
수행하고, 기존 `DofManager::reconstruct_full()`로 full vector를 복원한다.
|
|
|
|
```cpp
|
|
struct ReducedSystem final {
|
|
SymmetricCsr stiffness;
|
|
std::vector<double> force;
|
|
};
|
|
[[nodiscard]] ConstraintResult eliminate_essential_bcs(
|
|
const EquationSystem& original,
|
|
const DofManager& dofs);
|
|
[[nodiscard]] std::vector<double> recover_reaction(
|
|
const EquationSystem& original,
|
|
std::span<const double> full_displacement);
|
|
```
|
|
|
|
- 작은 hand calculation으로 RHS shift, 0/비영 prescribed value, all constrained,
|
|
\(r=Ku-f\) 반력 복원을 먼저 테스트한다.
|
|
- 별도 prescribed 인수나 full/free mapping 상태를 중복하지 않는다.
|
|
- 입력과 산술 결과의 NaN/Inf를 성공 결과로 반환하지 않는다.
|
|
|
|
## Acceptance Criteria
|
|
|
|
```powershell
|
|
cmake --build --preset windows-debug
|
|
ctest --preset windows-debug -R "EssentialBc|ConstraintElimination|Reaction" --output-on-failure
|
|
ctest --preset windows-debug --output-on-failure
|
|
```
|
|
|
|
## 검증 절차
|
|
|
|
1. 비영 지정값 테스트의 실패를 먼저 확인한다.
|
|
2. 원래 EquationSystem을 보존한 채 reduced system을 생성한다.
|
|
3. `DofManager` 복원 변위와 원래 평형식 반력을 assertion한다.
|
|
4. 전체 테스트와 index를 갱신한다.
|
|
|
|
## 금지사항
|
|
|
|
- penalty나 큰 수를 사용하지 마라. 이유: 승인된 elimination 정책과 다르다.
|
|
- 반력을 reduced matrix에서 계산하지 마라. 이유: 원래 \(K,u,f\)가 필요하다.
|
|
- MPC/Lagrange multiplier를 추가하지 마라. 이유: 범위 밖이다.
|