feat: Integrate FEMBasis into JuliaFEM module (partial)

- Add Tensors and Calculus to Project.toml dependencies
- Add basis includes to src/JuliaFEM.jl (Phase 1 integration)
- Fix FEMBasis. namespace references → use JuliaFEM namespace
- Update create_basis.jl: AbstractBasis (not FEMBasis.AbstractBasis)

Status: Basis files load, but conflict with FEMBase expectations
Next: Need to consolidate FEMBase or work around AbstractElement type constraints

This is expected during consolidation - we're bridging two systems.
This commit is contained in:
Jukka Aho
2025-11-08 09:09:54 +02:00
parent 7b6fcfdaf5
commit d3fc55f13e
6 changed files with 124 additions and 7 deletions
+1 -1
View File
@@ -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}
+4 -4
View File
@@ -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