Commit Graph

15 Commits

Author SHA1 Message Date
Jukka Aho 2d1ba0a0a1 refactor(quadrature): simplify documentation and remove legacy code
Major cleanup of quadrature module: simplify docstrings to minimal
code-focused style, remove all legacy symbol-based API, and fix Vec
constructor syntax throughout.

Documentation simplification:
- Remove all examples from docstrings
- Simplify file-level docstrings to one-line descriptions
- Remove verbose explanations, accuracy details, references, and
  "See also" sections
- Keep only essential information about types and functions

Legacy code removal:
- Remove all legacy symbol-based API (Val{:GLTRI*}, Val{:GLTET*},
  Val{:GLPYR*}, Val{:GLWED*}, Val{:GLSEG*}, Val{:GLQUAD*},
  Val{:GLHEX*})
- Remove get_order() functions for legacy symbols
- Remove _legacy_tensor_product helper function
- Remove legacy symbol generation code from gl_tensor_product.jl

gauss.jl refactoring:
- Remove old Gauss{N} type and AbstractIntegration hierarchy
- Remove get_rule_name() function and all rule name mappings
  (hundreds of lines for segments, triangles, quads, tets, hexes,
  wedges, pyramids)
- Remove IntegrationPointNEW alias
- Replace with simple integration_points() function using new API
- Change npoints() signature to take only topology parameter

api.jl improvements:
- Uncomment and fix _infer_basis_order implementations
- Add proper type constraints (<:) for all topology types
- Add Triangle{10} case for cubic triangles
- Add _quadrature_topology_type mapping functions for all topologies
- Enable topology-only dispatch for default_quadrature

Vec constructor fixes:
- Fix all Vec{D} constructor calls to use tuple syntax
- Change Vec{2}(x, y) to Vec{2}((x, y))
- Change Vec{3}(x, y, z) to Vec{3}((x, y, z))
- Applied consistently across all quadrature rule files
2025-12-12 23:22:29 +02:00
Jukka Aho ff3c26d2c3 chore: remove obsolete and legacy files
Major cleanup: remove obsolete files that have been replaced or
moved to new locations. Files removed include legacy assembly
implementations, old API files, and deprecated test files.

Removed files:

Assemblers and assembly:
- src/assemblers/nodal_based.jl
- src/assemblers/nodal_cache.jl
- src/assemblers/node_based_coo.jl
- src/assembly/assembly.jl
- src/assembly/element_structures.jl
- src/assembly/framework.jl
- src/assembly/nodal_structures.jl
- src/assembly/problems.jl
- src/element_assembly_structures.jl
- src/nodal_assembly_structures.jl

Legacy API and structure files:
- src/beams/api.jl
- src/formulations/api.jl
- src/gpu_elasticity.jl
- src/io.jl
- src/materials_plasticity.jl
- src/postprocess_utils.jl
- src/preprocess.jl
- src/quadrature.jl
- src/readers.jl
- src/shells/api.jl
- src/trusses/api.jl

Elements and domains:
- src/domains/continuum/assemble_v2.jl
- src/elements/integrate.jl

Quadrature legacy files:
- src/quadrature/gauss_points.jl
- src/quadrature/integration.jl

Test files:
- test/runtests_new.jl
- test/runtests.jl.old
- test/test_problems_elasticity_assemble_3d_seg3.jl
2025-12-12 22:45:49 +02:00
Jukka Aho 6ad8c43e7e refactor(quadrature): Rename glwed.jl → gl_wedges.jl with modern API
- Deleted: src/quadrature/glwed.jl (93 lines, old zip-based API)
- Created: src/quadrature/gl_wedges.jl (142 lines, modern type-based API)

Key improvements:
- QuadraturePoint{3} with Vec{3} coordinates (not tuples)
- SVector return types (zero allocation)
- @inline directives for performance
- Two 6-point variants (default + :B)
- Comprehensive documentation explaining tensor product structure
- Three rules: 6-point (2 variants) and 21-point

Implemented rules:
  - GaussLegendre{2}(): 6 points (degree 1, default variant)
    → 3 triangle points × 2 segment points
  - GaussLegendre{2,:B}(): 6 points (degree 1, alternative triangle distribution)
  - GaussLegendre{5}(): 21 points (degree 5, high accuracy)
    → 7 triangle points × 3 segment points

Technical details:
  - Wedge is tensor product of triangle (ξ,η) and segment (ζ)
  - Reference wedge: triangular cross-section extruded in z-direction
  - 6-point rules: 2D triangle rule × 2-point 1D Gauss
  - 21-point rule: 7-point triangle × 3-point 1D Gauss
  - Legacy Val{:GLWED*} compatibility maintained

Net: +49 lines (added detailed documentation and modern type infrastructure)
2025-11-21 00:39:54 +02:00
Jukka Aho 4cf1cda237 refactor(quadrature): Rename gltet.jl → gl_tetrahedra.jl with modern API
- Deleted: src/quadrature/gltet.jl (67 lines, old zip-based API)
- Created: src/quadrature/gl_tetrahedra.jl (160 lines, modern type-based API)

