# Step 0: Quadrature and Shape Functions ## 읽어야 할 파일 - `/AGENTS.md` - `/docs/PRD.md` - `/docs/ARCHITECTURE.md` - `/docs/ADR.md` - `/docs/superpowers/plans/2026-07-29-fesa-phase-1.md` - `/include/fesa/core/vec3.hpp` ## 작업 특정 analysis에 종속되지 않는 1D Gauss quadrature와 2절점 선형 shape function을 `fem` 모듈에 구현한다. ```cpp struct GaussPoint1D final { double xi; double weight; }; [[nodiscard]] std::span gauss_rule_1d(int order); [[nodiscard]] std::array line2_shape(double xi); [[nodiscard]] std::array line2_shape_derivative(double xi); [[nodiscard]] double line2_jacobian(double length); ``` - partition of unity, endpoint interpolation, derivative sum zero, 1점/2점 적분의 정확도, length/2 Jacobian, invalid order/length를 실패 테스트로 먼저 작성한다. ## Acceptance Criteria ```powershell cmake --build --preset windows-debug ctest --preset windows-debug -R "Quadrature|ShapeFunction|Jacobian" --output-on-failure ctest --preset windows-debug --output-on-failure ``` ## 검증 절차 1. 수학 invariant 테스트의 실패를 확인한다. 2. 고정 크기 값 타입과 최소 함수만 구현한다. 3. tolerance 근거를 테스트 이름 또는 주석에 명시한다. 4. 전체 CTest와 index 갱신을 수행한다. ## 금지사항 - Beam stiffness를 이 step에 구현하지 마라. 이유: 수학 primitive 경계를 유지한다. - runtime quadrature registry를 만들지 마라. 이유: 1점과 2점만 필요하다. - 잘못된 길이에 임의 epsilon을 더하지 마라. 이유: model 오류를 숨긴다.