Commit Graph

228 Commits

Author SHA1 Message Date
Jukka Aho f0486eae35 docs(developer): document performance tiers vs layer graph
Explain tier 1 kernel numeric work, tier 2 warmed assembly drivers, and tier 3
IO/UI flexibility orthogonal to the dependency-layer diagram.

- Add definitions, an allocations policy table mapped to `src/` folders, and a
  short glossary tying tiers to hot-path expectations.
2026-05-09 18:23:16 +03:00
Jukka Aho 58424ca93f docs(contributing): document SPDX headers per file type
Spell out that SPDX tags must use native comments (`#` in code and TOML,
HTML comments in Markdown/Quarto) and call out formats like JSON that cannot
carry in-file blocks.

- Add an SPDX section with concrete examples and the strict-JSON caveat.
2026-05-09 17:32:29 +03:00
Jukka Aho d711cab0d3 docs(contributing): note scaled commit message bodies
Explain next to the one-file workflow that message depth should follow patch
size—grouped bullets on large or multi-concern commits.

- Adds one bullet under coding rules pointing readers at `.github/prompts/commit.prompt.md`.
2026-05-09 16:44:46 +03:00
Jukka Aho ab24555c97 feat(docs): add README.md
docs/tutorials/README.md | 17 +++++++++++++++++  1 file changed, 17 insertions(+)
2026-05-09 16:30:27 +03:00
Jukka Aho 4b14ef0ec1 feat(docs): add thermo_elastic_walkthrough.md
docs/src/thermo_elastic_walkthrough.md | 55 ++++++++++++++++++++++++++++++++++  1 file changed, 55 insertions(+)
2026-05-09 16:30:26 +03:00
Jukka Aho aa46ca8810 feat(docs): add legacy.md
docs/src/legacy.md | 25 +++++++++++++++++++++++++  1 file changed, 25 insertions(+)
2026-05-09 16:30:26 +03:00
Jukka Aho 830a7a2866 refactor(docs): update index.md
docs/src/index.md | 132 +++++++++++++++++++++++++++++++++++++-----------------  1 file changed, 90 insertions(+), 42 deletions(-)
2026-05-09 16:30:26 +03:00
Jukka Aho 3b761d86b7 feat(docs): add elements_multiphysics_teaser.md
docs/src/elements_multiphysics_teaser.md | 141 +++++++++++++++++++++++++++++++  1 file changed, 141 insertions(+)
2026-05-09 16:30:25 +03:00
Jukka Aho a03ecc09be feat(docs): add architecture_layers.md
docs/src/developer/architecture_layers.md | 175 ++++++++++++++++++++++++++++++  1 file changed, 175 insertions(+)
2026-05-09 16:30:25 +03:00
Jukka Aho 7acd3380d0 feat(docs): add assembler_choice.md
docs/src/assembler_choice.md | 35 +++++++++++++++++++++++++++++++++++  1 file changed, 35 insertions(+)
2026-05-09 16:30:25 +03:00
Jukka Aho dc3adc7226 refactor(docs): update api.md
docs/src/api.md | 221 ++++++++++++++++++++++++++------------------------------  1 file changed, 103 insertions(+), 118 deletions(-)
2026-05-09 16:30:25 +03:00
Jukka Aho e5865ee750 feat(docs): add repository_layout.md
docs/repository_layout.md | 5 +++++  1 file changed, 5 insertions(+)
2026-05-09 16:30:25 +03:00
Jukka Aho 2a3b11592f refactor(docs): update make.jl
docs/make.jl | 52 ++++++++++++++++++++++------------------------------  1 file changed, 22 insertions(+), 30 deletions(-)
2026-05-09 16:30:24 +03:00
Jukka Aho 482af34fea feat(docs): add index.md
docs/api/index.md | 3 +++  1 file changed, 3 insertions(+)
2026-05-09 16:30:24 +03:00
Jukka Aho 9d7fc6a972 feat(docs): add api.md
docs/api/api.md | 11 +++++++++++  1 file changed, 11 insertions(+)
2026-05-09 16:30:24 +03:00
Jukka Aho f63279ad73 refactor(docs): update README.md
docs/README.md | 170 ++++++++++++++-------------------------------------------  1 file changed, 40 insertions(+), 130 deletions(-)
2026-05-09 16:30:24 +03:00
Jukka Aho 637f58c342 feat(docs): add NEWS.md
docs/NEWS.md | 19 +++++++++++++++++++  1 file changed, 19 insertions(+)
2026-05-09 16:30:24 +03:00
Jukka Aho 48a6bcad9f docs(repository_layout): describe legacy as optional 0.x-adjacent API
Replace Pre-2.0 wording with legacy module note aligned with 0.x default surface.
2026-05-09 16:28:42 +03:00
Jukka Aho d4fcbad8f1 docs: Add AGENTS entrypoint and repository layout guide
Introduce root-level AGENTS.md as the architecture and workflow summary for
humans and coding agents. Add docs/src/repository_layout.md as a placement
and anti-pattern reference for sources, tests, scripts, and gitignored trees.

- AGENTS.md links deep docs and states 2.0 invariants
- repository_layout.md includes .cursor/ as gitignored local tooling
2026-05-09 16:21:31 +03:00
Jukka Aho 3bdbde3326 docs: Refresh README and contributing guide for post-reset API
Replace outdated badges and roadmap prose with the current 2.0 focus areas,
installation notes, and pointers to AGENTS.md. Rewrite CONTRIBUTING as a
concise fork/test/layer-contract checklist aligned with the repo layout.

- README: drop stale Travis/Gitter stack; document legacy module caveat
- CONTRIBUTING: remove Quarto front matter; link architecture_layers checker
2026-05-09 16:21:06 +03:00
Jukka Aho b4a2caa31e docs(snippet): Add minimal elasticity quickstart source
Runnable 4×4×4 Hex8 linear elasticity assembly used as the Documenter/README
minimal example source of truth; returns (; ndofs, nnz_stiffness).

- Intended for @literalinclude, test/docs, and scripts/verify_docs_quickstart.jl
2026-05-09 16:04:40 +03:00
Jukka Aho 02b41db2e4 chore(docs): add .gitignore for docs directory
Add .gitignore to ignore Manifest.toml in docs directory

- Ignore Manifest.toml (generated file, should not be committed)
2025-12-12 23:05:47 +02:00
Jukka Aho 2b24cbadba docs(index): update documentation landing page
Modernize index page with comprehensive overview and quick start
guide. Replace simple contents page with informative landing page.

- Add overview section describing JuliaFEM.jl
- Add key features section highlighting capabilities
- Add installation instructions
- Add quick start example code
- Update contributing section with GitHub link
- Add license information
- Remove old contents listing
2025-12-12 23:04:39 +02:00
Jukka Aho 108c881687 docs(api): reorganize API documentation structure
Reorganize API documentation with organized sections for better
navigation and discoverability.

- Add structured sections: Elements, Physics, Fields, Formulations,
  Materials, Mesh, Topology, Basis Functions, DOF System, Solvers
- Include key types and functions in each section
- Change title from "API documentation" to "API Reference"
- Keep index at the end for complete reference
2025-12-12 23:04:14 +02:00
Jukka Aho 7125a617f8 refactor(docs): simplify make.jl to modern Documenter.jl build
Simplify documentation build script to generate API docs only.
Remove legacy code for generating examples, packages, and guides.

- Replace complex build system with simple Documenter.jl setup
- Generate markdown output for Quarto integration
- Build directly to juliafem.github.io/api/ directory
- Remove functions: copy_docs, add_page!, generate_* functions
- Use DocumenterMarkdown format instead of HTML
2025-12-12 23:03:50 +02:00
Jukka Aho c7b0283822 chore(docs): add JuliaFEM dependency to Project.toml
Add JuliaFEM package as dependency for documentation build

- Add JuliaFEM to [deps] section
- Add relative path source for JuliaFEM in [sources]
2025-12-12 23:03:21 +02:00
Jukka Aho 038222ce98 chore: remove docs files moved to website repository
Remove documentation files from docs/ directory as they have
been moved to juliafem.github.io/ according to the website
structure. Manual documentation now lives in the website
repository directly.

Removed files:
- docs/book/adr-004-integration-points-api.md
- docs/book/adr-005-element-integration-point-indices.md
- docs/book/deformation_gradient_implementation.md
- docs/book/design/backend_transparent_architecture.md
- docs/book/design/gmres_algorithm_gpu.md
- docs/book/design/matrix_free_dirichlet_bc.md
- docs/book/element_assembly_implementation.md
- docs/book/linear_elastic_implementation.md
- docs/book/migration-guide-basis-api.md
- docs/book/neo_hookean_implementation.md
- docs/book/perfect_plasticity_implementation.md
2025-12-12 22:59:15 +02:00
Jukka Aho f0353699b0 chore: removed files from docs
Removed files from docs directory:

- docs/badges.jl
- docs/book/nodal_assembly_concept.md
- docs/build_api.jl
- docs/build_doctests.jl
- docs/build_lint.jl
- docs/build_notebooks.jl
- docs/build_unittests.jl
- docs/src/contributor/coding_standards.md
- docs/src/contributor/guides/gpu_elasticity_quickstart.md
- docs/src/contributor/guides/gpu_nodal_assembly_quickstart.md
- docs/src/contributor/guides/quick_reference_gpu.md
- docs/src/contributor/README.md
- docs/src/contributor/status.md
- docs/src/contributor/test_fixes_needed.md
- docs/src/contributor/testing_philosophy.md
- docs/src/examples.md
- docs/src/features.md
- docs/src/links.md
- docs/src/user/elasticity_quickstart.md
- docs/src/user/README.md
- docs/src/user/system_architecture.md
2025-12-12 22:01:57 +02:00
Jukka Aho cee336a476 chore: remove docs/src/book directory
Remove docs/src/book directory as it has been moved to another
repository

- Remove docs/src/book/ directory and all contents
- 40 files removed including documentation and design docs
2025-12-12 21:44:34 +02:00
Jukka Aho 64056da96a docs(adr): Revise ADR-002 - topology includes node count parameter
Major revision of ADR-002 based on implementation experience.

Decision change:
- OLD (Nov 9): Topology without node count (pure geometry)
- NEW (Nov 13): Topology with node count type parameter

Rationale:
Node count comes from MESH FILES, not from basis choice. When reading
Abaqus .inp, Code Aster .med, or GMSH .msh files, the mesh explicitly
specifies node count in element connectivity:
  - Hex element (1,2,...,8) → 8 nodes
  - Hex element (1,2,...,20) → 20 nodes
  - Hex element (1,2,...,27) → 27 nodes

The mesh reader knows node count BEFORE basis functions are selected.
Therefore, topology must include node count: Hexahedron{N}.

New design:
  struct Hexahedron{N} <: AbstractTopology end
  const Hex8 = Hexahedron{8}
  const Hex20 = Hexahedron{20}

This maintains type stability (N known at compile time) while
acknowledging that N originates from mesh data, not basis choice.

