Lines Matching full:dim
8 static CeedScalar Eval(CeedInt dim, const CeedScalar x[]) { in Eval() argument
10 if (dim > 1) result += atan(x[1] + 0.2); in Eval()
11 if (dim > 2) result += exp(-(x[2] + 0.3) * (x[2] + 0.3)); in Eval()
15 static CeedScalar GetTolerance(CeedScalarType scalar_type, int dim) { in GetTolerance() argument
18 if (dim == 3) tol = 0.05; in GetTolerance()
31 for (CeedInt dim = 1; dim <= 3; dim++) { in main() local
34 …eedInt p = 8, q = 10, p_dim = CeedIntPow(p, dim), q_dim = CeedIntPow(q, dim), x_dim = CeedIntPo… in main()
37 CeedVectorCreate(ceed, x_dim * dim, &x); in main()
39 CeedScalar x_array[x_dim * dim]; in main()
41 for (CeedInt d = 0; d < dim; d++) { in main()
46 CeedVectorCreate(ceed, p_dim * dim, &x_q); in main()
49 CeedVectorCreate(ceed, q_dim * dim, &u_q); in main()
51 CeedVectorCreate(ceed, q_dim * dim, &ones); in main()
57 CeedBasisCreateTensorH1Lagrange(ceed, dim, dim, 2, p, CEED_GAUSS_LOBATTO, &basis_x_lobatto); in main()
66 CeedScalar coord[dim]; in main()
68 for (CeedInt d = 0; d < dim; d++) coord[d] = x_q_array[d * p_dim + i]; in main()
69 u_array[i] = Eval(dim, coord); in main()
76 CeedBasisCreateTensorH1Lagrange(ceed, dim, 1, p, q, CEED_GAUSS, &basis_u_gauss); in main()
88 for (CeedInt i = 0; i < dim * q_dim; i++) sum_2 += u_q_array[i]; in main()
98 CeedScalar tol = GetTolerance(scalar_type, dim); in main()
100 … if (fabs(sum_1 - sum_2) > tol) printf("[%" CeedInt_FMT "] %0.12f != %0.12f\n", dim, sum_1, sum_2); in main()