Skip to content
Snippets Groups Projects
Commit 9b3530ea authored by Oliver Sander's avatar Oliver Sander
Browse files

Use className(*grid) to get the name of the grid implementation class

Rather than having the names as explicit strings in the code.  This
avoids copy'n'paste errors, and makes the code slightly shorter.
parent 81632648
No related branches found
No related tags found
No related merge requests found
...@@ -364,7 +364,7 @@ void markBoundaryDOFs(const GridView& gridView, BitVector& isBoundary) ...@@ -364,7 +364,7 @@ void markBoundaryDOFs(const GridView& gridView, BitVector& isBoundary)
template<class GridType, class TestSuite> template<class GridType, class TestSuite>
bool checkWithGrid(TestSuite& suite, int uniformRefinements, std::string name) bool checkWithGrid(TestSuite& suite, int uniformRefinements)
{ {
const int dim=GridType::dimension; const int dim=GridType::dimension;
Dune::FieldVector<double,dim> lower(0); Dune::FieldVector<double,dim> lower(0);
...@@ -382,11 +382,11 @@ bool checkWithGrid(TestSuite& suite, int uniformRefinements, std::string name) ...@@ -382,11 +382,11 @@ bool checkWithGrid(TestSuite& suite, int uniformRefinements, std::string name)
grid->globalRefine(uniformRefinements); grid->globalRefine(uniformRefinements);
std::cout << "Running test on " << name << " with " << grid->size(0) << " elements." << std::endl; std::cout << "Running test on " << Dune::className(*grid) << " with " << grid->size(0) << " elements." << std::endl;
bool passed = suite.check(*grid); bool passed = suite.check(*grid);
if (passed) if (passed)
std::cout << "All tests passed with " << name << "." << std::endl; std::cout << "All tests passed with " << Dune::className(*grid) << "." << std::endl;
return passed; return passed;
} }
...@@ -396,16 +396,16 @@ bool checkWithStandardGrids(TestSuite& suite) ...@@ -396,16 +396,16 @@ bool checkWithStandardGrids(TestSuite& suite)
{ {
bool passed = true; bool passed = true;
passed = passed and checkWithGrid<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double,2> > >(suite, 2, "YaspGrid<2>"); passed = passed and checkWithGrid<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double,2> > >(suite, 2);
#if HAVE_UG #if HAVE_UG
passed = passed and checkWithGrid<Dune::UGGrid<2> >(suite, 5, "UGGrid<2>"); passed = passed and checkWithGrid<Dune::UGGrid<2> >(suite, 5);
passed = passed and checkWithGrid<Dune::UGGrid<3> >(suite, 3, "UGGrid<3>"); passed = passed and checkWithGrid<Dune::UGGrid<3> >(suite, 3);
#endif #endif
#if HAVE_ALUGRID #if HAVE_ALUGRID
passed = passed and checkWithGrid<Dune::ALUGrid<2, 2, Dune::simplex, Dune::nonconforming>>(suite, 5, "ALUSimplexGrid<2,2>"); passed = passed and checkWithGrid<Dune::ALUGrid<2, 2, Dune::simplex, Dune::nonconforming>>(suite, 5);
// passed = passed and checkWithGrid<Dune::ALUGrid<3, 3, Dune::simplex, Dune::nonconforming>>(suite, 3, "ALUSimplexGrid<3,3>"); // passed = passed and checkWithGrid<Dune::ALUGrid<3, 3, Dune::simplex, Dune::nonconforming>>(suite, 3);
#endif #endif
return passed; return passed;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment