1using Test, LibCEED, LinearAlgebra, StaticArrays 2 3@testset "LibCEED Development Tests" begin 4 @testset "QFunction" begin 5 c = Ceed() 6 @test showstr(create_interior_qfunction(c, "Poisson3DApply")) == """ 7 Gallery CeedQFunction Poisson3DApply 8 2 input fields: 9 Input field 0: 10 Name: "du" 11 Size: 3 12 EvalMode: "gradient" 13 Input field 1: 14 Name: "qdata" 15 Size: 6 16 EvalMode: "none" 17 1 output field: 18 Output field 0: 19 Name: "dv" 20 Size: 3 21 EvalMode: "gradient\"""" 22 end 23 24 @testset "Operator" begin 25 c = Ceed() 26 @interior_qf id = ( 27 c, 28 (input, :in, EVAL_INTERP), 29 (output, :out, EVAL_INTERP), 30 begin 31 output[] = input 32 end, 33 ) 34 b = create_tensor_h1_lagrange_basis(c, 3, 1, 3, 3, GAUSS_LOBATTO) 35 n = getnumnodes(b) 36 offsets = Vector{CeedInt}(0:n-1) 37 r = create_elem_restriction(c, 1, n, 1, 1, n, offsets) 38 op = Operator( 39 c; 40 qf=id, 41 fields=[ 42 (:input, r, b, CeedVectorActive()), 43 (:output, r, b, CeedVectorActive()), 44 ], 45 ) 46 @test showstr(op) == """ 47 CeedOperator 48 1 elements with 27 quadrature points each 49 2 fields 50 1 input field: 51 Input field 0: 52 Name: "input" 53 Active vector 54 1 output field: 55 Output field 0: 56 Name: "output" 57 Active vector""" 58 end 59end 60