Skip to content
Snippets Groups Projects
Commit a7fd05c2 authored by Robert K's avatar Robert K
Browse files

[cleanup] minor fixes to make code compile on other systems.

parent 22390cd9
No related branches found
No related tags found
No related merge requests found
#ifndef DUNE_ALU3DGRID_MESHQUALITY_HH
#define DUNE_ALU3DGRID_MESHQUALITY_HH
#include <iomanip>
#include <string>
#include <sstream>
#include <fstream>
......@@ -71,7 +72,10 @@ namespace Dune {
if( ! geomType.isSimplex() )
{
std::cout << "MeshQuality check only works for simplex grids, skipping check!" << std::endl;
if( gridView.comm().rank() == 0 )
{
std::cout << "MeshQuality check only works for simplex grids, skipping check!" << std::endl;
}
return ;
}
......
......@@ -23,8 +23,7 @@ using namespace Dune;
int main( int argc, char** argv )
try
{
auto& mpiHelper = MPIHelper::instance( argc, argv );
const int rank = mpiHelper.rank();
MPIHelper::instance( argc, argv );
std::string filename;
if( argc > 1 )
......@@ -44,7 +43,7 @@ try
GridType& grid = *gridPtr;
typedef typename GridType::LeafGridView LeafGridView;
const LeafGridView& gridView = grid.leafGridView();
const LeafGridView& leafGridView = grid.leafGridView();
// Write MSH
{
......@@ -59,14 +58,14 @@ try
{
Dune::DGFWriter< LeafGridView > writer( leafGridView );
const std::string outputName(filename+".msh");
const std::string outputName(filename+".dgf");
writer.write(outputName);
}
// Write VTK
{
std::ostringstream vtkName;
vtkName << gridName << ".vtk";
vtkName << filename << ".vtk";
VTKWriter< LeafGridView > vtkWriter( leafGridView );
vtkWriter.write( vtkName.str() );
}
......
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