Supersedes: ADR-002 (November 9, 2025)
2025-11-15 02:21:47 +02:00
Jukka Aho 9bbd9879a8 docs(user): Add linear elasticity quickstart tutorial
- Complete cantilever beam example from mesh to visualization
- Gmsh mesh creation with physical groups for BCs
- Material definition (Young's modulus and Poisson's ratio)
- Dirichlet (fixed) and Neumann (pressure) boundary conditions
- ElasticityPhysics problem setup and solve!() call
- Results visualization with stress and displacement
- 361 lines: Step-by-step user tutorial for beginners
2025-11-12 01:08:41 +02:00
Jukka Aho 753ddcc9e5 docs(design): Add GPU physics architecture documentation
- 4 design documents for GPU implementation (2588 lines total)
- gpu_physics_architecture.md: Physics{Elasticity} GPU-first design
- gpu_cpu_backend_architecture.md: Backend selection and dispatch
- gpu_cpu_migration_guide.md: Migration from old API to new
- gpu_elasticity_refactoring.md: Complete refactoring strategy
- Zero CPU-GPU transfer during solve, matrix-free CG
- Elements store geometry, no mesh dependency
- Breaking changes allowed for GPU performance
2025-11-12 01:08:22 +02:00
Jukka Aho 3208904b73 docs(design): Add backend-transparent architecture proposal
- Design principle: users never see CPU/GPU differences
- Three-layer architecture: User API / Backend Abstraction / Implementations
- Auto() backend selection based on hardware availability
- Physics{ElasticityPhysicsType} as single problem type
- Internal conversion between CPU arrays and GPU arrays
- solve!() with automatic dispatch to CPU or GPU backend
- 611 lines: Complete architecture design proposal
2025-11-12 01:07:53 +02:00
Jukka Aho 6a94155a32 docs(book): Add basis function API migration guide
- get_basis_functions() and get_basis_derivatives() recommended
- Separation of concerns: topology and basis as separate parameters
- Side-by-side examples for all common element types
- Complete assembly example showing migration path
- Type-stable implementation with no performance penalty
- 302 lines: Comprehensive migration documentation
2025-11-12 01:07:24 +02:00
Jukka Aho d07220aa76 docs(book): Add nodal assembly concept and architecture
- Alternative to element-by-element assembly for GPU/matrix-free
- Node-by-node loop eliminates atomic operations on GPU
- Spider pattern: nodes couple with 10-30 neighbors not all N
- NodeToElementsMap: inverse connectivity (node → elements)
- get_node_spider() finds coupled nodes for sparse stiffness
- NodalStiffnessContribution: 3×3 blocks per node
- 307 lines: Experimental architecture with working prototype
2025-11-12 01:07:07 +02:00
Jukka Aho 64b148a9bb docs(book): Add J2 perfect plasticity implementation guide
- von Mises yield criterion with kinematic hardening
- Radial return mapping algorithm for plastic correction
- Additive strain decomposition (elastic + plastic)
- Associative flow rule and consistent tangent
- Performance: 76 ns elastic, 108 ns plastic (4.8× faster than AD)
- Zero-allocation elastic path, minimal plastic allocation
- 668 lines: Complete plasticity implementation documentation
2025-11-12 01:06:49 +02:00
Jukka Aho d610754a06 docs(book): Add NeoHookean hyperelastic implementation guide
- Compressible Neo-Hookean strain energy function
- Automatic differentiation for stress and tangent computation
- Dual constructor: Lamé (μ,λ) or engineering (E,ν)
- Total Lagrangian formulation with 2nd Piola-Kirchhoff stress
- Zero-allocation AD via Tensors.jl
- When to use: rubber, large deformation, contact mechanics
- 571 lines: Complete AD-based material model documentation
2025-11-12 01:05:49 +02:00
Jukka Aho 1e8254909c docs(book): Add LinearElastic material implementation guide
- Complete mathematical foundation of Hooke's law in tensor form
- Lamé parameters derived from Young's modulus and Poisson's ratio
- compute_stress() implementation achieving ~25 ns execution
- Fourth-order elasticity tensor with symmetries
- Zero-allocation SIMD-optimized implementation
- Physical constraints and thermodynamic admissibility
- 736 lines: Authoritative implementation documentation
2025-11-12 01:05:33 +02:00
Jukka Aho dc667b37f7 docs(book): Add traditional element assembly implementation guide
- Reference implementation of element-by-element assembly
- ElementAssemblyData and ElementContribution data structures
- Sparse matrix assembly in COO then CSC format
- scatter_to_global!() adds local to global system
- Penalty method for Dirichlet BCs
- Matrix-vector product interface for GMRES
- 479 lines: Complete documentation with examples and tests
2025-11-12 01:05:16 +02:00
Jukka Aho 8e11ab96ee docs(book): Add deformation gradient implementation analysis
- Mathematical derivation of F = I + ∇u for finite strain
- Zero-allocation implementation achieving 34 ns median
- LLVM IR analysis confirms 0 heap allocations
- 92 SIMD vector operations detected
- Small strain vs finite strain formulations
- Comparison with old deprecated eval_dbasis!() API
- 502 lines: Complete performance analysis with benchmarks
2025-11-12 01:04:52 +02:00
Jukka Aho e2917cdba8 docs: Add ADR-005 on integration point indices architecture
Document decision to store integration point indices instead of data in Element struct.
Key rationale: Elements should store relationships (indices), not data, for memory
efficiency and consistency with node connectivity pattern. Aligns with nodal assembly
approach and GPU-friendly architecture.
2025-11-12 00:49:17 +02:00
Jukka Aho ba0afce933 docs: Add ADR-004 for zero-allocation integration points API
Architectural Decision Record documenting design of integration points
API for high-performance finite element assembly.

Decision: Compile-time function returning tuple of (weight, Vec{D})
matching eval_basis! zero-cost abstraction pattern.

Problem context:
- OLD API: Runtime dispatch with mutable struct containing Dict
- Performance penalty: ~50× slower due to type instability
- Allocations: New struct created every query
- Impact: Millions of calls during assembly

Solution properties:
- Compile-time generation (fully inlined)
- Vec{D} from Tensors.jl for FEM math
- Zero allocation (tuples, stack-only)
- Type-stable (all types known at compile time)
- GPU compatible (no heap allocations)

API signature:
get_gauss_points!(::Type{Topology}, ::Type{Gauss{order}})
  → NTuple{N, Tuple{Float64, Vec{D}}}

Alternatives rejected:
- Plain tuples (less convenient for FEM math)
- Store in element (overhead, less flexible)
- Global constants (not composable)
- Runtime dispatch (type-unstable, slow)

