Commit 38581be3 authored by Bernd Flemisch's avatar Bernd Flemisch Committed by Timo Koch
Browse files

[gmsh] enable 3d test with ALUGrid

Make the tests more flexible by passing a bool to refine or not.
Don't refine in the case of the ALUGrid 3d test, since apparently
the boundary parametrization isn't handled correctly during
refinement. Adapt the reference solutions.
parent b69520a1
......@@ -23,30 +23,26 @@ dune_symlink_to_source_files(FILES "test_gridcreator_gmsh_3d.input"
"test_gridcreator_gmsh_e_markers.input"
"test_gridcreator_dgf_e_markers.input")
#add_executable(test_gridcreator_gmsh_3d_alu EXCLUDE_FROM_ALL test_gridcreator_gmsh_3d.cc)
#target_compile_definitions(test_gridcreator_gmsh_3d_alu PUBLIC GRIDTYPE=Dune::ALUGrid<3,3,Dune::simplex,Dune::conforming>)
#dune_add_test(NAME test_gridcreator_gmsh_3d_alu
# TARGET test_gridcreator_gmsh_3d_alu
# CMAKE_GUARD dune-uggrid_FOUND
# COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
# CMD_ARGS --script fuzzy
# --command "${CMAKE_CURRENT_BINARY_DIR}/test_gridcreator_gmsh_3d_alu -Problem.Name bifurcation_alu"
# --files ${CMAKE_SOURCE_DIR}/test/references/bifurcation_alu-reference.vtu
# ${CMAKE_CURRENT_BINARY_DIR}/bifurcation_alu-00000.vtu
# ${CMAKE_SOURCE_DIR}/test/references/bifurcation_alu-reference-refined.vtu
# ${CMAKE_CURRENT_BINARY_DIR}/bifurcation_alu-00001.vtu)
#dune_add_test(NAME test_gridcreator_gmsh_3d_alu_parallel
# TARGET test_gridcreator_gmsh_3d_alu
# CMAKE_GUARD dune-uggrid_FOUND
# COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
# CMD_ARGS --script fuzzy
# --command "${CMAKE_CURRENT_BINARY_DIR}/test_gridcreator_gmsh_3d_alu -Problem.Name bifurcation_alu"
# --files ${CMAKE_SOURCE_DIR}/test/references/bifurcation_alu-reference-parallel.vtu
# ${CMAKE_CURRENT_BINARY_DIR}/s0002-p0000-bifurcation_alu-00000.vtu
# ${CMAKE_SOURCE_DIR}/test/references/bifurcation_alu-reference-refined-parallel.vtu
# ${CMAKE_CURRENT_BINARY_DIR}/s0002-p0000-bifurcation_alu-00001.vtu)
add_executable(test_gridcreator_gmsh_3d_alu EXCLUDE_FROM_ALL test_gridcreator_gmsh_3d.cc)
target_compile_definitions(test_gridcreator_gmsh_3d_alu PUBLIC GRIDTYPE=Dune::ALUGrid<3,3,Dune::simplex,Dune::nonconforming>)
dune_add_test(NAME test_gridcreator_gmsh_3d_alu
TARGET test_gridcreator_gmsh_3d_alu
CMAKE_GUARD dune-uggrid_FOUND
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--command "${CMAKE_CURRENT_BINARY_DIR}/test_gridcreator_gmsh_3d_alu -Problem.Name bifurcation_alu -Grid.Refine false"
--files ${CMAKE_SOURCE_DIR}/test/references/bifurcation_alu-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/bifurcation_alu-00000.vtu)
dune_add_test(NAME test_gridcreator_gmsh_3d_alu_parallel
TARGET test_gridcreator_gmsh_3d_alu
CMAKE_GUARD dune-uggrid_FOUND
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--command "${MPIEXEC} -np 2 ${CMAKE_CURRENT_BINARY_DIR}/test_gridcreator_gmsh_3d_alu -Problem.Name bifurcation_alu -Grid.Refine false"
--files ${CMAKE_SOURCE_DIR}/test/references/bifurcation_alu-reference-parallel.vtu
${CMAKE_CURRENT_BINARY_DIR}/s0002-p0000-bifurcation_alu-00000.vtu)
add_executable(test_gridcreator_gmsh_3d_ug EXCLUDE_FROM_ALL test_gridcreator_gmsh_3d.cc)
target_compile_definitions(test_gridcreator_gmsh_3d_ug PUBLIC GRIDTYPE=Dune::UGGrid<3>)
......
......@@ -45,7 +45,8 @@ class GridCreatorTests
public:
static void testBoundaryAndElementMarkers(const std::string& type = "gmsh",
const std::string& vtkFileName = "test")
const std::string& vtkFileName = "test",
bool refine = true)
{
// initialize the grid
initialize_();
......@@ -63,16 +64,20 @@ public:
vtkWriter.addCellData(rank, "rank");
vtkWriter.write(0);
// refine grid once and write out the markers again
GridCreator::grid().globalRefine(1);
getBoundaryMarkers_(boundaryMarker);
getElementMarkers_(elementMarker, type);
getRank_(rank);
vtkWriter.write(1);
if (refine)
{
// refine grid once and write out the markers again
GridCreator::grid().globalRefine(1);
getBoundaryMarkers_(boundaryMarker);
getElementMarkers_(elementMarker, type);
getRank_(rank);
vtkWriter.write(1);
}
}
static void testElementMarkers(const std::string& type = "gmsh",
const std::string& vtkFileName = "test")
const std::string& vtkFileName = "test",
bool refine = true)
{
// initialize the grid
initialize_();
......@@ -88,11 +93,14 @@ public:
vtkWriter.addCellData(rank, "rank");
vtkWriter.write(0);
// refine grid once and write out the markers again
GridCreator::grid().globalRefine(1);
getElementMarkers_(elementMarker, type);
getRank_(rank);
vtkWriter.write(1);
if (refine)
{
// refine grid once and write out the markers again
GridCreator::grid().globalRefine(1);
getElementMarkers_(elementMarker, type);
getRank_(rank);
vtkWriter.write(1);
}
}
private:
......
......@@ -34,7 +34,8 @@ int main(int argc, char** argv) try
Dune::MPIHelper::instance(argc, argv);
Parameters::init(argc, argv, "test_gridcreator_gmsh_3d.input");
const auto name = getParam<std::string>("Problem.Name");
GridCreatorTests<GRIDTYPE>::testBoundaryAndElementMarkers("gmsh", name);
const auto refine = Dumux::getParam<bool>("Grid.Refine", true);
GridCreatorTests<GRIDTYPE>::testBoundaryAndElementMarkers("gmsh", name, refine);
return 0;
}
......
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment