message: Adding refinement control to ex3p
diff: @@ -57,6 +57,8 @@ int main(int argc, char *argv[])
  // 2. Parse command-line options.
  const char *mesh_file = "../data/beam-tet.mesh";
  + int ser_ref_levels = -1;
  + int par_ref_levels = 1;
  int order = 1;
  bool static_cond = false;
  bool visualization = 1;
  @@ -64,6 +66,10 @@ int main(int argc, char *argv[])
  OptionsParser args(argc, argv);
  args.AddOption(&mesh_file, "-m", "--mesh",
  "Mesh file to use.");
  + args.AddOption(&ser_ref_levels, "-rs", "--refine-serial",
  + "Number of times to refine the mesh uniformly in serial.");
  + args.AddOption(&par_ref_levels, "-rp", "--refine-parallel",
  + "Number of times to refine the mesh uniformly in parallel.");
  args.AddOption(&order, "-o", "--order",
  "Finite element order (polynomial degree).");
  args.AddOption(&freq, "-f", "--frequency", "Set the frequency for the exact"
  @@ -102,8 +108,8 @@ int main(int argc, char *argv[])
  // 'ref_levels' to be the largest number that gives a final mesh with no
  // more than 1,000 elements.
  {
  - int ref_levels = 1;
  - // (int)floor(log(1000./mesh->GetNE())/log(2.)/dim);
  + int ref_levels = (ser_ref_levels >= 0) ? ser_ref_levels :
  + (int)floor(log(1000./mesh->GetNE())/log(2.)/dim);
  for (int l = 0; l < ref_levels; l++)
  {
  mesh->UniformRefinement();
  @@ -118,7 +124,6 @@ int main(int argc, char *argv[])
  ParMesh *pmesh = new ParMesh(MPI_COMM_WORLD, *mesh);
  delete mesh;
  {
  - int par_ref_levels = 1;
  for (int l = 0; l < par_ref_levels; l++)
  {
  pmesh->UniformRefinement();
  