message: unittest: test 3D mass diagonal PA assembly
diff: @@ -18,16 +18,26 @@ namespace assemblediagonalpa
  {
  TEST_CASE("massdiag")
  +{
  + for (int dimension = 2; dimension < 4; ++dimension)
  {
  for (int ne = 1; ne < 3; ++ne)
  {
  - std::cout << "Testing partial assembly mass diagonal: "
  - << ne*ne << " elements." << std::endl;
  + std::cout << "Testing " << dimension << "D partial assembly mass diagonal: "
  + << std::pow(ne, dimension) << " elements." << std::endl;
  for (int order = 1; order < 5; ++order)
  {
  - Mesh mesh(ne, ne, Element::QUADRILATERAL, 1, 1.0, 1.0);
  - FiniteElementCollection *h1_fec = new H1_FECollection(order, 2);
  - FiniteElementSpace h1_fespace(&mesh, h1_fec);
  + Mesh * mesh;
  + if (dimension == 2)
  + {
  + mesh = new Mesh(ne, ne, Element::QUADRILATERAL, 1, 1.0, 1.0);
  + }
  + else
  + {
  + mesh = new Mesh(ne, ne, ne, Element::HEXAHEDRON, 1, 1.0, 1.0, 1.0);
  + }
  + FiniteElementCollection *h1_fec = new H1_FECollection(order, dimension);
  + FiniteElementSpace h1_fespace(mesh, h1_fec);
  BilinearForm paform(&h1_fespace);
  ConstantCoefficient one(1.0);
  paform.SetAssemblyLevel(AssemblyLevel::PARTIAL);
  @@ -46,11 +56,13 @@ TEST_CASE("massdiag")
  assembly_diag -= pa_diag;
  double error = assembly_diag.Norml2();
  std::cout << " order: " << order << ", error norm: " << error << std::endl;
  - REQUIRE(assembly_diag.Norml2() < 1.e-10);
  + REQUIRE(assembly_diag.Norml2() < 1.e-12);
  + delete mesh;
  delete h1_fec;
  }
  }
  }
  +}
  } // namespace assemblediagonalpa
  