Commit Graph

3 Commits

Author SHA1 Message Date
Jukka Aho 414de67114 refactor(backend): Remove Vec{3} conversion in CPU backend
- Changed 'ξ = Vec{3}(ip.ξ)' to 'ξ = ip.ξ' in compute_element_stiffness
- No conversion needed since ip.ξ is now already Vec{3}
2025-11-20 17:56:08 +02:00
Jukka Aho 0ca159972e feat(backend): Complete tensor-based stiffness computation
Implement full 4th-order elasticity tensor approach in CPU backend:

- Fix topology extraction: extract_topology_type() returns type, then
  instantiate with node count N (was causing crashes)

- Implement basis derivative evaluation: get_basis_derivatives() call
  now works (BLOCKER resolved)

- Complete Jacobian transformation: J = ∑ X_k ⊗ dN_k/dξ using proper
  tensor outer products (Tensors.jl)

- Implement stiffness assembly: K_ij^{αβ} = ∫ (∂N_i/∂x_γ) C_{αβγδ}
  (∂N_j/∂x_δ) detJ dξ with double contractions

- Add basevec() helper for constructing unit vectors

NO B-matrix, NO Voigt notation - pure tensor mathematics following
golden standard (docs/src/book/multigpu_nodal_assembly.md).

This is the foundation for GPU implementation (same math, different backend).
2025-11-14 21:55:22 +02:00
Jukka Aho c0a0cc679b feat(backend): Add CPU backend with element assembly and CG solver
- ElasticityDataCPU struct wraps ElementAssemblyData
- initialize_backend() assembles global system from immutable Elements
- compute_element_stiffness() uses Tensors.jl (blocked by get_basis_derivatives)
- cg_solve() implements Conjugate Gradient iterative solver
- Supports Dirichlet boundary conditions from Physics API
- 228 lines: Traditional element assembly approach for CPU
2025-11-12 01:01:08 +02:00