Files
JuliaFEM.jl/test/basis/test_derivatives.jl
T
Jukka Aho 094e2a1dc5 test(basis): load JuliaFEM in derivative regression
Align derivative checks with the packaged basis/topology stack instead of
partially re-including `src/` fragments.

- Drop manual `include("../../src/...")` bootstrapping in favor of `using JuliaFEM`.
2026-05-09 18:43:13 +03:00

21 lines
575 B
Julia

# Test basis function derivatives
using Test
using StaticArrays, Tensors
using JuliaFEM
@testset "Derivatives" begin
@testset "Seg2 constant gradient" begin
dN = get_basis_derivatives(Seg2(), Lagrange{1}(), Vec{1}((0.0,)))
@test dN[1][1] ≈ -0.5
@test dN[2][1] ≈ 0.5
end
@testset "Tri3 constant gradients" begin
dN = get_basis_derivatives(Tri3(), Lagrange{1}(), Vec{2}((0.3, 0.4)))
@test dN[1] ≈ Vec{2}((-1.0, -1.0))
@test dN[2] ≈ Vec{2}((1.0, 0.0))
@test dN[3] ≈ Vec{2}((0.0, 1.0))
end
end