Files
JuliaFEM.jl/test/test_fields_time_interpolation.jl
T

26 lines
859 B
Julia
Raw Normal View History

2016-02-11 21:28:16 +02:00
# This file is a part of JuliaFEM.
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
2016-07-03 21:16:03 +03:00
using JuliaFEM
2016-02-11 21:28:16 +02:00
using JuliaFEM.Test
@testset "test interpolation of discrete constant time-variant field" begin
f = DCTV(0.0 => 0.0, 1.0 => 1.0)
# time interpolation of time-variant fields results it's
# time-invariant counterpart
@test isapprox(f(-1.0), DCTI(0.0))
@test isapprox(f( 0.0), DCTI(0.0))
@test isapprox(f( 0.3), DCTI(0.3))
@test isapprox(f( 0.5), DCTI(0.5))
@test isapprox(f( 0.9), DCTI(0.9))
@test isapprox(f( 1.0), DCTI(1.0))
@test isapprox(f( 1.5), DCTI(1.0))
2016-02-24 01:20:39 +02:00
f2 = DCTV(0.0 => 0.0, 0.25 => -0.1, 0.50 => -0.1)
@test isapprox(f2(0.0), DCTI(0.0))
@test isapprox(f2(0.25), DCTI(-0.1))
@test isapprox(f2(0.50), DCTI(-0.1))
@test isapprox(f2(0.35), DCTI(-0.1))
2016-02-11 21:28:16 +02:00
end
2016-02-24 01:20:39 +02:00