Lines Matching +full:- +full:v
23 const run_dev_tests = !isrelease() || ("--run-dev-tests" in ARGS)
66 v = CeedVector(c, n)
67 @test size(v) == (n,)
68 @test length(v) == n
69 @test axes(v) == (1:n,)
70 @test ndims(v) == 1
73 v[] = 0.0
74 @test @witharray(a = v, all(a .== 0.0))
80 v[] = v1
82 @test norm(v, p) ≈ norm(v1, p)
84 @test_throws Exception norm(v, 3)
85 @test witharray_read(sum, v) == sum(v1)
86 reciprocal!(v)
87 @test @witharray(a = v, mtype = MEM_HOST, all(a .== CeedScalar(1.0)./v1))
89 witharray(x -> x .= 1.0, v)
90 @test @witharray(a = v, all(a .== 1.0))
92 @test summarystr(v) == "$n-element CeedVector"
93 @test sprint(show, v) == @witharray_read(a = v, sprint(show, a))
95 summary(io, v)
97 @witharray_read(a = v, Base.print_array(io, a))
99 @test showstr(v) == s1
101 setarray!(v, MEM_HOST, USE_POINTER, v1)
102 syncarray!(v, MEM_HOST)
103 @test @witharray_read(a = v, a == v1)
104 p = takearray!(v, MEM_HOST)
154 @test q1d ≈ CeedScalar[-1.0, 0.0, 1.0]
158 @test q1d ≈ CeedScalar[-sqrt(3/5), 0.0, sqrt(3/5)]
162 d1d = CeedScalar[-0.5 0.5; -0.5 0.5; -0.5 0.5]
163 q1d = CeedScalar[-1.0, 0.0, 1.0]
191 v = rand(CeedScalar, 2)
192 vq = apply(b3, v)
193 vd = apply(b3, v; emode=EVAL_GRAD)
194 @test vq ≈ b1d*v
195 @test vd ≈ d1d*v
211 V = zeros(CeedScalar, dim*(dim + 1)÷2)
212 setvoigt!(V, J, D)
213 @test V == setvoigt(J, D)
215 getvoigt!(J2, V, D)
232 offsets = Vector{CeedInt}(0:n-1)
243 v = rand(CeedScalar, n)
244 v1 = CeedVector(c, v)
254 # TODO: change this test after bug-fix in libCEED
280 offsets = Vector{CeedInt}([0:n-1; n-1:2*n-2])
281 lsize = 2*n - 1
319 Gallery CeedQFunction - Poisson3DApply
337 v = rand(CeedScalar, Q)
338 v1 = CeedVector(c, v)
341 @test @witharray(a = v2, a == v)
346 @test @witharray(a = v2, a == v)
391 d1d = CeedScalar[-0.5 0.5; -0.5 0.5; -0.5 0.5]
392 q1d = CeedScalar[-1.0, 0.0, 1.0]
429 @test v1[i] ≈ -1.0
457 u2[1] = -1.0
474 offsets[1, i] = i - 1
477 orients[1, i] = (i - 1)%2 > 0
478 orients[2, i] = (i - 1)%2 > 0
493 lv[i] = 10 + i - 1
500 k = j + elemsize*(i - 1)
501 @test 10 + k÷2 == ev[k]*(-1)^((i - 1)%2)
508 if (i - 1)%2 > 0
509 # T = [0 -1]
510 # [-1 0]
512 curlorients[3, i] = -1
513 curlorients[4, i] = -1
538 k = j + elemsize*(i - 1)
539 if (i - 1)%2 > 0
540 @test j == 2 || 10 + i == -ev[k]
541 @test j == 1 || 10 + i - 1 == -ev[k]