Commit Graph

4 Commits

Author SHA1 Message Date
Jukka Aho 626266c990 docs: Reorganize documentation into three-tier structure
**Three Manuals for Three Audiences:**

1. **User Manual** (docs/user/) - "Just Get It Done"
   - For end users, engineers, students
   - Simple, practical, step-by-step
   - Quick start, tutorials, examples, troubleshooting
   - Philosophy: Show me how to solve my problem

2. **Contributor Manual** (docs/contributor/) - "Show Me the Code"
   - For developers, contributors, advanced users
   - Technical, detailed, design rationale
   - Testing, architecture, performance, CI/CD
   - Philosophy: Explain HOW and WHY

3. **The JuliaFEM Book** (docs/book/) - "Let Me Show You How I Think"
   - For researchers, theory nerds, and Jukka
   - Comprehensive, educational, opinionated, personal
   - Math foundations, design philosophy, history, research
   - Philosophy: Mix theory, code, and personal experience

**Reorganization:**
- Moved: TESTING_PHILOSOPHY.md → contributor/testing_philosophy.md
- Moved: STATUS.md → contributor/status.md
- Moved: TEST_FIXES_NEEDED.md → contributor/test_fixes_needed.md
- Moved: lagrange_basis_functions.md → book/lagrange_basis_functions.md
- Moved: benchmarks/ → book/benchmarks/
- Created: docs/README.md (main index explaining structure)
- Created: README.md in each section explaining audience and contents
- Updated: All references in scripts and source files

**Naming:** All docs now lowercase (testing_philosophy not TESTING_PHILOSOPHY)

**Benefits:**
- Clear separation of concerns
- Users don't get overwhelmed with implementation details
- Contributors get technical depth
- Book preserves deep theory and personal insights
- Each manual optimized for its audience

**Next:** Populate each section with appropriate content
2025-11-09 04:38:28 +02:00
Jukka Aho 5141fd6de5 refactor: Move theory docs to src/ with lowercase naming
- Moved docs/theory/lagrange_basis_functions.md → src/lagrange_basis_functions.md
- Updated all references in scripts and source files
- Using lowercase for consistency (no uppercase in filenames)
- Documentation now under src/ for automated doc generation

Rationale: Documentation should be close to implementation and follow
consistent naming conventions (lowercase).
2025-11-09 04:26:26 +02:00
Jukka Aho 63346a0591 style: IDE automatic code formatting
No functional changes - only whitespace and formatting adjustments:
- Removed spaces around = in named tuple syntax (name = → name=)
- Adjusted spacing in array literals
- Standardized spacing around operators
2025-11-09 04:10:37 +02:00
Jukka Aho 31d8463ef0 feat: Pre-generation infrastructure for Lagrange basis functions
**Problem:**
- __precompile__(false) in create_basis.jl causes slow package loading
- Symbolic math evaluated at runtime (100+ ms overhead)
- Dynamic eval() prevents full precompilation
- Difficult to debug generated code

**Solution: Generate Once, Use Forever**
- Renamed: create_basis.jl → lagrange_generator.jl (tool, not runtime code)
- Created: scripts/generate_lagrange_basis.jl (orchestration script)
- Created: scripts/README.md (documentation for generation workflow)
- Created: docs/theory/lagrange_basis_functions.md (mathematical foundation)

**Theory Documentation (400+ lines):**
- Kronecker delta property: N_i(x_j) = δ_ij
- Vandermonde matrix method: Vα_i = e_i
- Worked example: Seg2 linear element (step-by-step derivation)
- Polynomial completeness table (1D/2D/3D orders)
- Complete standard element catalog
- Pre-generation vs runtime comparison
- Numerical stability discussion

**Generation Script:**
- Defines all 15 standard Lagrange element types:
  * 1D: Seg2, Seg3
  * 2D Tri: Tri3, Tri6
  * 2D Quad: Quad4, Quad8, Quad9
  * 3D Tet: Tet4, Tet10
  * 3D Hex: Hex8, Hex20, Hex27
  * 3D Pyr: Pyr5
  * 3D Wedge: Wedge6, Wedge15
- For each: node coordinates + polynomial ansatz
- Calls lagrange_generator symbolic engine
- Writes clean Julia code → src/basis/lagrange_generated.jl (to be created)

**Architecture:**

**Benefits:**
- ~150× faster package loading (150ms → <1ms)
- Full precompilation enabled
- Generated code is readable/debuggable
- Git shows what changed (mathematics visible in diffs)
- Reproducible builds

**Workflow:**
1. Edit element catalog in scripts/generate_lagrange_basis.jl
2. Run: julia --project=. scripts/generate_lagrange_basis.jl
3. Review src/basis/lagrange_generated.jl
4. Test and commit

**Next Steps:**
1. Run generation script → create lagrange_generated.jl
2. Update src/JuliaFEM.jl to include generated file
3. Comment out old lagrange_*.jl includes
4. Remove __precompile__(false)
5. Verify all tests pass
6. Measure package load time improvement

**Also Included:**
- scripts/check_namespace_collisions.jl (consolidation tool)
- scripts/fix_vendor_element_types.py (Element type fixer)

See: docs/theory/lagrange_basis_functions.md for full mathematical explanation
2025-11-09 04:07:28 +02:00