Lines Matching refs:user

57 PetscErrorCode CreateMesh(MPI_Comm comm, AppCtx *user)  in CreateMesh()  argument
64 PetscCall(PetscLogEventBegin(user->createMeshEvent, 0, 0, 0, 0)); in CreateMesh()
66 PetscCall(PetscStrlen(user->input_file, &len)); in CreateMesh()
68 …if (user->debug) PetscCall(PetscPrintf(comm, "Loading mesh from file: %s and creating a DM object.… in CreateMesh()
69 PetscCall(DMMoabLoadFromFile(comm, user->dim, 1, user->input_file, "", &user->dm)); in CreateMesh()
71 if (user->debug) { in CreateMesh()
72 …nt_FMT " in memory and creating a DM object.\n", user->dim, user->simplex ? "simplex" : "regular",… in CreateMesh()
73 user->nele, user->nele)); in CreateMesh()
75 PetscCall(DMMoabCreateBoxMesh(comm, user->dim, user->simplex, NULL, user->nele, 1, &user->dm)); in CreateMesh()
78 if (user->debug) { in CreateMesh()
80 …for (i = 0; i < user->nfields; i++) PetscCall(PetscPrintf(comm, "\t Field{%" PetscInt_FMT "} = %s.… in CreateMesh()
82 PetscCall(DMMoabSetFieldNames(user->dm, user->nfields, (const char **)user->fieldnames)); in CreateMesh()
83 PetscCall(PetscObjectSetName((PetscObject)user->dm, "Structured Mesh")); in CreateMesh()
84 PetscCall(PetscLogEventEnd(user->createMeshEvent, 0, 0, 0, 0)); in CreateMesh()
90 AppCtx user; /* user-defined work context */ in main() local
100 PetscCall(ProcessOptions(comm, &user)); in main()
101 PetscCall(CreateMesh(comm, &user)); in main()
104 PetscCall(DMMoabSetBlockSize(user.dm, user.interlace ? user.nfields : 1)); in main()
105 PetscCall(DMSetMatType(user.dm, MATAIJ)); in main()
107 PetscCall(DMSetFromOptions(user.dm)); in main()
110 PetscCall(DMSetUp(user.dm)); in main()
112 …if (user.debug) PetscCall(PetscPrintf(comm, "Creating a global vector defined on DM and setting ra… in main()
113 PetscCall(DMCreateGlobalVector(user.dm, &solution)); in main()
118 …if (user.debug) PetscCall(PetscPrintf(comm, "Creating a global matrix defined on DM with the right… in main()
119 PetscCall(DMCreateMatrix(user.dm, &system)); in main()
121 if (user.write_output) { in main()
122 PetscCall(DMMoabSetGlobalFieldVector(user.dm, solution)); in main()
123 …if (user.debug) PetscCall(PetscPrintf(comm, "Output mesh and associated field data to file: %s.\n"… in main()
124 PetscCall(DMMoabOutput(user.dm, (const char *)user.output_file, "")); in main()
127 if (user.nfields) { in main()
128 for (i = 0; i < user.nfields; i++) PetscCall(PetscFree(user.fieldnames[i])); in main()
133 PetscCall(DMDestroy(&user.dm)); in main()