message: Fixing ex11p
diff: @@ -57,7 +57,8 @@ int main(int argc, char *argv[])
  const char *mesh_file = "../data/star.mesh";
  int ser_ref_levels = 2;
  int par_ref_levels = 1;
  - int order = 1;
  + Array<int> order(1);
  + order[0] = 0;
  int nev = 5;
  int seed = 75;
  bool slu_solver = false;
  @@ -146,19 +147,46 @@ int main(int argc, char *argv[])
  // use continuous Lagrange finite elements of the specified order. If
  // order < 1, we instead use an isoparametric/isogeometric space.
  FiniteElementCollection *fec;
  - if (order > 0)
  + NURBSExtension *NURBSext = NULL;
  + int own_fec = 0;
  +
  + if (order[0] == 0) // Isoparametric
  {
  - fec = new H1_FECollection(order, dim);
  - }
  - else if (pmesh->GetNodes())
  + if (pmesh->GetNodes())
  {
  fec = pmesh->GetNodes()->OwnFEC();
  + own_fec = 0;
  + cout << "Using isoparametric FEs: " << fec->Name() << endl;
  }
  else
  {
  - fec = new H1_FECollection(order = 1, dim);
  + cout <<"Mesh does not have FEs --> Assume order 1.\n";
  + fec = new H1_FECollection(1, dim);
  + own_fec = 1;
  + }
  + }
  + else if (pmesh->NURBSext && (order[0] > 0) ){ // Subparametric NURBS
  + fec = new NURBSFECollection(order[0]);
  + own_fec = 1;
  + int nkv = pmesh->NURBSext->GetNKV();
  +
  + if (order.Size() == 1)
  + {
  + int tmp = order[0];
  + order.SetSize(nkv);
  + order = tmp;
  }
  - ParFiniteElementSpace *fespace = new ParFiniteElementSpace(pmesh, fec);
  + if (order.Size() != nkv ) mfem_error("Wrong number of orders set.");
  + NURBSext = new NURBSExtension(pmesh->NURBSext, order);
  + }
  + else
  + {
  + if (order.Size() > 1) cout <<"Wrong number of orders set, needs one.\n";
  + fec = new H1_FECollection(abs(order[0]), dim);
  + own_fec = 1;
  + }
  +
  + ParFiniteElementSpace *fespace = new ParFiniteElementSpace(pmesh,NURBSext,fec);
  HYPRE_Int size = fespace->GlobalTrueVSize();
  if (myid == 0)
  {
  @@ -357,7 +385,7 @@ int main(int argc, char *argv[])
  #endif
  delete fespace;
  - if (order > 0)
  + if (own_fec)
  {
  delete fec;
  }
  