Key improvements:
- QuadraturePoint{3} with Vec{3} coordinates (not tuples)
- SVector return types (zero allocation)
- @inline directives for performance
- Comprehensive documentation with warnings
- Four rules from 1-point to 15-point (degrees 1-4)

Implemented rules:
  - GaussLegendre{1}(): 1 point (centroid, degree 1)
  - GaussLegendre{2}(): 4 points (degree 2, symmetric placement)
  - GaussLegendre{4}(): 15 points (degree 4, all weights positive)

Technical details:
  - Reference tetrahedron: vertices at (0,0,0), (1,0,0), (0,1,0), (0,0,1)
  - All weights sum to 1/6 (volume of reference tetrahedron)
  - Parametric domain constraint: ξ + η + ζ ≤ 1
  - Legacy Val{:GLTET*} compatibility maintained

Warning documented:
  - GaussLegendre{3}() has negative weight at centroid (-2/15)
  - May cause numerical issues, GaussLegendre{2}() or {4}() recommended

Net: +93 lines (added extensive documentation, modern types, and safety warnings)
2025-11-21 00:39:27 +02:00
Jukka Aho 8c443a98fb refactor(quadrature): Rename gltri.jl → gl_triangles.jl with modern API
- Deleted: src/quadrature/gltri.jl (131 lines, old zip-based API)
- Created: src/quadrature/gl_triangles.jl (245 lines, modern type-based API)

Key improvements:
- QuadraturePoint{2} with Vec{2} coordinates (not tuples)
- SVector return types (zero allocation)
- @inline directives for performance
- Two variants for order 2 and 3 (default + :B)
- Comprehensive documentation with warnings about negative weights
- All rules 1-point through 12-point (degrees 1-6)

Implemented rules:
  - GaussLegendre{1}(): 1 point (centroid, degree 1)
  - GaussLegendre{2}(): 3 points (degree 2, default variant)
  - GaussLegendre{2,:B}(): 3 points (edge midpoints variant)
  - GaussLegendre{3}(): 4 points (degree 3, default variant, all weights positive)
  - GaussLegendre{4}(): 6 points (degree 4)
  - GaussLegendre{5}(): 7 points (degree 5, includes centroid)
  - GaussLegendre{6}(): 12 points (degree 6)

Technical details:
  - Reference triangle: vertices at (0,0), (1,0), (0,1)
  - All weights sum to 0.5 (area of reference triangle)
  - Parametric domain: [0,1]² with constraint ξ + η ≤ 1
  - Legacy Val{:GLTRI*} compatibility maintained

Warning documented:
  - GaussLegendre{3,:B}() has negative weight at centroid
  - May cause numerical issues, default variant recommended

Net: +114 lines (added extensive documentation, modern types, and variant support)
2025-11-21 00:38:58 +02:00
Jukka Aho 7f7077ee60 refactor(quadrature): Rename glquad.jl → gl_tensor_product.jl with modern API
- Deleted: src/quadrature/glquad.jl (40 lines, programmatic generation only)
- Created: src/quadrature/gl_tensor_product.jl (344 lines, complete implementations)

Key improvements:
- Explicit implementations for Segment, Quadrilateral, Hexahedron
- All rules GaussLegendre{1} through GaussLegendre{5}
- QuadraturePoint{D} with Vec{D} coordinates (not tuples)
- SVector return types for zero allocation
- @inline directives for performance
- Comprehensive documentation per function

Implemented rules:
Segments (1D):
  - GaussLegendre{1}(): 1 point (exact degree 1)
  - GaussLegendre{2}(): 2 points (exact degree 3)
  - GaussLegendre{3}(): 3 points (exact degree 5)
  - GaussLegendre{4}(): 4 points (exact degree 7)
  - GaussLegendre{5}(): 5 points (exact degree 9)

Quadrilaterals (2D tensor products):
  - GaussLegendre{1}(): 1×1 = 1 point
  - GaussLegendre{2}(): 2×2 = 4 points (standard Quad4)
  - GaussLegendre{3}(): 3×3 = 9 points (standard Quad9)
  - GaussLegendre{4}(): 4×4 = 16 points
  - GaussLegendre{5}(): 5×5 = 25 points

Hexahedra (3D tensor products):
  - GaussLegendre{1}(): 1×1×1 = 1 point
  - GaussLegendre{2}(): 2×2×2 = 8 points (standard Hex8)
  - GaussLegendre{3}(): 3×3×3 = 27 points (standard Hex27)
  - GaussLegendre{4}(): 4×4×4 = 64 points
  - GaussLegendre{5}(): 5×5×5 = 125 points

Legacy compatibility:
  - Old Val{:GLSEG*}, Val{:GLQUAD*}, Val{:GLHEX*} symbols still work
  - Uses _legacy_tensor_product() helper (kept old zip-based API)

Technical details:
  - Rules 1-3: Hardcoded for optimal performance
  - Rules 4-5: Generated from QUAD_DATA using ntuple for zero allocation
  - All reference domains: [-1,1]^D

Net: +304 lines (programmatic generation → explicit implementations + docs)
2025-11-21 00:38:28 +02:00
Jukka Aho 0b2195c7c2 refactor(quadrature): Rename glpyr.jl → gl_pyramids.jl with modern API
- Deleted: src/quadrature/glpyr.jl (45 lines, old zip-based API)
- Created: src/quadrature/gl_pyramids.jl (86 lines, modern type-based API)

Key improvements:
- Two pyramid rule variants: GaussLegendre{2}() (default) and GaussLegendre{2,:B}()
- QuadraturePoint{3} with Vec{3} coordinates (not tuples)
- SVector return type (zero allocation)
- Comprehensive documentation explaining pyramid singularity at apex
- Inline functions for performance
- Legacy Val{:GLPYR5} compatibility maintained

Technical details:
- Default variant: 4 base points + 1 elevated, non-uniform weights
- Variant B: 5 points with uniform weights (a = 2/15)
- Both exact for degree 1 polynomials
- Pyramid: quad base at z=0, apex at (0,0,1)

Net: +41 lines (added extensive documentation and modern types)
2025-11-21 00:37:54 +02:00
Jukka Aho 9f242df9db refactor(quadrature): Replace FEMQuad module with streamlined api.jl
- Deleted: src/quadrature/FEMQuad.jl (48 lines, old module wrapper)
- Created: src/quadrature/api.jl (365 lines, comprehensive quadrature API)

Key improvements:
- AbstractQuadratureRule type hierarchy (GaussLegendre, GaussLobatto)
- QuadraturePoint{D,T} struct with Vec{D} coordinates and Float64 weight
- Zero-allocation get_quadrature_points() returning SVector
- Multi-level default_quadrature() dispatch (4 levels: order → topology+order → topology+basis → topology only)
- Comprehensive documentation with examples and performance notes
- Integration with Tensors.jl (Vec) and StaticArrays (SVector)

Replaced:
- Old Val{:symbol} dispatch → Modern type parameters
- Old integrate_1d/2d/3d functions → Removed (not used in codebase)
- Module wrapper → Direct include (quadrature rules now in separate files)

Net: +317 lines (FEMQuad was minimal wrapper, api.jl is complete interface)
2025-11-21 00:37:27 +02:00
Jukka Aho 15e9d71275 docs(quadrature): Add deprecation notices to old integration API
- Added DEPRECATED header comment explaining migration to new API (api.jl)
- Added deprecation notices to AbstractIntegration and IntegrationPoint docstrings
- Added migration example showing old vs new syntax (IntegrationPoint → QuadraturePoint)
- Documented field name changes: ip.ξ → qp.coords
2025-11-21 00:29:48 +02:00
Jukka Aho 49f55ca12a refactor(quadrature): Convert tuple to Vec when constructing IntegrationPoint
- Added Vec{D}(point) conversion before IntegrationPoint construction
- Converts tuple from quadrature rules to Vec for tensor operations
- Eliminates need for Vec{N}(ip.ξ) conversions throughout codebase
2025-11-20 17:55:06 +02:00
Jukka Aho 400e9c7c85 refactor(quadrature): Change IntegrationPoint ξ field from NTuple to Vec
- Changed ξ field type from NTuple{D,Float64} to Vec{D,Float64}
- Updated docstring to reflect Vec type instead of tuple
- Updated example to show Vec construction
- Enables direct use in tensor operations without conversion
2025-11-20 17:54:46 +02:00
Jukka Aho d019839b58 Move src/integration/integration.jl to src/quadrature/integration.jl 2025-11-18 14:16:00 +02:00
Jukka Aho d25bb109b6 Move src/integration/gauss_points.jl to src/quadrature/gauss_points.jl 2025-11-18 14:16:00 +02:00
Jukka Aho 6f65fccb8d Move src/integration/gauss.jl to src/quadrature/gauss.jl 2025-11-18 14:16:00 +02:00
Jukka Aho 315c319963 feat: Consolidate FEMQuad.jl into JuliaFEM (quadrature rules)
Consolidated entire FEMQuad.jl package (436 lines) into src/quadrature/:
- quaddata.jl: Quadrature data definitions
- glquad.jl: 2D quadrilateral Gauss-Legendre rules
- gltri.jl: 2D triangle Gauss-Legendre rules (131 lines)
- gltet.jl: 3D tetrahedron Gauss-Legendre rules
- glwed.jl: 3D wedge Gauss-Legendre rules
- glpyr.jl: 3D pyramid Gauss-Legendre rules

Changes:
- Created src/quadrature.jl as main include file
- Removed 'import FEMQuad' from JuliaFEM.jl
- Updated integrate.jl: FEMQuad.get_quadrature_points → get_quadrature_points
- Added export add_element! (was missing)

Result:
- ✅ JuliaFEM loads successfully
- ✅ Integration points work correctly
- ✅ 5 tests still passing (no regression)
- ✅ One less vendor package dependency

Next: Continue consolidating vendor packages
2025-11-08 10:49:28 +02:00