Status: Accepted, implemented in src/integration/ (193 lines)
2025-11-12 00:44:29 +02:00
Jukka Aho 3d5a3d8c1a docs: Remove old blog/ and design/ directories
- Delete docs/blog/ directory (files moved to docs/src/book/blog/)
- Delete docs/design/ directory (files moved to docs/src/book/design/)
- Cleanup after three-tier documentation reorganization
- Old locations no longer needed after migration to docs/src/ structure
2025-11-10 22:22:29 +02:00
Jukka Aho 8c1be1b5a8 docs: Move user manual to docs/src/user/
- Relocate docs/user/ to docs/src/user/
- Contains user-facing documentation:
  - README.md (user manual index)
  - system_architecture.md (system overview)
- Part of three-tier docs reorganization following Documenter.jl standard
- Completes migration to docs/src/ structure
2025-11-10 22:22:00 +02:00
Jukka Aho fb732efd1b docs: Move contributor manual to docs/src/contributor/
- Relocate docs/contributor/ to docs/src/contributor/
- Add three GPU quickstart guides (renamed from UPPERCASE to snake_case):
  - gpu_elasticity_quickstart.md
  - gpu_nodal_assembly_quickstart.md
  - quick_reference_gpu.md
- Part of three-tier docs reorganization following Documenter.jl standard
- All files now under docs/src/ for automatic rendering
2025-11-10 22:21:43 +02:00
Jukka Aho edc4d5f63e docs: Move immutability blog post to docs/src/book/blog/
- Relocate docs/blog/immutability_performance.md to docs/src/book/blog/
- Comprehensive guide on immutable material models with Tensors.jl
- Covers LinearElastic, NeoHookean, PerfectPlasticity implementations
- Includes full benchmarks: 5× speedup for linear, 21× for plasticity
- Zero allocation performance validated
- Part of three-tier docs reorganization under standard docs/src/ structure
2025-11-10 22:21:15 +02:00
Jukka Aho 5bfd30e9a9 docs: Move book README to docs/src/book/ following Documenter.jl standard
- Relocate docs/book/README.md to docs/src/book/README.md
- Follows standard Julia documentation structure where all source files live under docs/src/
- File contains YAML header and book philosophy/structure overview
- Part of three-tier documentation reorganization (user/contributor/book)
2025-11-10 22:20:40 +02:00
Jukka Aho 46b0cd3927 docs(book): Add comprehensive Gmsh to physics tutorial
New file: docs/book/gmsh_tutorial.md (544 lines)

Complete educational resource addressing Issue #183:

Step 1: Mesh Generation with Gmsh
- Why Gmsh (features, academic adoption)
- .geo file syntax and concepts
- Mesh generation commands
- Understanding .msh format

Step 2: Weak Formulation (Theory)
- Strong form → weak form derivation
- Galerkin approximation
- M du/dt + K u = f system

Step 3: FEM Assembly in JuliaFEM
- Loading meshes
- Creating problems and elements
- Boundary conditions (Dirichlet, Neumann)
- Assembly process internals

Step 4: Extracting Matrices (Issue #183 core answer)
- How to get K, M, f after assembly
- Why extract (5 use cases)
- Integration with DifferentialEquations.jl
- Complete working example

Step 5: Method of Lines
- PDE → ODE spatial discretization strategy
- Separation of space/time concerns
- Modularity benefits

Plus: Comparison (built-in vs external), Extensions (nonlinear, 3D,
parallel, GPU), Troubleshooting, References

Demonstrates 'laboratory not fortress' philosophy
2025-11-09 23:24:15 +02:00
Jukka Aho 5f10390a01 docs(design): Add YAML frontmatter to IMMUTABILITY.md
- Converted header metadata to YAML frontmatter format
- Added categories and tags for documentation site compatibility
- Preserved all existing content (only header format changed)
- Status: IMPLEMENTED, Phase: Phase 1B
- Links to benchmark: element_immutability_benchmark.jl
2025-11-09 21:02:49 +02:00
Jukka Aho 7370863806 docs(blog): Add TL;DR version of immutability performance article
New 139-line quick-reference article covering:
- Side-by-side code comparisons (mutable vs immutable)
- 130x speedup summary with key metrics
- Type stability explanation with timing breakdown
- Compiler optimization differences
- Real-world impact table (2.4s → 0.02s)
- Mental model shift (1990s C++ → 2025 modern compilers)
- Quick command to run benchmark
- Links to full article for details
2025-11-09 21:02:21 +02:00