Lines Matching full:n
1 static char help[] = "Tests 1D Gauss-Lobatto-Legendre discretization on [-1, 1].\n\n";
8 PetscInt n = 3, i; in main() local
13 PetscCall(PetscOptionsGetInt(NULL, NULL, "-n", &n, NULL)); in main()
15 PetscCall(PetscMalloc1(n, &la_nodes)); in main()
16 PetscCall(PetscMalloc1(n, &la_weights)); in main()
17 PetscCall(PetscMalloc1(n, &n_nodes)); in main()
18 PetscCall(PetscMalloc1(n, &n_weights)); in main()
19 …PetscCall(PetscDTGaussLobattoLegendreQuadrature(n, PETSCGAUSSLOBATTOLEGENDRE_VIA_LINEAR_ALGEBRA, l… in main()
21 …C_VIEWER_STDOUT_SELF, "Gauss-Lobatto-Legendre nodes and weights computed via linear algebra: \n")); in main()
22 PetscCall(PetscRealView(n, la_nodes, PETSC_VIEWER_STDOUT_SELF)); in main()
23 PetscCall(PetscRealView(n, la_weights, PETSC_VIEWER_STDOUT_SELF)); in main()
24 …PetscCall(PetscDTGaussLobattoLegendreQuadrature(n, PETSCGAUSSLOBATTOLEGENDRE_VIA_NEWTON, n_nodes, … in main()
25 …ntf(PETSC_VIEWER_STDOUT_SELF, "Gauss-Lobatto-Legendre nodes and weights computed via Newton: \n")); in main()
26 PetscCall(PetscRealView(n, n_nodes, PETSC_VIEWER_STDOUT_SELF)); in main()
27 PetscCall(PetscRealView(n, n_weights, PETSC_VIEWER_STDOUT_SELF)); in main()
29 for (i = 0; i < n; i++) { in main()
33 PetscCall(PetscViewerASCIIPrintf(PETSC_VIEWER_STDOUT_SELF, "Difference: \n")); in main()
34 PetscCall(PetscRealView(n, la_nodes, PETSC_VIEWER_STDOUT_SELF)); in main()
35 PetscCall(PetscRealView(n, la_weights, PETSC_VIEWER_STDOUT_SELF)); in main()