Lines Matching refs:user

51 PetscErrorCode CreateMesh(MPI_Comm comm, AppCtx *user)  in CreateMesh()  argument
57 PetscCall(PetscLogEventBegin(user->createMeshEvent, 0, 0, 0, 0)); in CreateMesh()
59 PetscCall(PetscStrlen(user->input_file, &len)); in CreateMesh()
61 …if (user->debug) PetscCall(PetscPrintf(comm, "Loading mesh from file: %s and creating the coarse l… in CreateMesh()
62 PetscCall(DMMoabLoadFromFile(comm, user->dim, user->nghost, user->input_file, "", &user->dm)); in CreateMesh()
64 if (user->debug) in CreateMesh()
65 …nt_FMT " in memory and creating a DM object.\n", user->dim, user->simplex ? "simplex" : "regular",… in CreateMesh()
66 user->nele, user->nele)); in CreateMesh()
67 …PetscCall(DMMoabCreateBoxMesh(comm, user->dim, user->simplex, NULL, user->nele, user->nghost, &use… in CreateMesh()
69 PetscCall(PetscObjectSetName((PetscObject)user->dm, "Coarse Mesh")); in CreateMesh()
70 PetscCall(PetscLogEventEnd(user->createMeshEvent, 0, 0, 0, 0)); in CreateMesh()
76 AppCtx user; /* user-defined work context */ in main() local
89 PetscCall(ProcessOptions(comm, &user)); in main()
90 PetscCall(CreateMesh(comm, &user)); in main()
91 PetscCall(DMSetFromOptions(user.dm)); in main()
94 PetscCall(DMSetUp(user.dm)); in main()
96 PetscCall(PetscMalloc(sizeof(DM) * (user.nlevels + 1), &dmhierarchy)); in main()
97 for (i = 0; i <= user.nlevels; i++) dmhierarchy[i] = NULL; in main()
101 dmhierarchy[0] = user.dm; in main()
102 PetscCall(PetscObjectReference((PetscObject)user.dm)); in main()
104 if (user.nlevels) { in main()
105 PetscCall(PetscMalloc1(user.nlevels, &degrees)); in main()
106 for (i = 0; i < user.nlevels; i++) degrees[i] = user.degree; in main()
107 …if (user.debug) PetscCall(PetscPrintf(comm, "Generate the MOAB mesh hierarchy with %" PetscInt_FMT… in main()
108 PetscCall(DMMoabGenerateHierarchy(user.dm, user.nlevels, degrees)); in main()
111 if (usehierarchy) PetscCall(DMRefineHierarchy(user.dm, user.nlevels, &dmhierarchy[1])); in main()
113 if (user.debug) { in main()
115 PetscCall(DMView(user.dm, 0)); in main()
117 for (i = 1; i <= user.nlevels; i++) { in main()
118 if (user.debug) PetscCall(PetscPrintf(PETSC_COMM_WORLD, "Level %" PetscInt_FMT "\n", i)); in main()
121 if (user.debug) { in main()
133 if (user.write_output) { in main()
134 …if (user.debug) PetscCall(PetscPrintf(comm, "Output mesh hierarchy to file: %s.\n", user.output_fi… in main()
135 PetscCall(DMMoabOutput(dmhierarchy[user.nlevels], (const char *)user.output_file, "")); in main()
138 for (i = 0; i <= user.nlevels; i++) PetscCall(DMDestroy(&dmhierarchy[i])); in main()
141 PetscCall(DMDestroy(&user.dm)); in main()