Lines Matching refs:dm

22 static PetscErrorCode CreateMesh(MPI_Comm comm, AppCtx *options, DM *dm)  in CreateMesh()  argument
25 PetscCall(DMCreate(comm, dm)); in CreateMesh()
26 PetscCall(DMSetType(*dm, DMPLEX)); in CreateMesh()
27 PetscCall(DMSetFromOptions(*dm)); in CreateMesh()
28 PetscCall(DMViewFromOptions(*dm, NULL, "-dm_view")); in CreateMesh()
33 static PetscErrorCode test0(DM dm, AppCtx *options) in test0() argument
38 PetscCall(DMGetLocalVector(dm, &locX)); in test0()
39 PetscCall(DMRestoreLocalVector(dm, &locX)); in test0()
44 static PetscErrorCode test1(DM dm, AppCtx *options) in test1() argument
52 PetscCall(DMGetLocalVector(dm, &locX)); in test1()
53 PetscCall(DMGetLocalVector(dm, &locX_t)); in test1()
54 PetscCall(DMGetLocalVector(dm, &locA)); in test1()
55 PetscCall(DMPlexGetCellFields(dm, cells, locX, locX_t, locA, &u, &u_t, &a)); in test1()
56 PetscCall(DMPlexRestoreCellFields(dm, cells, locX, locX_t, locA, &u, &u_t, &a)); in test1()
57 PetscCall(DMRestoreLocalVector(dm, &locX)); in test1()
58 PetscCall(DMRestoreLocalVector(dm, &locX_t)); in test1()
59 PetscCall(DMRestoreLocalVector(dm, &locA)); in test1()
65 static PetscErrorCode test2(DM dm, AppCtx *options) in test2() argument
73 PetscCallMPI(MPI_Comm_rank(PetscObjectComm((PetscObject)dm), &rank)); in test2()
75 PetscCall(DMGetLocalVector(dm, &locX)); in test2()
76 PetscCall(DMGetLocalVector(dm, &locX_t)); in test2()
77 PetscCall(DMGetLocalVector(dm, &locA)); in test2()
78 PetscCall(DMPlexGetCellFields(dm, cells, locX, locX_t, locA, &u, &u_t, &a)); in test2()
79 PetscCall(DMPlexRestoreCellFields(dm, cells, locX, locX_t, locA, &u, &u_t, &a)); in test2()
80 PetscCall(DMRestoreLocalVector(dm, &locX)); in test2()
81 PetscCall(DMRestoreLocalVector(dm, &locX_t)); in test2()
82 PetscCall(DMRestoreLocalVector(dm, &locA)); in test2()
87 static PetscErrorCode test3(DM dm, AppCtx *options) in test3() argument
95 PetscCall(DMGetDimension(dm, &dim)); in test3()
96 PetscCall(DMPlexIsSimplex(dm, &simplex)); in test3()
97 PetscCall(DMGetDS(dm, &ds)); in test3()
98 PetscCall(PetscFECreateDefault(PetscObjectComm((PetscObject)dm), dim, 1, simplex, NULL, -1, &fe)); in test3()
101 PetscCall(test1(dm, options)); in test3()
105 static PetscErrorCode test4(DM dm, AppCtx *options) in test4() argument
112 PetscCall(DMGetDimension(dm, &dim)); in test4()
113 PetscCall(DMPlexIsSimplex(dm, &simplex)); in test4()
114 PetscCall(PetscFECreateDefault(PetscObjectComm((PetscObject)dm), dim, 1, simplex, NULL, -1, &fe)); in test4()
115 PetscCall(DMSetField(dm, 0, NULL, (PetscObject)fe)); in test4()
117 PetscCall(DMCreateDS(dm)); in test4()
118 PetscCall(test2(dm, options)); in test4()
122 static PetscErrorCode test5(DM dm, AppCtx *options) in test5() argument
132 PetscCall(DMGetLocalVector(dm, &locX)); in test5()
133 PetscCall(DMPlexGetCellFields(dm, cells, locX, locX_t, locA, &u, &u_t, &a)); in test5()
134 PetscCall(DMPlexRestoreCellFields(dm, cells, locX, locX_t, locA, &u, &u_t, &a)); in test5()
135 PetscCall(DMRestoreLocalVector(dm, &locX)); in test5()
140 static PetscErrorCode test6(DM dm, AppCtx *options) in test6() argument
148 PetscCallMPI(MPI_Comm_rank(PetscObjectComm((PetscObject)dm), &rank)); in test6()
152 PetscCall(DMGetLocalVector(dm, &locX)); in test6()
153 PetscCall(DMPlexGetCellFields(dm, cells, locX, locX_t, locA, &u, &u_t, &a)); in test6()
154 PetscCall(DMPlexRestoreCellFields(dm, cells, locX, locX_t, locA, &u, &u_t, &a)); in test6()
155 PetscCall(DMRestoreLocalVector(dm, &locX)); in test6()
160 static PetscErrorCode test7(DM dm, AppCtx *options) in test7() argument
167 PetscCall(DMGetDimension(dm, &dim)); in test7()
168 PetscCall(DMPlexIsSimplex(dm, &simplex)); in test7()
169 PetscCall(PetscFECreateDefault(PetscObjectComm((PetscObject)dm), dim, 1, simplex, NULL, -1, &fe)); in test7()
170 PetscCall(DMSetField(dm, 0, NULL, (PetscObject)fe)); in test7()
172 PetscCall(DMCreateDS(dm)); in test7()
173 PetscCall(test5(dm, options)); in test7()
177 static PetscErrorCode test8(DM dm, AppCtx *options) in test8() argument
184 PetscCall(DMGetDimension(dm, &dim)); in test8()
185 PetscCall(DMPlexIsSimplex(dm, &simplex)); in test8()
186 PetscCall(PetscFECreateDefault(PetscObjectComm((PetscObject)dm), dim, 1, simplex, NULL, -1, &fe)); in test8()
187 PetscCall(DMSetField(dm, 0, NULL, (PetscObject)fe)); in test8()
189 PetscCall(DMCreateDS(dm)); in test8()
190 PetscCall(test6(dm, options)); in test8()
197 DM dm; in main() local
204 PetscCall(CreateMesh(comm, &options, &dm)); in main()
208 PetscCall(test0(dm, &options)); in main()
211 PetscCall(test1(dm, &options)); in main()
214 PetscCall(test2(dm, &options)); in main()
217 PetscCall(test3(dm, &options)); in main()
220 PetscCall(test4(dm, &options)); in main()
223 PetscCall(test5(dm, &options)); in main()
226 PetscCall(test6(dm, &options)); in main()
229 PetscCall(test7(dm, &options)); in main()
232 PetscCall(test8(dm, &options)); in main()
238 PetscCall(DMDestroy(&dm)); in main()