Mercurial > repos > public > sbplib_julia
comparison SbpOperators/test/runtests.jl @ 254:4ca3794fffef boundary_conditions
Add apply_quadrature to SbpOperators
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 27 Jun 2019 16:10:25 +0200 |
parents | 69a6049e14d9 |
children | accb0876da12 |
comparison
equal
deleted
inserted
replaced
253:396eadb652bd | 254:4ca3794fffef |
---|---|
1 using SbpOperators | 1 using SbpOperators |
2 using Test | 2 using Test |
3 | 3 |
4 @test_broken false | 4 @testset "apply_quadrature" begin |
5 op = readOperator(sbp_operators_path()*"d2_4th.txt",sbp_operators_path()*"h_4th.txt") | |
6 h = 0.5 | |
7 | |
8 @test apply_quadrature(op, h, 1.0, 10, 100) == h | |
9 | |
10 N = 10 | |
11 qc = op.quadratureClosure | |
12 q = h.*(qc..., ones(N-2*closuresize(op))..., reverse(qc)...) | |
13 @assert length(q) == N | |
14 | |
15 for i ∈ 1:N | |
16 @test apply_quadrature(op, h, 1.0, i, N) == q[i] | |
17 end | |
18 | |
19 v = [2.,3.,2.,4.,5.,4.,3.,4.,5.,4.5] | |
20 for i ∈ 1:N | |
21 @test apply_quadrature(op, h, v[i], i, N) == q[i]*v[i] | |
22 end | |
23 end |