Commits

Vijay Mahadevan  committed e58d1a6

Fixes for minor warnings and test diffs errors.

  • Participants
  • Parent commits b94ee70

Comments (0)

Files changed (2)

File src/dm/impls/moab/examples/tests/ex2.cxx

 PetscErrorCode ProcessOptions(MPI_Comm comm, AppCtx *options)
 {
   PetscErrorCode ierr;
-  PetscBool      flg,is_user_fields;
+  PetscBool      flg;
 
   PetscFunctionBegin;
   options->debug             = PETSC_FALSE;
   options->input_file[0]     = '\0';
   ierr = PetscStrcpy(options->output_file,"ex2.h5m");CHKERRQ(ierr);
 
-  //ierr = PetscOptionsHasName("", "-fields", is_user_fields);
-
   ierr = PetscOptionsBegin(comm, "", "Meshing Problem Options", "DMMOAB");CHKERRQ(ierr);
   ierr = PetscOptionsBool("-debug", "Enable debug messages", "ex2.c", options->debug, &options->debug, NULL);CHKERRQ(ierr);
   ierr = PetscOptionsBool("-interlace", "Use interlaced arrangement for the field data", "ex2.c", options->interlace, &options->interlace, NULL);CHKERRQ(ierr);

File src/ts/examples/tutorials/ex30.cxx

 
   PetscInitialize(&argc,&argv,(char *)0,help);
 
-  // Fill in the user defined work context (creates mesh, solution field on mesh)
+  /* Fill in the user defined work context (creates mesh, solution field on mesh) */
   ierr = create_app_data(user);CHKERRQ(ierr);
 
-    // Create the DM to manage the mesh
+  /* Create the DM to manage the mesh */
   ierr = DMMoabCreateMoab(user.pcomm->comm(),user.mbint,user.pcomm,&user.id_tag,user.owned_vertexes,&dm);CHKERRQ(ierr);
   ierr = DMSetUp(dm);CHKERRQ(ierr);
 
-  // Create the solution vector:
+  /* Create the solution vector: */
   ierr = DMMoabCreateVector(dm,user.unknowns_tag,user.owned_vertexes,PETSC_TRUE,PETSC_FALSE,&X);CHKERRQ(ierr);
-    // Create the matrix
+  /* Create the matrix */
   ierr = create_matrix(user, dm, &J);CHKERRQ(ierr);
 
-  /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-     Create timestepping solver context
-     - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+  /* Create timestepping solver context */
   ierr = TSCreate(PETSC_COMM_WORLD,&ts);CHKERRQ(ierr);
   ierr = TSSetType(ts,TSARKIMEX);CHKERRQ(ierr);
 
   maxsteps = 10000;
   ierr = TSSetDuration(ts,maxsteps,ftime);CHKERRQ(ierr);
 
-  /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-     Set initial conditions
-   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+  /* Set initial conditions */
   ierr = TSSetSolution(ts,X);CHKERRQ(ierr);
   ierr = VecGetSize(X,&mx);CHKERRQ(ierr);
   hx = 1.0/(PetscReal)(mx/2-1);
   dt = 0.4 * PetscSqr(hx) / user.alpha; /* Diffusive stability limit */
   ierr = TSSetInitialTimeStep(ts,0.0,dt);CHKERRQ(ierr);
 
-  // /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-  //    Set runtime options
-  //  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+  /* Set runtime options */
   ierr = TSSetFromOptions(ts);CHKERRQ(ierr);
 
-  /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-     Solve nonlinear system
-     - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+  /* Solve nonlinear system */
   ierr = TSSolve(ts,X);CHKERRQ(ierr);
   ierr = TSGetSolveTime(ts,&ftime);CHKERRQ(ierr);
   ierr = TSGetTimeStepNumber(ts,&steps);CHKERRQ(ierr);
   ierr = TSGetConvergedReason(ts,&reason);CHKERRQ(ierr);
   ierr = PetscPrintf(PETSC_COMM_WORLD,"%s at time %g after %D steps\n",TSConvergedReasons[reason],(double)ftime,steps);CHKERRQ(ierr);
 
-  /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-     Write out the final mesh
-   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+  /* Write out the final mesh */
   merr = user.mbint->write_file("ex30.h5m");MBERRNM(merr);
 
-  /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-     Free work space.
-   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+  ierr = VecView(X,PETSC_VIEWER_STDOUT_WORLD);CHKERRQ(ierr);
 
-  // Free all PETSc related resources:
+  /* Free work space. */
   ierr = MatDestroy(&J);CHKERRQ(ierr);
   ierr = VecDestroy(&X);CHKERRQ(ierr);
   ierr = TSDestroy(&ts);CHKERRQ(ierr);
   ierr = DMDestroy(&dm);CHKERRQ(ierr);
 
-  // Free all MOAB related resources:
+  /* Free all MOAB related resources */
   ierr = destroy_app_data(user);CHKERRQ(ierr);
 
   ierr = PetscFinalize();
 
   // Add tags on shared vertexes:
   merr = user->pcomm->reduce_tags(f_tag,MPI_SUM,*user->shared_vertexes);MBERRNM(merr);
-
-  // Print vectors for debugging:
-  // ierr = PetscPrintf(PETSC_COMM_WORLD, "X\n");CHKERRQ(ierr);
-  // ierr = VecView(X,PETSC_VIEWER_STDOUT_WORLD);CHKERRQ(ierr);
-
-  // ierr = PetscPrintf(PETSC_COMM_WORLD, "Xdot\n");CHKERRQ(ierr);
-  // ierr = VecView(Xdot,PETSC_VIEWER_STDOUT_WORLD);CHKERRQ(ierr);
-
-  // ierr = PetscPrintf(PETSC_COMM_WORLD, "F\n");CHKERRQ(ierr);
-  // ierr = VecView(F,PETSC_VIEWER_STDOUT_WORLD);CHKERRQ(ierr);
-
   PetscFunctionReturn(0);
 }
 
   /* Restore vectors */
   ierr = VecRestoreArray(X,reinterpret_cast<PetscScalar**>(&x));CHKERRQ(ierr);
   ierr = VecRestoreArray(F,reinterpret_cast<PetscScalar**>(&f));CHKERRQ(ierr);
-
-  // Print vectors for debugging:
-  /* ierr = PetscPrintf(PETSC_COMM_WORLD,"RHS");CHKERRQ(ierr); */
-  /* ierr = VecView(F,PETSC_VIEWER_STDOUT_WORLD);CHKERRQ(ierr); */
-
   PetscFunctionReturn(0);
 }
 
     ierr = MatAssemblyBegin(J,MAT_FINAL_ASSEMBLY);CHKERRQ(ierr);
     ierr = MatAssemblyEnd(J,MAT_FINAL_ASSEMBLY);CHKERRQ(ierr);
   }
-
-  /* ierr = MatView(*J,PETSC_VIEWER_STDOUT_WORLD);CHKERRQ(ierr); */
-
   PetscFunctionReturn(0);
 }
 
   const PetscInt my_npts = my_nele + 1;
 
   // Create the local portion of the mesh:
-
   // Create vertexes and set the coodinate of each vertex:
   moab::EntityHandle vertex_first;
   std::vector<double*> vertex_coords;
   merr = readMeshIface->update_adjacencies(edge_first,my_nele,2,connectivity);MBERRNM(merr);
 
   // Set tags on all of the vertexes...
-
   // Create tag handle to represent the unknowns, u and v and
   // initialize them. We will create a single tag whose type is an
   // array of two doubles and whose name is "unknowns"
   // Everything is set up, now just do a tag exchange to update tags
   // on all of the shared vertexes:
   merr = pcomm->exchange_tags(id_tag,owned_vertexes);MBERRNM(merr);
-
   PetscFunctionReturn(0);
 }
 
     SETERRQ2(PETSC_COMM_SELF,PETSC_ERR_LIB,"Tag data not laid out contiguously %i %i",
 	     count,user.all_vertexes->size());
   }
-
   PetscFunctionReturn(0);
 }
 
   // Clean up:
   ierr = ISLocalToGlobalMappingDestroy(&ltog);CHKERRQ(ierr);
   delete [] gindices;
-
   PetscFunctionReturn(0);
 }