Actual source code: ex2.c

  1: static char help[] = "Create a mesh, refine and coarsen simultaneously, and transfer a field\n\n";

  3: #include <petscds.h>
  4: #include <petscdmplex.h>
  5: #include <petscdmforest.h>

  7: static PetscErrorCode AddIdentityLabel(DM dm)
  8: {
  9:   PetscInt pStart, pEnd, p;

 11:   PetscFunctionBegin;
 12:   PetscCall(DMCreateLabel(dm, "identity"));
 13:   PetscCall(DMPlexGetChart(dm, &pStart, &pEnd));
 14:   for (p = pStart; p < pEnd; p++) PetscCall(DMSetLabelValue(dm, "identity", p, p));
 15:   PetscFunctionReturn(PETSC_SUCCESS);
 16: }

 18: static PetscErrorCode CreateAdaptivityLabel(DM forest, DMLabel *adaptLabel)
 19: {
 20:   DMLabel  identLabel;
 21:   PetscInt cStart, cEnd, c;

 23:   PetscFunctionBegin;
 24:   PetscCall(DMLabelCreate(PETSC_COMM_SELF, "adapt", adaptLabel));
 25:   PetscCall(DMLabelSetDefaultValue(*adaptLabel, DM_ADAPT_COARSEN));
 26:   PetscCall(DMGetLabel(forest, "identity", &identLabel));
 27:   PetscCall(DMForestGetCellChart(forest, &cStart, &cEnd));
 28:   for (c = cStart; c < cEnd; c++) {
 29:     PetscInt basePoint;

 31:     PetscCall(DMLabelGetValue(identLabel, c, &basePoint));
 32:     if (!basePoint) PetscCall(DMLabelSetValue(*adaptLabel, c, DM_ADAPT_REFINE));
 33:   }
 34:   PetscFunctionReturn(PETSC_SUCCESS);
 35: }

 37: static PetscErrorCode LinearFunction(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nf, PetscScalar u[], PetscCtx ctx)
 38: {
 39:   PetscFunctionBeginUser;
 40:   u[0] = (x[0] * 2.0 + 1.) + (x[1] * 20.0 + 10.) + ((dim == 3) ? (x[2] * 200.0 + 100.) : 0.);
 41:   PetscFunctionReturn(PETSC_SUCCESS);
 42: }

 44: static PetscErrorCode MultiaffineFunction(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nf, PetscScalar u[], PetscCtx ctx)
 45: {
 46:   PetscFunctionBeginUser;
 47:   u[0] = (x[0] * 1.0 + 2.0) * (x[1] * 3.0 - 4.0) * ((dim == 3) ? (x[2] * 5.0 + 6.0) : 1.);
 48:   PetscFunctionReturn(PETSC_SUCCESS);
 49: }

 51: static PetscErrorCode CoordsFunction(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nf, PetscScalar u[], PetscCtx ctx)
 52: {
 53:   PetscFunctionBeginUser;
 54:   for (PetscInt f = 0; f < Nf; f++) u[f] = x[f];
 55:   PetscFunctionReturn(PETSC_SUCCESS);
 56: }

 58: typedef struct _bc_func_ctx {
 59:   PetscErrorCode (*func)(PetscInt, PetscReal, const PetscReal[], PetscInt, PetscScalar[], void *);
 60:   PetscInt dim;
 61:   PetscInt Nf;
 62:   void    *ctx;
 63: } bc_func_ctx;

 65: static PetscErrorCode bc_func_fv(PetscReal time, const PetscReal *c, const PetscReal *n, const PetscScalar *xI, PetscScalar *xG, PetscCtx ctx)
 66: {
 67:   bc_func_ctx *bcCtx;

 69:   PetscFunctionBegin;
 70:   bcCtx = (bc_func_ctx *)ctx;
 71:   PetscCall(bcCtx->func(bcCtx->dim, time, c, bcCtx->Nf, xG, bcCtx->ctx));
 72:   PetscFunctionReturn(PETSC_SUCCESS);
 73: }

 75: static PetscErrorCode IdentifyBadPoints(DM dm, Vec vec, PetscReal tol)
 76: {
 77:   DM           dmplex;
 78:   PetscInt     p, pStart, pEnd, maxDof;
 79:   Vec          vecLocal;
 80:   DMLabel      depthLabel;
 81:   PetscSection section;

 83:   PetscFunctionBegin;
 84:   PetscCall(DMCreateLocalVector(dm, &vecLocal));
 85:   PetscCall(DMGlobalToLocalBegin(dm, vec, INSERT_VALUES, vecLocal));
 86:   PetscCall(DMGlobalToLocalEnd(dm, vec, INSERT_VALUES, vecLocal));
 87:   PetscCall(DMConvert(dm, DMPLEX, &dmplex));
 88:   PetscCall(DMPlexGetChart(dmplex, &pStart, &pEnd));
 89:   PetscCall(DMPlexGetDepthLabel(dmplex, &depthLabel));
 90:   PetscCall(DMGetLocalSection(dmplex, &section));
 91:   PetscCall(PetscSectionGetMaxDof(section, &maxDof));
 92:   for (p = pStart; p < pEnd; p++) {
 93:     PetscInt     s, c, cSize, parent, childID, numChildren;
 94:     PetscInt     cl, closureSize, *closure = NULL;
 95:     PetscScalar *values = NULL;
 96:     PetscBool    bad    = PETSC_FALSE;

 98:     PetscCall(VecGetValuesSection(vecLocal, section, p, &values));
 99:     PetscCall(PetscSectionGetDof(section, p, &cSize));
100:     for (c = 0; c < cSize; c++) {
101:       PetscReal absDiff = PetscAbsScalar(values[c]);
102:       if (absDiff > tol) {
103:         bad = PETSC_TRUE;
104:         break;
105:       }
106:     }
107:     if (!bad) continue;
108:     PetscCall(PetscPrintf(PETSC_COMM_SELF, "Bad point %" PetscInt_FMT "\n", p));
109:     PetscCall(DMLabelGetValue(depthLabel, p, &s));
110:     PetscCall(PetscPrintf(PETSC_COMM_SELF, "  Depth %" PetscInt_FMT "\n", s));
111:     PetscCall(DMPlexGetTransitiveClosure(dmplex, p, PETSC_TRUE, &closureSize, &closure));
112:     for (cl = 0; cl < closureSize; cl++) {
113:       PetscInt cp = closure[2 * cl];
114:       PetscCall(DMPlexGetTreeParent(dmplex, cp, &parent, &childID));
115:       if (parent != cp) PetscCall(PetscPrintf(PETSC_COMM_SELF, "  Closure point %" PetscInt_FMT " (%" PetscInt_FMT ") child of %" PetscInt_FMT " (ID %" PetscInt_FMT ")\n", cl, cp, parent, childID));
116:       PetscCall(DMPlexGetTreeChildren(dmplex, cp, &numChildren, NULL));
117:       if (numChildren) PetscCall(PetscPrintf(PETSC_COMM_SELF, "  Closure point %" PetscInt_FMT " (%" PetscInt_FMT ") is parent\n", cl, cp));
118:     }
119:     PetscCall(DMPlexRestoreTransitiveClosure(dmplex, p, PETSC_TRUE, &closureSize, &closure));
120:     for (c = 0; c < cSize; c++) {
121:       PetscReal absDiff = PetscAbsScalar(values[c]);
122:       if (absDiff > tol) PetscCall(PetscPrintf(PETSC_COMM_SELF, "  Bad dof %" PetscInt_FMT "\n", c));
123:     }
124:   }
125:   PetscCall(DMDestroy(&dmplex));
126:   PetscCall(VecDestroy(&vecLocal));
127:   PetscFunctionReturn(PETSC_SUCCESS);
128: }

130: int main(int argc, char **argv)
131: {
132:   MPI_Comm comm;
133:   DM       base, preForest, postForest;
134:   PetscInt dim, Nf          = 1;
135:   PetscInt step, adaptSteps = 1;
136:   PetscInt preCount, postCount;
137:   Vec      preVec, postVecTransfer, postVecExact;
138:   PetscErrorCode (*funcs[1])(PetscInt, PetscReal, const PetscReal[], PetscInt, PetscScalar[], void *) = {MultiaffineFunction};
139:   void       *ctxs[1]                                                                                 = {NULL};
140:   PetscReal   diff, tol = PETSC_SMALL;
141:   PetscBool   linear                = PETSC_FALSE;
142:   PetscBool   coords                = PETSC_FALSE;
143:   PetscBool   useFV                 = PETSC_FALSE;
144:   PetscBool   conv                  = PETSC_FALSE;
145:   PetscBool   transfer_from_base[2] = {PETSC_TRUE, PETSC_FALSE};
146:   PetscBool   use_bcs               = PETSC_TRUE;
147:   bc_func_ctx bcCtx;
148:   DMLabel     adaptLabel;

150:   PetscFunctionBeginUser;
151:   PetscCall(PetscInitialize(&argc, &argv, NULL, help));
152:   comm = PETSC_COMM_WORLD;
153:   PetscOptionsBegin(comm, "", "DMForestTransferVec() Test Options", "DMFOREST");
154:   PetscCall(PetscOptionsBool("-linear", "Transfer a simple linear function", "ex2.c", linear, &linear, NULL));
155:   PetscCall(PetscOptionsBool("-coords", "Transfer a simple coordinate function", "ex2.c", coords, &coords, NULL));
156:   PetscCall(PetscOptionsBool("-use_fv", "Use a finite volume approximation", "ex2.c", useFV, &useFV, NULL));
157:   PetscCall(PetscOptionsBool("-test_convert", "Test conversion to DMPLEX", NULL, conv, &conv, NULL));
158:   PetscCall(PetscOptionsBool("-transfer_from_base", "Transfer a vector from base DM to DMForest", "ex2.c", transfer_from_base[0], &transfer_from_base[0], NULL));
159:   transfer_from_base[1] = transfer_from_base[0];
160:   PetscCall(PetscOptionsBool("-transfer_from_base_steps", "Transfer a vector from base DM to the latest DMForest after the adaptivity steps", "ex2.c", transfer_from_base[1], &transfer_from_base[1], NULL));
161:   PetscCall(PetscOptionsBool("-use_bcs", "Use dirichlet boundary conditions", "ex2.c", use_bcs, &use_bcs, NULL));
162:   PetscCall(PetscOptionsBoundedInt("-adapt_steps", "Number of adaptivity steps", "ex2.c", adaptSteps, &adaptSteps, NULL, 0));
163:   PetscOptionsEnd();

165:   tol = PetscMax(1.e-10, tol); /* XXX fix for quadruple precision -> why do I need to do this? */

167:   /* the base mesh */
168:   PetscCall(DMCreate(comm, &base));
169:   PetscCall(DMSetType(base, DMPLEX));
170:   PetscCall(DMSetFromOptions(base));

172:   PetscCall(AddIdentityLabel(base));
173:   PetscCall(DMGetDimension(base, &dim));

175:   if (linear) funcs[0] = LinearFunction;
176:   if (coords) {
177:     funcs[0] = CoordsFunction;
178:     Nf       = dim;
179:   }

181:   bcCtx.func = funcs[0];
182:   bcCtx.dim  = dim;
183:   bcCtx.Nf   = Nf;
184:   bcCtx.ctx  = NULL;

186:   if (useFV) {
187:     PetscFV      fv;
188:     PetscLimiter limiter;
189:     DM           baseFV;

191:     PetscCall(DMPlexConstructGhostCells(base, NULL, NULL, &baseFV));
192:     PetscCall(DMViewFromOptions(baseFV, NULL, "-fv_dm_view"));
193:     PetscCall(DMDestroy(&base));
194:     base = baseFV;
195:     PetscCall(PetscFVCreate(PETSC_COMM_SELF, &fv));
196:     PetscCall(PetscFVSetSpatialDimension(fv, dim));
197:     PetscCall(PetscFVSetType(fv, PETSCFVLEASTSQUARES));
198:     PetscCall(PetscFVSetNumComponents(fv, Nf));
199:     PetscCall(PetscLimiterCreate(comm, &limiter));
200:     PetscCall(PetscLimiterSetType(limiter, PETSCLIMITERNONE));
201:     PetscCall(PetscFVSetLimiter(fv, limiter));
202:     PetscCall(PetscLimiterDestroy(&limiter));
203:     PetscCall(PetscFVSetFromOptions(fv));
204:     PetscCall(DMSetField(base, 0, NULL, (PetscObject)fv));
205:     PetscCall(PetscFVDestroy(&fv));
206:   } else {
207:     PetscFE fe;

209:     PetscCall(PetscFECreateDefault(comm, dim, Nf, PETSC_FALSE, NULL, PETSC_DEFAULT, &fe));
210:     PetscCall(DMSetField(base, 0, NULL, (PetscObject)fe));
211:     PetscCall(PetscFEDestroy(&fe));
212:   }
213:   PetscCall(DMCreateDS(base));

215:   if (use_bcs) {
216:     PetscInt ids[] = {1, 2, 3, 4, 5, 6};
217:     DMLabel  label;

219:     PetscCall(DMGetLabel(base, "marker", &label));
220:     PetscCall(DMAddBoundary(base, DM_BC_ESSENTIAL, "bc", label, 2 * dim, ids, 0, 0, NULL, useFV ? (PetscVoidFn *)bc_func_fv : (PetscVoidFn *)funcs[0], NULL, useFV ? (void *)&bcCtx : NULL, NULL));
221:   }
222:   PetscCall(DMViewFromOptions(base, NULL, "-dm_base_view"));

224:   /* the pre adaptivity forest */
225:   PetscCall(DMCreate(comm, &preForest));
226:   PetscCall(DMSetType(preForest, (dim == 2) ? DMP4EST : DMP8EST));
227:   PetscCall(DMCopyDisc(base, preForest));
228:   PetscCall(DMForestSetBaseDM(preForest, base));
229:   PetscCall(DMForestSetMinimumRefinement(preForest, 0));
230:   PetscCall(DMForestSetInitialRefinement(preForest, 1));
231:   PetscCall(DMSetFromOptions(preForest));
232:   PetscCall(DMSetUp(preForest));
233:   PetscCall(DMViewFromOptions(preForest, NULL, "-dm_pre_view"));

235:   /* the pre adaptivity field */
236:   PetscCall(DMCreateGlobalVector(preForest, &preVec));
237:   PetscCall(DMProjectFunction(preForest, 0., funcs, ctxs, INSERT_VALUES, preVec));
238:   PetscCall(VecViewFromOptions(preVec, NULL, "-vec_pre_view"));

240:   /* communicate between base and pre adaptivity forest */
241:   if (transfer_from_base[0]) {
242:     Vec baseVec, baseVecMapped;

244:     PetscCall(DMGetGlobalVector(base, &baseVec));
245:     PetscCall(DMProjectFunction(base, 0., funcs, ctxs, INSERT_VALUES, baseVec));
246:     PetscCall(PetscObjectSetName((PetscObject)baseVec, "Function Base"));
247:     PetscCall(VecViewFromOptions(baseVec, NULL, "-vec_base_view"));

249:     PetscCall(DMGetGlobalVector(preForest, &baseVecMapped));
250:     PetscCall(DMForestTransferVecFromBase(preForest, baseVec, baseVecMapped));
251:     PetscCall(VecViewFromOptions(baseVecMapped, NULL, "-vec_map_base_view"));

253:     /* compare */
254:     PetscCall(VecAXPY(baseVecMapped, -1., preVec));
255:     PetscCall(VecViewFromOptions(baseVecMapped, NULL, "-vec_map_diff_view"));
256:     PetscCall(VecNorm(baseVecMapped, NORM_2, &diff));

258:     /* output */
259:     if (diff < tol) {
260:       PetscCall(PetscPrintf(comm, "DMForestTransferVecFromBase() passes.\n"));
261:     } else {
262:       PetscCall(PetscPrintf(comm, "DMForestTransferVecFromBase() fails with error %g and tolerance %g\n", (double)diff, (double)tol));
263:     }

265:     PetscCall(DMRestoreGlobalVector(base, &baseVec));
266:     PetscCall(DMRestoreGlobalVector(preForest, &baseVecMapped));
267:   }

269:   for (step = 0; step < adaptSteps; ++step) {
270:     if (!transfer_from_base[1]) PetscCall(PetscObjectGetReference((PetscObject)preForest, &preCount));

272:     /* adapt */
273:     PetscCall(CreateAdaptivityLabel(preForest, &adaptLabel));
274:     PetscCall(DMForestTemplate(preForest, comm, &postForest));
275:     if (step) PetscCall(DMForestSetAdaptivityLabel(postForest, adaptLabel));
276:     PetscCall(DMLabelDestroy(&adaptLabel));
277:     PetscCall(DMSetUp(postForest));
278:     PetscCall(DMViewFromOptions(postForest, NULL, "-dm_post_view"));

280:     /* transfer */
281:     PetscCall(DMCreateGlobalVector(postForest, &postVecTransfer));
282:     PetscCall(DMForestTransferVec(preForest, preVec, postForest, postVecTransfer, PETSC_TRUE, 0.0));
283:     PetscCall(VecViewFromOptions(postVecTransfer, NULL, "-vec_post_transfer_view"));

285:     /* the exact post adaptivity field */
286:     PetscCall(DMCreateGlobalVector(postForest, &postVecExact));
287:     PetscCall(DMProjectFunction(postForest, 0., funcs, ctxs, INSERT_VALUES, postVecExact));
288:     PetscCall(VecViewFromOptions(postVecExact, NULL, "-vec_post_exact_view"));

290:     /* compare */
291:     PetscCall(VecAXPY(postVecExact, -1., postVecTransfer));
292:     PetscCall(VecViewFromOptions(postVecExact, NULL, "-vec_diff_view"));
293:     PetscCall(VecNorm(postVecExact, NORM_2, &diff));

295:     /* output */
296:     if (diff < tol) {
297:       PetscCall(PetscPrintf(comm, "DMForestTransferVec() passes.\n"));
298:     } else {
299:       PetscCall(PetscPrintf(comm, "DMForestTransferVec() fails with error %g and tolerance %g\n", (double)diff, (double)tol));
300:       PetscCall(IdentifyBadPoints(postForest, postVecExact, tol));
301:     }
302:     PetscCall(VecDestroy(&postVecExact));

304:     /* disconnect preForest from postForest if we don't test the transfer throughout the entire refinement process */
305:     if (!transfer_from_base[1]) {
306:       PetscCall(DMForestSetAdaptivityForest(postForest, NULL));
307:       PetscCall(PetscObjectGetReference((PetscObject)preForest, &postCount));
308:       PetscCheck(postCount == preCount, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Adaptation not memory neutral: reference count increase from %" PetscInt_FMT " to %" PetscInt_FMT, preCount, postCount);
309:     }

311:     if (conv) {
312:       DM dmConv;

314:       PetscCall(DMConvert(postForest, DMPLEX, &dmConv));
315:       PetscCall(DMViewFromOptions(dmConv, NULL, "-dm_conv_view"));
316:       PetscCall(DMPlexCheckCellShape(dmConv, PETSC_TRUE, PETSC_DETERMINE));
317:       PetscCall(DMDestroy(&dmConv));
318:     }

320:     PetscCall(VecDestroy(&preVec));
321:     PetscCall(DMDestroy(&preForest));

323:     preVec    = postVecTransfer;
324:     preForest = postForest;
325:   }

327:   if (transfer_from_base[1]) {
328:     Vec baseVec, baseVecMapped;

330:     /* communicate between base and last adapted forest */
331:     PetscCall(DMGetGlobalVector(base, &baseVec));
332:     PetscCall(DMProjectFunction(base, 0., funcs, ctxs, INSERT_VALUES, baseVec));
333:     PetscCall(PetscObjectSetName((PetscObject)baseVec, "Function Base"));
334:     PetscCall(VecViewFromOptions(baseVec, NULL, "-vec_base_view"));

336:     PetscCall(DMGetGlobalVector(preForest, &baseVecMapped));
337:     PetscCall(DMForestTransferVecFromBase(preForest, baseVec, baseVecMapped));
338:     PetscCall(VecViewFromOptions(baseVecMapped, NULL, "-vec_map_base_view"));

340:     /* compare */
341:     PetscCall(VecAXPY(baseVecMapped, -1., preVec));
342:     PetscCall(VecViewFromOptions(baseVecMapped, NULL, "-vec_map_diff_view"));
343:     PetscCall(VecNorm(baseVecMapped, NORM_2, &diff));

345:     /* output */
346:     if (diff < tol) {
347:       PetscCall(PetscPrintf(comm, "DMForestTransferVecFromBase() passes.\n"));
348:     } else {
349:       PetscCall(PetscPrintf(comm, "DMForestTransferVecFromBase() fails with error %g and tolerance %g\n", (double)diff, (double)tol));
350:     }

352:     PetscCall(DMRestoreGlobalVector(base, &baseVec));
353:     PetscCall(DMRestoreGlobalVector(preForest, &baseVecMapped));
354:   }

356:   /* cleanup */
357:   PetscCall(VecDestroy(&preVec));
358:   PetscCall(DMDestroy(&preForest));
359:   PetscCall(DMDestroy(&base));
360:   PetscCall(PetscFinalize());
361:   return 0;
362: }

364: /*TEST
365:   testset:
366:     args: -dm_plex_simplex 0 -dm_plex_box_faces 3,3,3 -petscspace_type tensor

368:     test:
369:       output_file: output/ex2_2d.out
370:       suffix: p4est_2d
371:       args: -petscspace_degree 2
372:       nsize: 3
373:       requires: p4est !single

375:     test:
376:       output_file: output/ex2_2d.out
377:       suffix: p4est_2d_deg4
378:       args: -petscspace_degree 4
379:       requires: p4est !single

381:     test:
382:       output_file: output/ex2_2d.out
383:       suffix: p4est_2d_deg8
384:       args: -petscspace_degree 8
385:       requires: p4est !single

387:     test:
388:       output_file: output/ex2_steps2.out
389:       suffix: p4est_2d_deg2_steps2
390:       args: -petscspace_degree 2 -coords -adapt_steps 2
391:       nsize: 3
392:       requires: p4est !single

394:     test:
395:       output_file: output/ex2_steps3.out
396:       suffix: p4est_2d_deg3_steps3
397:       args: -petscspace_degree 3 -coords -adapt_steps 3 -petscdualspace_lagrange_node_type equispaced -petscdualspace_lagrange_node_endpoints 1
398:       nsize: 3
399:       requires: p4est !single

401:     test:
402:       output_file: output/ex2_steps3.out
403:       suffix: p4est_2d_deg3_steps3_L2_periodic
404:       args: -petscspace_degree 3 -petscdualspace_lagrange_continuity 0 -coords -adapt_steps 3 -dm_plex_box_bd periodic,periodic -use_bcs 0 -petscdualspace_lagrange_node_type equispaced
405:       nsize: 3
406:       requires: p4est !single

408:     test:
409:       output_file: output/ex2_steps3.out
410:       suffix: p4est_3d_deg2_steps3_L2_periodic
411:       args: -dm_plex_dim 3 -petscspace_degree 2 -petscdualspace_lagrange_continuity 0 -coords -adapt_steps 3 -dm_plex_box_bd periodic,periodic,periodic -use_bcs 0
412:       nsize: 3
413:       requires: p4est !single

415:     test:
416:       output_file: output/ex2_steps2.out
417:       suffix: p4est_3d_deg2_steps2
418:       args: -dm_plex_dim 3 -petscspace_degree 2 -coords -adapt_steps 2
419:       nsize: 3
420:       requires: p4est !single

422:     test:
423:       output_file: output/ex2_steps3.out
424:       suffix: p4est_3d_deg3_steps3
425:       args: -dm_plex_dim 3 -petscspace_degree 3 -coords -adapt_steps 3 -petscdualspace_lagrange_node_type equispaced -petscdualspace_lagrange_node_endpoints 1
426:       nsize: 3
427:       requires: p4est !single

429:     test:
430:       output_file: output/ex2_3d.out
431:       suffix: p4est_3d
432:       args: -dm_plex_dim 3 -petscspace_degree 1
433:       nsize: 3
434:       requires: p4est !single

436:     test:
437:       output_file: output/ex2_3d.out
438:       suffix: p4est_3d_deg3
439:       args: -dm_plex_dim 3 -petscspace_degree 3
440:       nsize: 3
441:       requires: p4est !single

443:     test:
444:       output_file: output/ex2_2d.out
445:       suffix: p4est_2d_deg2_coords
446:       args: -petscspace_degree 2 -coords
447:       nsize: 3
448:       requires: p4est !single

450:     test:
451:       output_file: output/ex2_3d.out
452:       suffix: p4est_3d_deg2_coords
453:       args: -dm_plex_dim 3 -petscspace_degree 2 -coords
454:       nsize: 3
455:       requires: p4est !single

457:     test:
458:       suffix: p4est_3d_nans
459:       args: -dm_plex_dim 3 -dm_forest_partition_overlap 1 -test_convert -petscspace_degree 1
460:       nsize: 2
461:       requires: p4est !single

463:     test:
464:       TODO: not broken, but the 3D case below is broken, so I do not trust this one
465:       output_file: output/ex2_steps2.out
466:       suffix: p4est_2d_tfb_distributed_nc
467:       args: -petscspace_degree 3 -dm_forest_maximum_refinement 2 -dm_p4est_refine_pattern hash -use_bcs 0 -coords -adapt_steps 2 -petscpartitioner_type shell -petscpartitioner_shell_random
468:       nsize: 3
469:       requires: p4est !single

471:     test:
472:       TODO: broken
473:       output_file: output/ex2_steps2.out
474:       suffix: p4est_3d_tfb_distributed_nc
475:       args: -dm_plex_dim 3 -petscspace_degree 2 -dm_forest_maximum_refinement 2 -dm_p4est_refine_pattern hash -use_bcs 0 -coords -adapt_steps 2 -petscpartitioner_type shell -petscpartitioner_shell_random
476:       nsize: 3
477:       requires: p4est !single

479:   testset:
480:     args: -petscspace_type tensor -dm_coord_space 0 -dm_plex_transform_type refine_tobox

482:     test:
483:       TODO: broken
484:       output_file: output/ex2_3d.out
485:       suffix: p4est_3d_transfer_fails
486:       args: -petscspace_degree 1 -dm_plex_filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/doublet-tet.msh -adapt_steps 1 -dm_forest_initial_refinement 1 -use_bcs 0 -dm_refine
487:       requires: p4est !single

489:     test:
490:       TODO: broken
491:       output_file: output/ex2_steps2_notfb.out
492:       suffix: p4est_3d_transfer_fails_2
493:       args: -petscspace_degree 1 -dm_plex_filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/doublet-tet.msh -adapt_steps 2 -dm_forest_initial_refinement 0 -transfer_from_base 0 -use_bcs 0 -dm_refine
494:       requires: p4est !single

496:     test:
497:       output_file: output/ex2_steps2.out
498:       suffix: p4est_3d_multi_transfer_s2t
499:       args: -petscspace_degree 3 -dm_plex_filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/doublet-tet.msh -adapt_steps 2 -dm_forest_initial_refinement 1 -petscdualspace_lagrange_continuity 0 -use_bcs 0 -dm_refine 1
500:       requires: p4est !single

502:     test:
503:       output_file: output/ex2_steps2.out
504:       suffix: p4est_3d_coords_transfer_s2t
505:       args: -petscspace_degree 3 -dm_plex_filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/doublet-tet.msh -adapt_steps 2 -dm_forest_initial_refinement 1 -petscdualspace_lagrange_continuity 0 -coords -use_bcs 0 -dm_refine 1
506:       requires: p4est !single

508:   testset:
509:     args: -dm_plex_simplex 0 -dm_plex_box_faces 3,3,3

511:     test:
512:       output_file: output/ex2_2d_fv.out
513:       suffix: p4est_2d_fv
514:       args: -transfer_from_base 0 -use_fv -linear -dm_forest_partition_overlap 1
515:       nsize: 3
516:       requires: p4est !single

518:     test:
519:       TODO: broken (codimension adjacency)
520:       output_file: output/ex2_2d_fv.out
521:       suffix: p4est_2d_fv_adjcodim
522:       args: -transfer_from_base 0 -use_fv -linear -dm_forest_partition_overlap 1 -dm_forest_adjacency_codimension 1
523:       nsize: 2
524:       requires: p4est !single

526:     test:
527:       TODO: broken (dimension adjacency)
528:       output_file: output/ex2_2d_fv.out
529:       suffix: p4est_2d_fv_adjdim
530:       args: -transfer_from_base 0 -use_fv -linear -dm_forest_partition_overlap 1 -dm_forest_adjacency_dimension 1
531:       nsize: 2
532:       requires: p4est !single

534:     test:
535:       output_file: output/ex2_2d_fv.out
536:       suffix: p4est_2d_fv_zerocells
537:       args: -transfer_from_base 0 -use_fv -linear -dm_forest_partition_overlap 1
538:       nsize: 10
539:       requires: p4est !single

541:     test:
542:       output_file: output/ex2_3d_fv.out
543:       suffix: p4est_3d_fv
544:       args: -dm_plex_dim 3 -transfer_from_base 0 -use_fv -linear -dm_forest_partition_overlap 1
545:       nsize: 3
546:       requires: p4est !single

548: TEST*/