Skip to content
Snippets Groups Projects
Commit 1ae35b1f authored by René Heß's avatar René Heß
Browse files

[skip ci] Throw away error calculation in driver

parent 52c37023
No related branches found
No related tags found
No related merge requests found
......@@ -233,32 +233,33 @@ int main(int argc, char** argv){
Dune::printmatrix(std::cout, native(m),"global stiffness matrix","row",9,1);
}
// Maybe calculate errors for test results...
using DG1_GFS__DGF = Dune::PDELab::DiscreteGridFunction<decltype(dg1_gfs_),decltype(x_r)>;
DG1_GFS__DGF dg1_gfs__dgf(dg1_gfs_,x_r);
using DifferenceSquaredAdapter_ = Dune::PDELab::DifferenceSquaredAdapter<decltype(func_0000), decltype(dg1_gfs__dgf)>;
DifferenceSquaredAdapter_ dsa_(func_0000, dg1_gfs__dgf);
Dune::FieldVector<RangeType, 1> l2error(0.0);
{
// L2 error squared of difference between numerical
// solution and the interpolation of exact solution
// for treepath ()
typename decltype(dsa_)::Traits::RangeType err(0.0);
Dune::PDELab::integrateGridFunction(dsa_, err, 10);
// // Maybe calculate errors for test results...
// using DG1_GFS__DGF = Dune::PDELab::DiscreteGridFunction<decltype(dg1_gfs_),decltype(x_r)>;
// DG1_GFS__DGF dg1_gfs__dgf(dg1_gfs_,x_r);
// using DifferenceSquaredAdapter_ = Dune::PDELab::DifferenceSquaredAdapter<decltype(func_0000), decltype(dg1_gfs__dgf)>;
// DifferenceSquaredAdapter_ dsa_(func_0000, dg1_gfs__dgf);
// Dune::FieldVector<RangeType, 1> l2error(0.0);
// {
// // L2 error squared of difference between numerical
// // solution and the interpolation of exact solution
// // for treepath ()
// typename decltype(dsa_)::Traits::RangeType err(0.0);
// Dune::PDELab::integrateGridFunction(dsa_, err, 10);
l2error += err;
if (gv.comm().rank() == 0){
std::cout << "L2 Error for treepath : " << err << std::endl;
}}
bool testfail(false);
using std::abs;
using std::isnan;
if (gv.comm().rank() == 0){
std::cout << "\nl2errorsquared: " << l2error << std::endl << std::endl;
}
if (isnan(l2error[0]) or abs(l2error[0])>1e-4)
testfail = true;
return testfail;
// l2error += err;
// if (gv.comm().rank() == 0){
// std::cout << "L2 Error for treepath : " << err << std::endl;
// }}
// bool testfail(false);
// using std::abs;
// using std::isnan;
// if (gv.comm().rank() == 0){
// std::cout << "\nl2errorsquared: " << l2error << std::endl << std::endl;
// }
// if (isnan(l2error[0]) or abs(l2error[0])>1e-4)
// testfail = true;
// return testfail;
return 0;
}
catch (Dune::Exception& e)
......
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