Commit 6de3455c authored by Christoph Grüninger's avatar Christoph Grüninger Committed by Steffen Müthing

[tests] Catch Dune exceptions to ease identifying problems.

(cherry picked from commit 23d94ffb)
Signed-off-by: Steffen Müthing's avatarSteffen Müthing <muething@dune-project.org>
parent d1da71f0
...@@ -165,8 +165,8 @@ void testAMG(int N, int coarsenTarget, int ml) ...@@ -165,8 +165,8 @@ void testAMG(int N, int coarsenTarget, int ml)
int main(int argc, char** argv) int main(int argc, char** argv)
try
{ {
int N=100; int N=100;
int coarsenTarget=1200; int coarsenTarget=1200;
int ml=10; int ml=10;
...@@ -182,5 +182,10 @@ int main(int argc, char** argv) ...@@ -182,5 +182,10 @@ int main(int argc, char** argv)
testAMG<1>(N, coarsenTarget, ml); testAMG<1>(N, coarsenTarget, ml);
testAMG<2>(N, coarsenTarget, ml); testAMG<2>(N, coarsenTarget, ml);
} }
catch (Dune::Exception &e)
{
std::cerr << "Dune reported error: " << e << std::endl;
}
catch (...)
{}
...@@ -29,10 +29,8 @@ void randomize(const M& mat, V& b) ...@@ -29,10 +29,8 @@ void randomize(const M& mat, V& b)
template <int BS> template <int BS>
void testAMG(int N, int coarsenTarget, int ml) void testAMG(int N, int coarsenTarget, int ml)
{ {
std::cout<<"N="<<N<<" coarsenTarget="<<coarsenTarget<<" maxlevel="<<ml<<std::endl; std::cout<<"N="<<N<<" coarsenTarget="<<coarsenTarget<<" maxlevel="<<ml<<std::endl;
typedef Dune::ParallelIndexSet<int,LocalIndex,512> ParallelIndexSet; typedef Dune::ParallelIndexSet<int,LocalIndex,512> ParallelIndexSet;
ParallelIndexSet indices; ParallelIndexSet indices;
...@@ -110,8 +108,8 @@ void testAMG(int N, int coarsenTarget, int ml) ...@@ -110,8 +108,8 @@ void testAMG(int N, int coarsenTarget, int ml)
int main(int argc, char** argv) int main(int argc, char** argv)
try
{ {
int N=100; int N=100;
int coarsenTarget=1200; int coarsenTarget=1200;
int ml=10; int ml=10;
...@@ -127,5 +125,10 @@ int main(int argc, char** argv) ...@@ -127,5 +125,10 @@ int main(int argc, char** argv)
testAMG<1>(N, coarsenTarget, ml); testAMG<1>(N, coarsenTarget, ml);
testAMG<2>(N, coarsenTarget, ml); testAMG<2>(N, coarsenTarget, ml);
} }
catch (Dune::Exception &e)
{
std::cerr << "Dune reported error: " << e << std::endl;
}
catch (...)
{}
...@@ -35,6 +35,7 @@ typedef std::complex<double> FIELD_TYPE; ...@@ -35,6 +35,7 @@ typedef std::complex<double> FIELD_TYPE;
#endif #endif
int main(int argc, char** argv) int main(int argc, char** argv)
try
{ {
const int BS=1; const int BS=1;
std::size_t N=100; std::size_t N=100;
...@@ -80,3 +81,9 @@ int main(int argc, char** argv) ...@@ -80,3 +81,9 @@ int main(int argc, char** argv)
solver1.apply(x,b, res); solver1.apply(x,b, res);
solver1.apply(reinterpret_cast<FIELD_TYPE*>(&x[0]), reinterpret_cast<FIELD_TYPE*>(&b[0])); solver1.apply(reinterpret_cast<FIELD_TYPE*>(&x[0]), reinterpret_cast<FIELD_TYPE*>(&b[0]));
} }
catch (Dune::Exception &e)
{
std::cerr << "Dune reported error: " << e << std::endl;
}
catch (...)
{}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment