Mercurial > repos > public > sbplib_julia
comparison test/SbpOperators/volumeops/laplace/laplace_test.jl @ 1613:15488c889a50 feature/boundary_conditions
Fix variable name
author | Vidar Stiernström <vidar.stiernstrom@gmail.com> |
---|---|
date | Sun, 09 Jun 2024 16:51:56 -0700 |
parents | fca4a01d60c9 |
children | b74e1a21265f |
comparison
equal
deleted
inserted
replaced
1612:3887f41e1942 | 1613:15488c889a50 |
---|---|
127 stencil_set = read_stencil_set(operator_path; order=o) | 127 stencil_set = read_stencil_set(operator_path; order=o) |
128 Δ = Laplace(g, stencil_set) | 128 Δ = Laplace(g, stencil_set) |
129 H = inner_product(g, stencil_set) | 129 H = inner_product(g, stencil_set) |
130 u = collect(eval_on(g, (x,y) -> cos(π*x)cos(2*π*y))) | 130 u = collect(eval_on(g, (x,y) -> cos(π*x)cos(2*π*y))) |
131 Δu = collect(eval_on(g, (x,y) -> -5*π^2*cos(π*x)cos(2*π*y))) | 131 Δu = collect(eval_on(g, (x,y) -> -5*π^2*cos(π*x)cos(2*π*y))) |
132 op = Δ | 132 D = Δ |
133 for id ∈ boundary_identifiers(g) | 133 for id ∈ boundary_identifiers(g) |
134 op = op + foldl(∘, sat_tensors(Δ, g, NeumannCondition(0., id))) | 134 D = D + foldl(∘, sat_tensors(Δ, g, NeumannCondition(0., id))) |
135 end | 135 end |
136 e = op*u .- Δu | 136 e = D*u .- Δu |
137 # Accuracy | 137 # Accuracy |
138 @test sqrt(sum(H*e.^2)) ≈ 0 atol = tol | 138 @test sqrt(sum(H*e.^2)) ≈ 0 atol = tol |
139 # Symmetry | 139 # Symmetry |
140 # TODO: # Consider generating the matrices to H and D and test D'H == H'D | 140 # TODO: # Consider generating the matrices to H and D and test D'H == H'D |
141 r = randn(size(u)) | 141 r = randn(size(u)) |