Skip to content
Snippets Groups Projects
Commit 6ab5868f authored by Thomas Fetzer's avatar Thomas Fetzer
Browse files

Merge branch 'cleanup/cakegridcreator' into 'master'

[io][cake][cleanup] Remove debug output and other improvements

See merge request !407
parent f88374d6
No related branches found
No related tags found
2 merge requests!617[WIP] Next,!436Merge branch 'cleanup/cakegridcreator' into 'master'
This diff is collapsed.
......@@ -796,13 +796,15 @@ public:
// reverse behavior for negative values
if (gradingFactor < 0.0)
{
gradingFactor = -gradingFactor;
using std::abs;
gradingFactor = abs(gradingFactor);
if (gradingFactor < 1.0)
{
increasingCellSize = true;
}
}
// if the grading factor is exactly 1.0 do equal spacing
if (gradingFactor > 1.0 - 1e-7 && gradingFactor < 1.0 + 1e-7)
{
height = 1.0 / numCells;
......@@ -811,6 +813,7 @@ public:
std::cout << " -> h " << height * length << std::endl;
}
}
// if grading factor is not 1.0, do power law spacing
else
{
height = (1.0 - gradingFactor) / (1.0 - pow(gradingFactor, numCells));
......
......@@ -23,6 +23,7 @@
#include <iostream>
#include <dune/common/parametertreeparser.hh>
#include <dune/common/parallel/mpihelper.hh>
#include <dune/common/timer.hh>
#include <dune/geometry/referenceelements.hh>
#include <dune/grid/common/mcmgmapper.hh>
#include <dune/grid/io/file/vtk.hh>
......@@ -36,7 +37,7 @@ namespace Dumux
namespace Properties
{
NEW_TYPE_TAG(GridCreatorCakeTest, INHERITS_FROM(NumericModel));
// Set the grid type
// Set the grid type
#if HAVE_DUNE_ALUGRID
SET_TYPE_PROP(GridCreatorCakeTest, Grid, Dune::ALUGrid<3, 3, Dune::cube, Dune::nonconforming>);
#elif HAVE_UG
......@@ -53,21 +54,24 @@ int main(int argc, char** argv)
Dune::MPIHelper::instance(argc, argv);
// Some typedefs
typedef typename TTAG(GridCreatorCakeTest) TypeTag;
typedef typename GET_PROP_TYPE(TypeTag, Grid) Grid;
typedef typename Dumux::CakeGridCreator<TypeTag> GridCreator;
using TypeTag = TTAG(GridCreatorCakeTest);
using Grid = typename GET_PROP_TYPE(TypeTag, Grid);
using GridCreator = typename Dumux::CakeGridCreator<TypeTag>;
// Read the parameters from the input file
typedef typename GET_PROP(TypeTag, ParameterTree) ParameterTree;
using ParameterTree = typename GET_PROP(TypeTag, ParameterTree);
//First read parameters from input file
// first read parameters from input file
Dune::ParameterTreeParser::readINITree("test_gridcreator_cake.input", ParameterTree::tree());
// Make the grid
// make the grid
Dune::Timer timer;
GridCreator::makeGrid();
std::cout << "Constructing cake grid with " << GridCreator::grid().leafGridView().size(0) << " elements took "
<< timer.elapsed() << " seconds.\n";
// construct a vtk output writer and attach the boundaryMakers
Dune::VTKSequenceWriter<Grid::LeafGridView> vtkWriter(GridCreator::grid().leafGridView(), "cake", ".", "");
vtkWriter.write(0);
Dune::VTKWriter<Grid::LeafGridView> vtkWriter(GridCreator::grid().leafGridView());
vtkWriter.write("cake-00000");
return 0;
}
......@@ -90,6 +94,4 @@ int main(int argc, char** argv)
std::cerr << "You need to have ALUGrid or UGGrid installed to run this test\n";
return 77;
#endif
} //closing main
//} //closing namespace dumux
} // main
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment