Skip to content
Snippets Groups Projects
Commit 9210f2ec authored by Robert Kloefkorn's avatar Robert Kloefkorn
Browse files

added FlopCounter.

parent b271a022
No related branches found
No related tags found
No related merge requests found
......@@ -59,6 +59,8 @@
#include <dune/grid/io/visual/grapedatadisplay.hh>
#include <dune/fem/misc/flops.hh>
#if POLORDER == 0
#define LOOPSPACE DG_P0
#elif POLORDER == 1
......@@ -85,14 +87,17 @@ namespace LOOPSPACE {
{
Dune::Fem::FemEoc::clear();
// create Flop counter, needs PAPI
Dune::Fem::FlopCounter flopCounter;
const bool countFlops = Dune::Fem::Parameter::getValue< bool >("femdg.flopcounter", false );
// if flop count is enabled count floating point operations
if( countFlops )
flopCounter.start();
typedef Dune::GridSelector :: GridType GridType;
typedef ProblemGenerator< GridType > ProblemTraits;
// ProblemType is a Dune::Function that evaluates to $u_0$ and also has a
// method that gives you the exact solution.
//typedef NSProblemType< GridType > ProblemType;
//ProblemType problem;
// Note to me: problem description is for FemEOC
const std::string advFlux = ProblemTraits :: advectionFluxName();
const std::string diffFlux = ProblemTraits :: diffusionFluxName();
......@@ -119,6 +124,13 @@ namespace LOOPSPACE {
compute( *stepper );
delete stepper;
delete gridptr;
// print floating point results
if( countFlops )
{
flopCounter.stop();
flopCounter.print( std::cout );
}
}
} // end namespace LOOPSPACE
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