/// @file /// Test assembly of non-symmetric Poisson operator (multi-component) /// \test Test assembly of non-symmetric Poisson operator (multi-component) #include #include #include #include "t567-operator.h" int main(int argc, char **argv) { Ceed ceed; CeedElemRestriction elem_restr_x, elem_restr_u, elem_restr_qd_i; CeedBasis basis_x, basis_u; CeedQFunction qf_setup, qf_diff; CeedOperator op_setup, op_diff; CeedVector q_data, X, U, V; CeedInt P = 3, Q = 3, dim = 2, num_comp = 2; CeedInt n_x = 1, n_y = 1; CeedInt num_elem = n_x * n_y; CeedInt num_dofs = (n_x*(P-1)+1)*(n_y*(P-1)+1), num_qpts = num_elem*Q*Q; CeedInt ind_x[num_elem*P*P]; CeedScalar assembled[num_comp*num_comp*num_dofs*num_dofs]; CeedScalar x[dim*num_dofs], assembled_true[num_comp*num_comp*num_dofs*num_dofs]; CeedScalar *u; const CeedScalar *v; CeedInit(argv[1], &ceed); // DoF Coordinates for (CeedInt i=0; i 0) u[indOld] = 0.0; indOld = ind; CeedVectorRestoreArray(U, &u); // Compute effect of DoF j CeedOperatorApply(op_diff, U, V, CEED_REQUEST_IMMEDIATE); CeedVectorGetArrayRead(V, CEED_MEM_HOST, &v); for (CeedInt k=0; k 100.*CEED_EPSILON) // LCOV_EXCL_START printf("[(%" CeedInt_FMT ", %" CeedInt_FMT "), (%" CeedInt_FMT ", %" CeedInt_FMT ")] Error in assembly: %f != %f\n", node_out, comp_out, node_in, comp_in, assembled_value, assembled_true_value); // LCOV_EXCL_STOP } } } } // Cleanup free(rows); free(cols); CeedVectorDestroy(&values); CeedQFunctionDestroy(&qf_setup); CeedQFunctionDestroy(&qf_diff); CeedOperatorDestroy(&op_setup); CeedOperatorDestroy(&op_diff); CeedElemRestrictionDestroy(&elem_restr_u); CeedElemRestrictionDestroy(&elem_restr_x); CeedElemRestrictionDestroy(&elem_restr_qd_i); CeedBasisDestroy(&basis_u); CeedBasisDestroy(&basis_x); CeedVectorDestroy(&X); CeedVectorDestroy(&q_data); CeedVectorDestroy(&U); CeedVectorDestroy(&V); CeedDestroy(&ceed); return 0; }