diff --git a/Manifest.toml b/Manifest.toml index a53b034..77c4c4e 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -2,7 +2,7 @@ julia_version = "1.12.1" manifest_format = "2.0" -project_hash = "ae6eda330dd02b1ac87faf263dad7340321f4918" +project_hash = "8374f7f8d16cbdc78c0afd48a08515a6e9079d37" [[deps.AbaqusReader]] deps = ["Logging", "Nullables"] @@ -191,7 +191,7 @@ uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" version = "1.7.1" [[deps.JuliaFEM]] -deps = ["AbaqusReader", "Arpack", "AsterReader", "FEMBase", "FEMBasis", "FEMBeam", "FEMQuad", "FEMSparse", "ForwardDiff", "HDF5", "HeatTransfer", "LightXML", "LinearAlgebra", "MortarContact2D", "MortarContact2DAD", "Parameters", "REPL", "Reexport", "SparseArrays", "Statistics", "TimerOutputs"] +deps = ["AbaqusReader", "Arpack", "AsterReader", "Calculus", "FEMBase", "FEMBasis", "FEMBeam", "FEMQuad", "FEMSparse", "ForwardDiff", "HDF5", "HeatTransfer", "InterfaceMechanics", "LightXML", "LinearAlgebra", "MortarContact2D", "MortarContact2DAD", "Parameters", "REPL", "Reexport", "SparseArrays", "Statistics", "Tensors", "TimerOutputs"] path = "." uuid = "f80590ac-b429-510a-8a99-e7c46989f22d" version = "0.5.2" diff --git a/Project.toml b/Project.toml index aba7c6b..0db850f 100644 --- a/Project.toml +++ b/Project.toml @@ -7,6 +7,7 @@ author = ["Jukka Aho ", "Tero Frondelius using JuliaFEM +✓ JuliaFEM loads successfully +Exported names: 171 +``` + +## Fixed Issues + +### 1. Element Type Signature Errors (CRITICAL) +**Problem:** Element type changed from `Element{Basis}` to `Element{M, Basis} where M` +**Fixed in:** +- `vendor/FEMBase.jl/src/FEMBase.jl` - Added AbstractBasis import +- `vendor/FEMBase.jl/src/elements_lagrange.jl` - Fixed Poi1 subtyping +- `vendor/FEMBeam.jl/src/beam3d.jl` - 3 function signatures +- `vendor/MortarContact2D.jl/src/mortar2d.jl` - 2 functions +- `vendor/MortarContact2D.jl/src/contact2d.jl` - 3 functions +- `vendor/MortarContact2DAD.jl/src/mortar2dad.jl` - 1 function +- `vendor/MortarContact2DAD.jl/src/contact2dad.jl` - 1 function +- `src/problems_mortar_3d.jl` - 2 functions (M renamed to FS to avoid conflict) +- `src/problems_contact_3d.jl` - 3 functions (M renamed to FS) +- `src/io.jl` - 15 dispatch functions + +### 2. Merge Conflicts (Issue #250 from 2019) +**Fixed in:** +- `test/runtests.jl` - Removed conflict markers +- `src/problems_elasticity.jl` - Resolved and simplified + +### 3. Missing Package Dependencies +**Fixed:** +- Created `vendor/MortarContact2DAD.jl/Project.toml` +- Updated `Manifest.toml` to use local vendor packages + +### 4. Parallel Assembly Code +**Fixed:** +- Removed references to non-existent `problem.assemble_parallel` field +- Simplified to use non-threaded assembly (threading can be added back later) + +## Test Status + +**Test Suite:** 5 passed, 51 errored (but package loads!) + +The errors are due to deeper API incompatibilities with Julia 1.12: +- Method signature mismatches (e.g., `jacobian` function) +- Some tests expect features from incomplete multithreading branch +- API evolution over 6+ years (Julia 0.6 → 1.12) + +## What Works + +✅ Package installation and loading +✅ All vendor packages compile +✅ No type signature errors +✅ Core data structures intact +✅ 171 symbols exported +✅ Basic FEM infrastructure present + +## Next Steps for Full Revival + +1. **Fix jacobian/geometry method mismatches** - Update vendor/FEMBasis for Julia 1.12 +2. **Fix remaining test errors** - Systematic fixes for API changes +3. **Add threading infrastructure** - Properly implement parallel assembly +4. **Update documentation** - Reflect Julia 1.12 compatibility +5. **Benchmark performance** - Establish baseline vs old version + +## Key Learnings + +- Multi-package ecosystems are maintenance nightmares (see llm/TECHNICAL_VISION.md) +- Type stability critical: Dict-based fields caused 100× slowdown +- Git history cleanup successful: 99MB → 9.8MB (90% reduction) +- Vendor packages approach works for development + +## Files Modified + +**Critical fixes (this session):** +- 10 source files with Element type fixes +- 2 merge conflict resolutions +- 2 dependency files (Project.toml, Manifest.toml) +- 1 assembly simplification + +**Scripts created:** +- `test.sh` - Test runner +- `fix_src_element_types.py` - Automated type fixing + +## Conclusion + +**Mission accomplished:** JuliaFEM loads on modern Julia! + +While tests have errors, the **fundamental blocker (type signatures) is resolved**. +The package is now in a state where systematic fixing of remaining issues can proceed. + +The 51 test errors are fixable - they're API evolution issues, not architectural problems. diff --git a/src/JuliaFEM.jl b/src/JuliaFEM.jl index 82c9676..51e4a29 100644 --- a/src/JuliaFEM.jl +++ b/src/JuliaFEM.jl @@ -107,6 +107,8 @@ module JuliaFEM using SparseArrays, LinearAlgebra, Statistics using Reexport, ForwardDiff, LightXML, HDF5, Parameters +using Tensors # For basis functions (Vec type) +import Calculus # For symbolic differentiation in basis generation import FEMSparse @@ -115,6 +117,24 @@ import FEMBase: get_unknown_field_name, get_unknown_field_dimension, assemble!, update!, initialize! using FEMBase: get_problems +# Consolidate FEMBasis.jl into src/basis/ (Phase 1) +include("basis/abstract.jl") +include("basis/subs.jl") +include("basis/vandermonde.jl") +include("basis/create_basis.jl") +include("basis/lagrange_segments.jl") +include("basis/lagrange_quadrangles.jl") +include("basis/lagrange_triangles.jl") +include("basis/lagrange_tetrahedrons.jl") +include("basis/lagrange_hexahedrons.jl") +include("basis/lagrange_wedges.jl") +include("basis/lagrange_pyramids.jl") +include("basis/nurbs.jl") +include("basis/nurbs_segment.jl") +include("basis/nurbs_surface.jl") +include("basis/nurbs_solid.jl") +include("basis/math.jl") + using TimerOutputs export @timeit, print_timer diff --git a/src/basis/abstract.jl b/src/basis/abstract.jl index c3cefab..0aac09d 100644 --- a/src/basis/abstract.jl +++ b/src/basis/abstract.jl @@ -12,7 +12,7 @@ import Calculus export Vec # Type alias for coordinate inputs (tuples or Vec) -const Vecish{N, T} = Union{NTuple{N, T}, Vec{N, T}} +const Vecish{N,T} = Union{NTuple{N,T},Vec{N,T}} """ AbstractBasis{dim} diff --git a/src/basis/create_basis.jl b/src/basis/create_basis.jl index 8bd8356..be6cfea 100644 --- a/src/basis/create_basis.jl +++ b/src/basis/create_basis.jl @@ -78,7 +78,7 @@ function create_basis(name, description, X::Vector{<:Vecish{D, T}}, basis, dbasi end code = quote - struct $name <: FEMBasis.AbstractBasis{$D} + struct $name <: AbstractBasis{$D} end Base.@pure function Base.size(::Type{$name}) @@ -94,18 +94,18 @@ function create_basis(name, description, X::Vector{<:Vecish{D, T}}, basis, dbasi return $N end - function FEMBasis.get_reference_element_coordinates(::Type{$name}) + function get_reference_element_coordinates(::Type{$name}) return $X end - @inline function FEMBasis.eval_basis!(::Type{$name}, N::Vector{<:Number}, xi::Vec) + @inline function eval_basis!(::Type{$name}, N::Vector{<:Number}, xi::Vec) @assert length(N) == $N $unpack @inbounds $Q return N end - @inline function FEMBasis.eval_dbasis!(::Type{$name}, dN::Vector{<:Vec{$D}}, xi::Vec) + @inline function eval_dbasis!(::Type{$name}, dN::Vector{<:Vec{$D}}, xi::Vec) @assert length(dN) == $N $unpack @inbounds $V