#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <iostream>
#include <dune/common/filledarray.hh>
#include <dune/common/parallel/mpihelper.hh>
#include <dune/grid/yaspgrid.hh>
int main(
int argc,
char** argv)
{
try{
Dune::MPIHelper::instance(argc, argv);
constexpr
unsigned int dim = 2;
Dune::FieldVector<double,dim> L(5.0);
std::array<int,dim> N(Dune::filledArray<dim,int>(64));
typedef Dune::YaspGrid<dim> Grid;
Grid grid(L,N);
return exp(-(x*x));
});
return x[0]*3.0;
});
{
std::cout << "Integral: " << integral << std::endl;
}
{
Dune::FieldVector<double,1> y1;
analyticFunction1.evaluate(element, xlocal, y1);
Dune::FieldVector<double,1> y2;
analyticFunction2.evaluate(element, xlocal, y2);
y2 -= y1;
return y2.two_norm2();
});
std::cout << "Integral: " << integral << std::endl;
}
return 0;
}
catch (Dune::Exception &
e){
std::cerr <<
"Dune reported error: " <<
e << std::endl;
return 1;
}
catch (...){
std::cerr << "Unknown exception thrown!" << std::endl;
return 1;
}
}