Actual source code: ex1.c

petsc-3.10.3 2018-12-18
Report Typos and Errors
  1: static char help[] = "Run C version of TetGen to construct and refine a mesh\n\n";

  3:  #include <petscdmplex.h>

  5: typedef enum {BOX, CYLINDER} DomainShape;
  6: enum {STAGE_LOAD, STAGE_DISTRIBUTE, STAGE_REFINE, STAGE_OVERLAP};

  8: typedef struct {
  9:   DM            dm;                /* REQUIRED in order to use SNES evaluation functions */
 10:   PetscInt      debug;             /* The debugging level */
 11:   PetscLogEvent createMeshEvent;
 12:   PetscLogStage stages[4];
 13:   /* Domain and mesh definition */
 14:   PetscInt      dim;                             /* The topological mesh dimension */
 15:   PetscBool     interpolate;                     /* Generate intermediate mesh elements */
 16:   PetscReal     refinementLimit;                 /* The largest allowable cell volume */
 17:   PetscBool     cellSimplex;                     /* Use simplices or hexes */
 18:   PetscBool     cellWedge;                       /* Use wedges */
 19:   PetscBool     simplex2tensor;                  /* Refine simplicials in hexes */
 20:   DomainShape   domainShape;                     /* Shape of the region to be meshed */
 21:   PetscInt      *domainBoxSizes;                 /* Sizes of the box mesh */
 22:   DMBoundaryType periodicity[3];                 /* The domain periodicity */
 23:   char          filename[PETSC_MAX_PATH_LEN];    /* Import mesh from file */
 24:   char          bdfilename[PETSC_MAX_PATH_LEN];  /* Import mesh boundary from file */
 25:   char          extfilename[PETSC_MAX_PATH_LEN]; /* Import 2D mesh to be extruded from file */
 26:   PetscBool     testPartition;                   /* Use a fixed partitioning for testing */
 27:   PetscInt      overlap;                         /* The cell overlap to use during partitioning */
 28:   PetscBool     testShape;                       /* Test the cell shape quality */
 29:   PetscBool     check[3];                        /* Runs DMPlex checks on the mesh */
 30:   PetscReal     extrude_thickness;               /* Thickness of extrusion */
 31:   PetscInt      extrude_layers;                  /* Layers to be extruded */
 32: } AppCtx;

 34: PetscErrorCode ProcessOptions(MPI_Comm comm, AppCtx *options)
 35: {
 36:   const char      *dShapes[2] = {"box", "cylinder"};
 37:   PetscInt        shape, bd, n;
 38:   static PetscInt domainBoxSizes[3] = {1,1,1};
 39:   PetscBool       flg;
 40:   PetscErrorCode  ierr;

 43:   options->debug             = 0;
 44:   options->dim               = 2;
 45:   options->interpolate       = PETSC_FALSE;
 46:   options->refinementLimit   = 0.0;
 47:   options->cellSimplex       = PETSC_TRUE;
 48:   options->cellWedge         = PETSC_FALSE;
 49:   options->domainShape       = BOX;
 50:   options->domainBoxSizes    = NULL;
 51:   options->periodicity[0]    = DM_BOUNDARY_NONE;
 52:   options->periodicity[1]    = DM_BOUNDARY_NONE;
 53:   options->periodicity[2]    = DM_BOUNDARY_NONE;
 54:   options->filename[0]       = '\0';
 55:   options->bdfilename[0]     = '\0';
 56:   options->extfilename[0]    = '\0';
 57:   options->testPartition     = PETSC_FALSE;
 58:   options->overlap           = PETSC_FALSE;
 59:   options->testShape         = PETSC_FALSE;
 60:   options->simplex2tensor    = PETSC_FALSE;
 61:   options->check[0]          = PETSC_FALSE;
 62:   options->check[1]          = PETSC_FALSE;
 63:   options->check[2]          = PETSC_FALSE;
 64:   options->extrude_layers    = 2;
 65:   options->extrude_thickness = 0.1;

 67:   PetscOptionsBegin(comm, "", "Meshing Problem Options", "DMPLEX");
 68:   PetscOptionsInt("-debug", "The debugging level", "ex1.c", options->debug, &options->debug, NULL);
 69:   PetscOptionsInt("-dim", "The topological mesh dimension", "ex1.c", options->dim, &options->dim, NULL);
 70:   PetscOptionsBool("-interpolate", "Generate intermediate mesh elements", "ex1.c", options->interpolate, &options->interpolate, NULL);
 71:   PetscOptionsReal("-refinement_limit", "The largest allowable cell volume", "ex1.c", options->refinementLimit, &options->refinementLimit, NULL);
 72:   PetscOptionsBool("-cell_simplex", "Use simplices if true, otherwise hexes", "ex1.c", options->cellSimplex, &options->cellSimplex, NULL);
 73:   PetscOptionsBool("-cell_wedge", "Use wedges if true", "ex1.c", options->cellWedge, &options->cellWedge, NULL);
 74:   PetscOptionsBool("-simplex2tensor", "Refine simplicial cells in tensor product cells", "ex1.c", options->simplex2tensor, &options->simplex2tensor, NULL);
 75:   if (options->simplex2tensor) options->interpolate = PETSC_TRUE;
 76:   shape = options->domainShape;
 77:   PetscOptionsEList("-domain_shape","The shape of the domain","ex1.c", dShapes, 2, dShapes[options->domainShape], &shape, NULL);
 78:   options->domainShape = (DomainShape) shape;
 79:   PetscOptionsIntArray("-domain_box_sizes","The sizes of the box domain","ex1.c", domainBoxSizes, (n=3,&n), &flg);
 80:   if (flg) { options->domainShape = BOX; options->domainBoxSizes = domainBoxSizes;}
 81:   bd = options->periodicity[0];
 82:   PetscOptionsEList("-x_periodicity", "The x-boundary periodicity", "ex1.c", DMBoundaryTypes, 5, DMBoundaryTypes[options->periodicity[0]], &bd, NULL);
 83:   options->periodicity[0] = (DMBoundaryType) bd;
 84:   bd = options->periodicity[1];
 85:   PetscOptionsEList("-y_periodicity", "The y-boundary periodicity", "ex1.c", DMBoundaryTypes, 5, DMBoundaryTypes[options->periodicity[1]], &bd, NULL);
 86:   options->periodicity[1] = (DMBoundaryType) bd;
 87:   bd = options->periodicity[2];
 88:   PetscOptionsEList("-z_periodicity", "The z-boundary periodicity", "ex1.c", DMBoundaryTypes, 5, DMBoundaryTypes[options->periodicity[2]], &bd, NULL);
 89:   options->periodicity[2] = (DMBoundaryType) bd;
 90:   PetscOptionsString("-filename", "The mesh file", "ex1.c", options->filename, options->filename, PETSC_MAX_PATH_LEN, NULL);
 91:   PetscOptionsString("-bd_filename", "The mesh boundary file", "ex1.c", options->bdfilename, options->bdfilename, PETSC_MAX_PATH_LEN, NULL);
 92:   PetscOptionsString("-ext_filename", "The 2D mesh file to be extruded", "ex1.c", options->extfilename, options->extfilename, PETSC_MAX_PATH_LEN, NULL);
 93:   PetscOptionsInt("-ext_layers", "The number of layers to extrude", "ex1.c", options->extrude_layers, &options->extrude_layers, NULL);
 94:   PetscOptionsReal("-ext_thickness", "The thickness of the layer to be extruded", "ex1.c", options->extrude_thickness, &options->extrude_thickness, NULL);
 95:   PetscOptionsBool("-test_partition", "Use a fixed partition for testing", "ex1.c", options->testPartition, &options->testPartition, NULL);
 96:   PetscOptionsInt("-overlap", "The cell overlap for partitioning", "ex1.c", options->overlap, &options->overlap, NULL);
 97:   PetscOptionsBool("-test_shape", "Report cell shape qualities (Jacobian condition numbers)", "ex1.c", options->testShape, &options->testShape, NULL);
 98:   PetscOptionsBool("-check_symmetry", "Run DMPlexCheckSymmetry", "ex1.c", options->check[0], &options->check[0], NULL);
 99:   PetscOptionsBool("-check_skeleton", "Run DMPlexCheckSkeleton", "ex1.c", options->check[1], &options->check[1], NULL);
100:   PetscOptionsBool("-check_faces", "Run DMPlexCheckFaces", "ex1.c", options->check[2], &options->check[2], NULL);
101:   PetscOptionsEnd();

103:   PetscLogEventRegister("CreateMesh", DM_CLASSID, &options->createMeshEvent);
104:   PetscLogStageRegister("MeshLoad",       &options->stages[STAGE_LOAD]);
105:   PetscLogStageRegister("MeshDistribute", &options->stages[STAGE_DISTRIBUTE]);
106:   PetscLogStageRegister("MeshRefine",     &options->stages[STAGE_REFINE]);
107:   PetscLogStageRegister("MeshOverlap",    &options->stages[STAGE_OVERLAP]);
108:   return(0);
109: }

111: PetscErrorCode CreateMesh(MPI_Comm comm, AppCtx *user, DM *dm)
112: {
113:   PetscInt       dim                  = user->dim;
114:   PetscBool      interpolate          = user->interpolate;
115:   PetscReal      refinementLimit      = user->refinementLimit;
116:   PetscBool      cellSimplex          = user->cellSimplex;
117:   PetscBool      cellWedge            = user->cellWedge;
118:   PetscBool      simplex2tensor       = user->simplex2tensor;
119:   const char    *filename             = user->filename;
120:   const char    *bdfilename           = user->bdfilename;
121:   const char    *extfilename          = user->extfilename;
122:   PetscInt       triSizes_n2[2]       = {4, 4};
123:   PetscInt       triPoints_n2[8]      = {3, 5, 6, 7, 0, 1, 2, 4};
124:   PetscInt       triSizes_n8[8]       = {1, 1, 1, 1, 1, 1, 1, 1};
125:   PetscInt       triPoints_n8[8]      = {0, 1, 2, 3, 4, 5, 6, 7};
126:   PetscInt       quadSizes[2]         = {2, 2};
127:   PetscInt       quadPoints[4]        = {2, 3, 0, 1};
128:   PetscInt       gmshSizes_n3[3]      = {14, 14, 14};
129:   PetscInt       gmshPoints_n3[42]    = {1, 2,  4,  5,  9, 10, 11, 15, 16, 20, 21, 27, 28, 29,
130:                                          3, 8, 12, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
131:                                          0, 6,  7, 13, 14, 17, 18, 19, 22, 23, 24, 25, 26, 41};
132:   PetscInt       fluentSizes_n3[3]    = {50, 50, 50};
133:   PetscInt       fluentPoints_n3[150] = { 5,  6,  7,  8, 12, 14, 16,  34,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  48,  50,  51,  80,  81,  89,
134:                                          91, 93, 94, 95, 96, 97, 98,  99, 100, 101, 104, 121, 122, 124, 125, 126, 127, 128, 129, 131, 133, 143, 144, 145, 147,
135:                                           1,  3,  4,  9, 10, 17, 18,  19,  24,  25,  26,  27,  28,  29,  30,  31,  32,  33,  35,  47,  61,  71,  72,  73,  74,
136:                                          75, 76, 77, 78, 79, 86, 87,  88,  90,  92, 113, 115, 116, 117, 118, 119, 120, 123, 138, 140, 141, 142, 146, 148, 149,
137:                                           0,  2, 11, 13, 15, 20, 21,  22,  23,  49,  52,  53,  54,  55,  56,  57,  58,  59,  60,  62,  63,  64,  65,  66,  67,
138:                                          68, 69, 70, 82, 83, 84, 85, 102, 103, 105, 106, 107, 108, 109, 110, 111, 112, 114, 130, 132, 134, 135, 136, 137, 139};
139:   size_t         len, bdlen, extlen;
140:   PetscMPIInt    rank, size;

144:   PetscLogEventBegin(user->createMeshEvent,0,0,0,0);
145:   MPI_Comm_rank(comm, &rank);
146:   MPI_Comm_size(comm, &size);
147:   PetscStrlen(filename, &len);
148:   PetscStrlen(bdfilename, &bdlen);
149:   PetscStrlen(extfilename, &extlen);
150:   PetscLogStagePush(user->stages[STAGE_LOAD]);
151:   if (len) {
152:     DMPlexCreateFromFile(comm, filename, interpolate, dm);
153:   } else if (bdlen) {
154:     DM boundary;

156:     DMPlexCreateFromFile(comm, bdfilename, interpolate, &boundary);
157:     DMPlexGenerate(boundary, NULL, interpolate, dm);
158:     DMDestroy(&boundary);
159:   } else if (extlen) {
160:     DM edm;

162:     DMPlexCreateFromFile(comm, extfilename, interpolate, &edm);
163:     DMPlexExtrude(edm, user->extrude_layers, user->extrude_thickness, PETSC_TRUE, interpolate, dm);
164:     DMDestroy(&edm);
165:   } else {
166:     switch (user->domainShape) {
167:     case BOX:
168:       if (cellWedge) {
169:         if (dim != 3) SETERRQ1(comm, PETSC_ERR_ARG_WRONG, "Dimension must be 3 for a wedge mesh, not %D", dim);
170:         DMPlexCreateWedgeBoxMesh(comm, user->domainBoxSizes, NULL, NULL, user->periodicity, PETSC_FALSE, interpolate, dm);
171:       } else {
172:         DMPlexCreateBoxMesh(comm, dim, cellSimplex, user->domainBoxSizes, NULL, NULL, user->periodicity, interpolate, dm);
173:       }
174:       break;
175:     case CYLINDER:
176:       if (cellSimplex) SETERRQ(comm, PETSC_ERR_ARG_WRONG, "Cannot mesh a cylinder with simplices");
177:       if (dim != 3)    SETERRQ1(comm, PETSC_ERR_ARG_WRONG, "Dimension must be 3 for a cylinder mesh, not %D", dim);
178:       if (cellWedge) {
179:         DMPlexCreateWedgeCylinderMesh(comm, 6, interpolate, dm);
180:       } else {
181:         DMPlexCreateHexCylinderMesh(comm, 3, user->periodicity[2], dm);
182:       }
183:       break;
184:     default: SETERRQ1(comm, PETSC_ERR_ARG_WRONG, "Unknown domain shape %D", user->domainShape);
185:     }
186:   }

188:   DMLocalizeCoordinates(*dm); /* needed for periodic */
189:   PetscLogStagePop();
190:   {
191:     DM refinedMesh     = NULL;
192:     DM distributedMesh = NULL;

194:     if (user->testPartition) {
195:       const PetscInt  *sizes = NULL;
196:       const PetscInt  *points = NULL;
197:       PetscPartitioner part;

199:       if (!rank) {
200:         if (dim == 2 && cellSimplex && size == 2) {
201:            sizes = triSizes_n2; points = triPoints_n2;
202:         } else if (dim == 2 && cellSimplex && size == 8) {
203:           sizes = triSizes_n8; points = triPoints_n8;
204:         } else if (dim == 2 && !cellSimplex && size == 2) {
205:           sizes = quadSizes; points = quadPoints;
206:         } else if (dim == 2 && size == 3) {
207:           PetscInt Nc;

209:           DMPlexGetHeightStratum(*dm, 0, NULL, &Nc);
210:           if (Nc == 42) { /* Gmsh 3 & 4 */
211:             sizes = gmshSizes_n3; points = gmshPoints_n3;
212:           } else if (Nc == 150) { /* Fluent 1 */
213:             sizes = fluentSizes_n3; points = fluentPoints_n3;
214:           } else if (Nc == 42) { /* Med 1 */
215:           } else if (Nc == 161) { /* Med 3 */
216:           }
217:         }
218:       }
219:       DMPlexGetPartitioner(*dm, &part);
220:       PetscPartitionerSetType(part, PETSCPARTITIONERSHELL);
221:       PetscPartitionerShellSetPartition(part, size, sizes, points);
222:     } else {
223:       PetscPartitioner part;

225:       DMPlexGetPartitioner(*dm,&part);
226:       PetscPartitionerSetFromOptions(part);
227:     }
228:     /* Distribute mesh over processes */
229:     PetscLogStagePush(user->stages[STAGE_DISTRIBUTE]);
230:     DMPlexDistribute(*dm, 0, NULL, &distributedMesh);
231:     if (distributedMesh) {
232:       DMDestroy(dm);
233:       *dm  = distributedMesh;
234:     }
235:     PetscLogStagePop();
236:     /* Refine mesh using a volume constraint */
237:     PetscLogStagePush(user->stages[STAGE_REFINE]);
238:     DMPlexSetRefinementUniform(*dm, PETSC_FALSE);
239:     DMPlexSetRefinementLimit(*dm, refinementLimit);
240:     DMRefine(*dm, comm, &refinedMesh);
241:     if (refinedMesh) {
242:       DMDestroy(dm);
243:       *dm  = refinedMesh;
244:     }
245:     PetscLogStagePop();
246:   }
247:   PetscLogStagePush(user->stages[STAGE_REFINE]);
248:   DMSetFromOptions(*dm);
249:   PetscLogStagePop();
250:   if (user->overlap) {
251:     DM overlapMesh = NULL;
252:     /* Add the level-1 overlap to refined mesh */
253:     PetscLogStagePush(user->stages[STAGE_OVERLAP]);
254:     DMPlexDistributeOverlap(*dm, 1, NULL, &overlapMesh);
255:     if (overlapMesh) {
256:       DMView(overlapMesh, PETSC_VIEWER_STDOUT_WORLD);
257:       DMDestroy(dm);
258:       *dm = overlapMesh;
259:     }
260:     PetscLogStagePop();
261:   }
262:   if (simplex2tensor) {
263:     DM rdm = NULL;
264:     DMPlexSetRefinementUniform(*dm, PETSC_TRUE);
265:     DMPlexRefineSimplexToTensor(*dm, &rdm);
266:     if (rdm) {
267:       DMDestroy(dm);
268:       *dm  = rdm;
269:     }
270:     user->cellSimplex = PETSC_FALSE;
271:   }
272:   PetscObjectSetName((PetscObject) *dm, "Simplicial Mesh");
273:   DMViewFromOptions(*dm, NULL, "-dm_view");
274:   PetscLogEventEnd(user->createMeshEvent,0,0,0,0);
275:   user->dm = *dm;
276:   if (user->check[0]) {
277:     DMPlexCheckSymmetry(*dm);
278:   }
279:   if (user->check[1]) {
280:     DMPlexCheckSkeleton(*dm, user->cellSimplex, 0);
281:   }
282:   if (user->check[2]) {
283:     DMPlexCheckFaces(*dm, user->cellSimplex, 0);
284:   }
285:   return(0);
286: }

288: typedef struct ex1_stats
289: {
290:   PetscReal min, max, sum, squaresum;
291:   PetscInt  count;
292: }
293: ex1_stats_t;

295: static void ex1_stats_reduce(void *a, void *b, int * len, MPI_Datatype *datatype)
296: {
297:   PetscInt i, N = *len;

299:   for (i = 0; i < N; i++) {
300:     ex1_stats_t *A = (ex1_stats_t *) a;
301:     ex1_stats_t *B = (ex1_stats_t *) b;

303:     B->min = PetscMin(A->min,B->min);
304:     B->max = PetscMax(A->max,B->max);
305:     B->sum += A->sum;
306:     B->squaresum += A->squaresum;
307:     B->count += A->count;
308:   }
309: }

311: static PetscErrorCode TestCellShape(DM dm)
312: {
313:   PetscMPIInt    rank,size;
314:   PetscInt       dim, c, cStart, cEnd, cMax, count = 0;
315:   ex1_stats_t    stats, globalStats;
316:   PetscReal      *J, *invJ, min = 0, max = 0, mean = 0, stdev = 0;
317:   MPI_Comm       comm = PetscObjectComm((PetscObject)dm);
318:   DM             dmCoarse;

322:   stats.min = PETSC_MAX_REAL;
323:   stats.max = PETSC_MIN_REAL;
324:   stats.sum = stats.squaresum = 0.;
325:   stats.count = 0;

327:   DMGetCoordinateDim(dm,&dim);

329:   PetscMalloc2(dim * dim, &J, dim * dim, &invJ);

331:   DMPlexGetHeightStratum(dm,0,&cStart,&cEnd);
332:   DMPlexGetHybridBounds(dm,&cMax,NULL,NULL,NULL);
333:   cMax = cMax < 0 ? cEnd : cMax;
334:   for (c = cStart; c < cMax; c++) {
335:     PetscInt  i;
336:     PetscReal frobJ = 0., frobInvJ = 0., cond2, cond, detJ;

338:     DMPlexComputeCellGeometryAffineFEM(dm,c,NULL,J,invJ,&detJ);
339:     if (detJ < 0.0) SETERRQ1(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Mesh cell %D is inverted", c);

341:     for (i = 0; i < dim * dim; i++) {
342:       frobJ += J[i] * J[i];
343:       frobInvJ += invJ[i] * invJ[i];
344:     }
345:     cond2 = frobJ * frobInvJ;
346:     cond  = PetscSqrtReal(cond2);

348:     stats.min = PetscMin(stats.min,cond);
349:     stats.max = PetscMax(stats.max,cond);
350:     stats.sum += cond;
351:     stats.squaresum += cond2;
352:     stats.count++;
353:   }

355:   MPI_Comm_size(comm,&size);
356:   if (size > 1) {
357:     PetscMPIInt    blockLengths[2] = {4,1};
358:     MPI_Aint       blockOffsets[2] = {offsetof(ex1_stats_t,min),offsetof(ex1_stats_t,count)};
359:     MPI_Datatype   blockTypes[2]   = {MPIU_REAL,MPIU_INT}, statType;
360:     MPI_Op         statReduce;

362:     MPI_Type_create_struct(2,blockLengths,blockOffsets,blockTypes,&statType);
363:     MPI_Type_commit(&statType);
364:     MPI_Op_create(ex1_stats_reduce, PETSC_TRUE, &statReduce);
365:     MPI_Reduce(&stats,&globalStats,1,statType,statReduce,0,comm);
366:     MPI_Op_free(&statReduce);
367:     MPI_Type_free(&statType);
368:   } else {
369:     PetscMemcpy(&globalStats,&stats,sizeof(stats));
370:   }

372:   MPI_Comm_rank(comm,&rank);
373:   if (!rank) {
374:     count = globalStats.count;
375:     min = globalStats.min;
376:     max = globalStats.max;
377:     mean = globalStats.sum / globalStats.count;
378:     stdev = globalStats.count > 1 ? PetscSqrtReal((globalStats.squaresum - globalStats.count * mean * mean) / (globalStats.count - 1) ) : 0.0;
379:   }
380:   PetscPrintf(comm,"Mesh with %D cells, shape condition numbers: min = %g, max = %g, mean = %g, stddev = %g\n", count, (double) min, (double) max, (double) mean, (double) stdev);

382:   PetscFree2(J,invJ);

384:   DMGetCoarseDM(dm,&dmCoarse);
385:   if (dmCoarse) {
386:     TestCellShape(dmCoarse);
387:   }

389:   return(0);
390: }

392: int main(int argc, char **argv)
393: {
394:   AppCtx         user;                 /* user-defined work context */

397:   PetscInitialize(&argc, &argv, NULL, help);if (ierr) return ierr;
398:   ProcessOptions(PETSC_COMM_WORLD, &user);
399:   CreateMesh(PETSC_COMM_WORLD, &user, &user.dm);
400:   if (user.testShape) {
401:     TestCellShape(user.dm);
402:   }
403:   DMDestroy(&user.dm);
404:   PetscFinalize();
405:   return ierr;
406: }

408: /*TEST

410:   # CTetGen 0-1
411:   test:
412:     suffix: 0
413:     requires: ctetgen
414:     args: -dim 3 -ctetgen_verbose 4 -dm_view ascii::ascii_info_detail -info -info_exclude null
415:   test:
416:     suffix: 1
417:     requires: ctetgen
418:     args: -dim 3 -ctetgen_verbose 4 -refinement_limit 0.0625 -dm_view ascii::ascii_info_detail -info -info_exclude null

420:   # 2D LaTex and ASCII output 2-9
421:   test:
422:     suffix: 2
423:     requires: triangle
424:     args: -dim 2 -dm_view ascii::ascii_latex
425:   test:
426:     suffix: 3
427:     requires: triangle
428:     args: -dim 2 -dm_refine 1 -interpolate 1 -dm_view ascii::ascii_info_detail
429:   test:
430:     suffix: 4
431:     requires: triangle
432:     nsize: 2
433:     args: -dim 2 -dm_refine 1 -interpolate 1 -test_partition -dm_view ascii::ascii_info_detail
434:   test:
435:     suffix: 5
436:     requires: triangle
437:     nsize: 2
438:     args: -dim 2 -dm_refine 1 -interpolate 1 -test_partition -dm_view ascii::ascii_latex
439:   test:
440:     suffix: 6
441:     args: -dim 2 -cell_simplex 0 -interpolate -dm_view ascii::ascii_info_detail
442:   test:
443:     suffix: 7
444:     args: -dim 2 -cell_simplex 0 -interpolate -dm_refine 1 -dm_view ascii::ascii_info_detail
445:   test:
446:     suffix: 8
447:     nsize: 2
448:     args: -dim 2 -cell_simplex 0 -interpolate -dm_refine 1 -interpolate 1 -test_partition -dm_view ascii::ascii_latex

450:   # 1D ASCII output
451:   test:
452:     suffix: 1d_0
453:     args: -dim 1 -domain_shape box -dm_view ascii::ascii_info_detail
454:   test:
455:     suffix: 1d_1
456:     args: -dim 1 -domain_shape box -dm_refine 2 -dm_view ascii::ascii_info_detail
457:   test:
458:     suffix: 1d_2
459:     args: -dim 1 -domain_box_sizes 5 -x_periodicity periodic -dm_view ascii::ascii_info_detail -test_shape

461:   # Parallel refinement tests with overlap
462:   test:
463:     suffix: 1d_refine_overlap_0
464:     nsize: 2
465:     args: -dim 1 -domain_box_sizes 4 -dm_refine 1 -overlap 0 -petscpartitioner_type simple -dm_view ascii::ascii_info_detail
466:   test:
467:     suffix: 1d_refine_overlap_1
468:     nsize: 2
469:     args: -dim 1 -domain_box_sizes 4 -dm_refine 1 -overlap 1 -petscpartitioner_type simple -dm_view ascii::ascii_info_detail
470:   test:
471:     suffix: refine_overlap_0
472:     requires: triangle
473:     nsize: 2
474:     requires: triangle
475:     args: -dim 2 -cell_simplex 1 -dm_refine 1 -interpolate 1 -test_partition -overlap 1 -dm_view ascii::ascii_info_detail
476:   test:
477:     suffix: refine_overlap_1
478:     requires: triangle
479:     nsize: 8
480:     args: -dim 2 -cell_simplex 1 -dm_refine 1 -interpolate 1 -test_partition -overlap 1 -dm_view ascii::ascii_info_detail

482:   # Parallel simple partitioner tests
483:   test:
484:     suffix: part_simple_0
485:     requires: triangle
486:     nsize: 2
487:     args: -dim 2 -cell_simplex 1 -dm_refine 0 -interpolate 0 -petscpartitioner_type simple -partition_view -dm_view ascii::ascii_info_detail
488:   test:
489:     suffix: part_simple_1
490:     requires: triangle
491:     nsize: 8
492:     args: -dim 2 -cell_simplex 1 -dm_refine 1 -interpolate 1 -petscpartitioner_type simple -partition_view -dm_view ascii::ascii_info_detail

494:   test:
495:     suffix: part_parmetis_0
496:     requires: parmetis
497:     nsize: 2
498:     args: -dim 2 -cell_simplex 0 -dm_refine 1 -interpolate 1 -petscpartitioner_type parmetis -dm_view -petscpartitioner_view
499:   # Parallel ptscotch partitioner tests
500:   test:
501:     suffix: part_ptscotch_0
502:     requires: ptscotch
503:     nsize: 2
504:     args: -dim 2 -cell_simplex 0 -dm_refine 0 -interpolate 0 -petscpartitioner_type ptscotch -petscpartitioner_view -petscpartitioner_ptscotch_strategy quality
505:   test:
506:     suffix: part_ptscotch_1
507:     requires: ptscotch
508:     nsize: 8
509:     args: -dim 2 -cell_simplex 0 -dm_refine 1 -interpolate 1 -petscpartitioner_type ptscotch -petscpartitioner_view -petscpartitioner_ptscotch_imbalance 0.1

511:   # CGNS reader tests 10-11 (need to find smaller test meshes)
512:   test:
513:     suffix: cgns_0
514:     requires: cgns
515:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/tut21.cgns -interpolate 1 -dm_view

517:   # Gmsh mesh reader tests
518:   test:
519:     suffix: gmsh_0
520:     requires: !single
521:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/doublet-tet.msh -interpolate 1 -dm_view
522:   test:
523:     suffix: gmsh_1
524:     requires: !single
525:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/square.msh -interpolate 1 -dm_view
526:   test:
527:     suffix: gmsh_2
528:     requires: !single
529:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/square_bin.msh -interpolate 1 -dm_view
530:   test:
531:     suffix: gmsh_3
532:     nsize: 3
533:     requires: !single
534:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/square.msh -test_partition -interpolate 1 -dm_view
535:   test:
536:     suffix: gmsh_4
537:     nsize: 3
538:     requires: !single
539:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/square_bin.msh -test_partition -interpolate 1 -dm_view
540:   test:
541:     suffix: gmsh_5
542:     requires: !single
543:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/square_quad.msh -interpolate 1 -dm_view
544:   test:
545:     suffix: gmsh_6
546:     requires: !single
547:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/square_bin_physnames.msh -interpolate 1 -dm_view
548:   test:
549:     suffix: gmsh_7
550:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/cube_periodic_bin.msh -dm_plex_gmsh_periodic -dm_view ::ascii_info_detail -interpolate -test_shape
551:   test:
552:     suffix: gmsh_8
553:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/cube_periodic.msh -dm_plex_gmsh_periodic -dm_view ::ascii_info_detail -interpolate -test_shape
554:   test:
555:     suffix: gmsh_9
556:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/square_periodic_bin.msh -dm_plex_gmsh_periodic -dm_view ::ascii_info_detail -interpolate -test_shape
557:   test:
558:     suffix: gmsh_10
559:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/square_periodic.msh -dm_plex_gmsh_periodic -dm_view ::ascii_info_detail -interpolate -test_shape
560:   test:
561:     suffix: gmsh_11
562:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/square_periodic.msh -dm_plex_gmsh_periodic -dm_view ::ascii_info_detail -interpolate -test_shape -dm_refine 1
563:   test:
564:     suffix: gmsh_12
565:     nsize: 4
566:     requires: !single mpiio
567:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/square_bin_physnames.msh -viewer_binary_mpiio -petscpartitioner_type simple -interpolate 1 -dm_view
568:   test:
569:     suffix: gmsh_13_hybs2t
570:     nsize: 4
571:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/hybrid_triquad.msh -petscpartitioner_type simple -interpolate 1 -dm_view -test_shape -simplex2tensor -dm_plex_gmsh_hybrid -check_faces -check_skeleton -check_symmetry
572:   test:
573:     suffix: gmsh_14_ext
574:     requires: !single
575:     args: -ext_layers 2 -ext_thickness 1.5 -ext_filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/square_bin.msh -dm_view -check_symmetry -check_skeleton
576:   test:
577:     suffix: gmsh_14_ext_s2t
578:     requires: !single
579:     args: -ext_layers 2 -ext_thickness 1.5 -ext_filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/square_bin.msh -dm_view -interpolate -check_faces -check_symmetry -check_skeleton -simplex2tensor -test_shape
580:   test:
581:     suffix: gmsh_15_hyb3d
582:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/hybrid_tetwedge.msh -dm_view -interpolate -check_faces -check_symmetry -check_skeleton -dm_plex_gmsh_hybrid
583:   test:
584:     suffix: gmsh_15_hyb3d_vtk
585:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/hybrid_tetwedge.msh -dm_view vtk:
586:   test:
587:     suffix: gmsh_15_hyb3d_s2t
588:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/hybrid_tetwedge.msh -dm_view -interpolate -check_faces -check_symmetry -check_skeleton -dm_plex_gmsh_hybrid -simplex2tensor -test_shape
589:   test:
590:     suffix: gmsh_16_spheresurface
591:     nsize : 4
592:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/surfacesphere_bin.msh -dm_plex_gmsh_spacedim 3 -check_symmetry -check_faces -check_skeleton -dm_view -interpolate -test_shape -petscpartitioner_type simple
593:   test:
594:     suffix: gmsh_16_spheresurface_s2t
595:     nsize : 4
596:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/surfacesphere_bin.msh -dm_plex_gmsh_spacedim 3 -simplex2tensor -check_symmetry -check_faces -check_skeleton -dm_view -interpolate -test_shape -petscpartitioner_type simple
597:   test:
598:     suffix: gmsh_16_spheresurface_extruded
599:     nsize : 4
600:     args: -ext_layers 3 -ext_filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/surfacesphere_bin.msh -dm_plex_gmsh_hybrid -dm_plex_gmsh_spacedim 3 -check_symmetry -check_faces -check_skeleton -dm_view -interpolate -petscpartitioner_type simple
601:   test:
602:     suffix: gmsh_16_spheresurface_extruded_s2t
603:     nsize : 4
604:     args: -ext_layers 3 -ext_filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/surfacesphere_bin.msh -dm_plex_gmsh_spacedim 3 -simplex2tensor -check_symmetry -check_faces -check_skeleton -dm_view -interpolate -test_shape -petscpartitioner_type simple

606:   # Fluent mesh reader tests
607:   test:
608:     suffix: fluent_0
609:     requires: !complex
610:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/square.cas -interpolate 1 -dm_view
611:   test:
612:     suffix: fluent_1
613:     nsize: 3
614:     requires: !complex
615:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/square.cas -interpolate 1 -test_partition -dm_view
616:   test:
617:     suffix: fluent_2
618:     requires: !complex
619:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/cube_5tets_ascii.cas -interpolate 1 -dm_view
620:   test:
621:     suffix: fluent_3
622:     requires: !complex
623:     TODO: broken
624:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/cube_5tets.cas -interpolate 1 -dm_view

626:   # Med mesh reader tests, including parallel file reads
627:   test:
628:     suffix: med_0
629:     requires: med
630:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/square.med -interpolate 1 -dm_view
631:   test:
632:     suffix: med_1
633:     requires: med
634:     nsize: 3
635:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/square.med -interpolate 1 -petscpartitioner_type simple -dm_view
636:   test:
637:     suffix: med_2
638:     requires: med
639:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/cylinder.med -interpolate 1 -dm_view
640:   test:
641:     suffix: med_3
642:     requires: med
643:     nsize: 3
644:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/cylinder.med -interpolate 1 -petscpartitioner_type simple -dm_view

646:   # Test shape quality
647:   test:
648:     suffix: test_shape
649:     requires: ctetgen
650:     args: -dim 3 -interpolate -dm_refine_hierarchy 3 -test_shape

652:   # Test simplex to tensor conversion
653:   test:
654:     suffix: s2t2
655:     requires: triangle
656:     args: -dim 2 -simplex2tensor -refinement_limit 0.0625 -dm_view ascii::ascii_info_detail

658:   test:
659:     suffix: s2t3
660:     requires: ctetgen
661:     args: -dim 3 -simplex2tensor -refinement_limit 0.0625 -dm_view ascii::ascii_info_detail

663:   # Test domain shapes
664:   test:
665:     suffix: cylinder
666:     args: -dim 3 -cell_simplex 0 -interpolate -domain_shape cylinder -test_shape -dm_view

668:   test:
669:     suffix: cylinder_per
670:     args: -dim 3 -cell_simplex 0 -interpolate -domain_shape cylinder -z_periodicity periodic -test_shape -dm_view

672:   test:
673:     suffix: cylinder_wedge
674:     args: -dim 3 -cell_simplex 0 -interpolate 0 -cell_wedge -domain_shape cylinder -dm_view vtk: -check_symmetry -check_faces 0 -check_skeleton

676:   test:
677:     suffix: cylinder_wedge_int
678:     output_file: output/ex1_cylinder_wedge.out
679:     args: -dim 3 -cell_simplex 0 -interpolate -cell_wedge -domain_shape cylinder -dm_view vtk: -check_symmetry -check_faces -check_skeleton

681:   test:
682:     suffix: box_2d
683:     args: -dim 2 -cell_simplex 0 -interpolate -domain_shape box -dm_refine 2 -test_shape -dm_view

685:   test:
686:     suffix: box_2d_per
687:     args: -dim 2 -cell_simplex 0 -interpolate -domain_shape box -dm_refine 2 -test_shape -dm_view

689:   test:
690:     suffix: box_2d_per_unint
691:     args: -dim 2 -cell_simplex 0 -interpolate 0 -domain_shape box -domain_box_sizes 3,3 -test_shape -dm_view ::ascii_info_detail

693:   test:
694:     suffix: box_3d
695:     args: -dim 3 -cell_simplex 0 -interpolate -domain_shape box -dm_refine 3 -test_shape -dm_view

697:   test:
698:     requires: triangle
699:     suffix: box_wedge
700:     args: -dim 3 -cell_simplex 0 -interpolate -cell_wedge -domain_shape box -dm_view vtk: -check_symmetry -check_faces -check_skeleton

702:   testset:
703:     requires: triangle
704:     args: -dim 3 -cell_simplex 0 -interpolate -cell_wedge -domain_shape box -domain_box_sizes 2,3,1 -dm_view -check_symmetry -check_faces -check_skeleton -simplex2tensor -test_shape
705:     test:
706:       suffix: box_wedge_s2t
707:     test:
708:       nsize: 3
709:       args: -petscpartitioner_type simple
710:       suffix: box_wedge_s2t_parallel

712:   # Test GLVis output
713:   test:
714:     suffix: glvis_2d_tet
715:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/square_periodic.msh -dm_view glvis:

717:   test:
718:     suffix: glvis_2d_tet_per
719:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/square_periodic.msh -dm_plex_gmsh_periodic -dm_view glvis: -viewer_glvis_dm_plex_enable_boundary 0

721:   test:
722:     suffix: glvis_2d_tet_per_mfem
723:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/square_periodic.msh -dm_plex_gmsh_periodic -viewer_glvis_dm_plex_enable_mfem -dm_view glvis: -interpolate

725:   test:
726:     suffix: glvis_2d_quad
727:     args: -dim 2 -cell_simplex 0 -interpolate -domain_shape box -domain_box_sizes 3,3 -dm_view glvis:

729:   test:
730:     suffix: glvis_2d_quad_per
731:     args: -dim 2 -cell_simplex 0 -interpolate -domain_shape box -domain_box_sizes 3,3 -x_periodicity periodic -y_periodicity periodic -dm_view glvis:

733:   test:
734:     suffix: glvis_2d_quad_per_mfem
735:     args: -dim 2 -cell_simplex 0 -interpolate -domain_shape box -domain_box_sizes 3,3 -x_periodicity periodic -y_periodicity periodic -dm_view glvis: -viewer_glvis_dm_plex_enable_mfem

737:   test:
738:     suffix: glvis_3d_tet
739:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/cube_periodic_bin.msh -dm_view glvis:

741:   test:
742:     suffix: glvis_3d_tet_per
743:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/cube_periodic_bin.msh -dm_plex_gmsh_periodic -dm_view glvis: -interpolate

745:   test:
746:     suffix: glvis_3d_tet_per_mfem
747:     TODO: broken
748:     args: -filename ${wPETSC_DIR}/share/petsc/datafiles/meshes/cube_periodic_bin.msh -dm_plex_gmsh_periodic -viewer_glvis_dm_plex_enable_mfem -dm_view glvis: -interpolate

750:   test:
751:     suffix: glvis_3d_hex
752:     args: -dim 3 -cell_simplex 0 -domain_shape box -domain_box_sizes 3,3,3 -dm_view glvis:

754:   test:
755:     suffix: glvis_3d_hex_per
756:     args: -dim 3 -cell_simplex 0 -domain_shape box -domain_box_sizes 3,3,3 -x_periodicity periodic -y_periodicity periodic -z_periodicity periodic -dm_view glvis: -viewer_glvis_dm_plex_enable_boundary 0

758:   test:
759:     suffix: glvis_3d_hex_per_mfem
760:     args: -dim 3 -cell_simplex 0 -domain_shape box -domain_box_sizes 3,3,3 -x_periodicity periodic -y_periodicity periodic -z_periodicity periodic -dm_view glvis: -viewer_glvis_dm_plex_enable_mfem -interpolate

762: TEST*/