Commit e9836186 authored by fumagalli's avatar fumagalli
Browse files

Add error to check succes/failure of the test

parent 408ed420
......@@ -36,4 +36,4 @@ link:
test -a Mesh || ln -s $(top_srcdir)/testsuite/data/mesh/inria Mesh
clean-results:
-rm *.vct *.scl *.case *.geo
-rm *.vct *.scl *.case *.geo *.h5 *.xmf
......@@ -3,7 +3,7 @@
This file is part of the LifeV Applications.
Author(s): A. Fumagalli <alessio.fumagalli@mail.polimi.it>
Date: 2010-03-24
Date: 2010-07-29
Copyright (C) 2010 EPFL, Politecnico di Milano
......@@ -25,7 +25,7 @@
/**
\file darcy.cpp
\author A. Fumagalli <alessio.fumagalli@mail.polimi.it>
\date
\date 2010-07-29
*/
/*!
......@@ -352,7 +352,7 @@ darcy::darcy( int argc,
//! Methods
// ===================================================
void
Real
darcy::run()
{
typedef RegionMesh3D<LinearTetra> RegionMesh;
......@@ -608,4 +608,7 @@ darcy::run()
if ( isLeader )
std::cout << "Total time for the computation " << chronoTotal.diff() << std::endl << std::flush;
// Return the error, needed for the succes/failure of the test
return darcySolver.primalL2Error( Members->getAnalyticalSolution(), Members->getUOne() );
}
......@@ -3,7 +3,7 @@
This file is part of the LifeV Applications.
Author(s): A. Fumagalli <alessio.fumagalli@mail.polimi.it>
Date: 2010-05-24
Date: 2010-07-29
Copyright (C) 2010 EPFL, Politecnico di Milano
......@@ -25,7 +25,7 @@
/**
@file darcy.hpp
@author A. Fumagalli <alessio.fumagalli@mail.polimi.it>
@date 2009-03-24
@date 2010-07-29
*/
......@@ -85,7 +85,7 @@ public:
*/
//@{
void run();
LifeV::Real run();
//@}
......
......@@ -3,7 +3,7 @@
This file is part of the LifeV Applications.
Author(s): A. Fumagalli <alessio.fumagalli@mail.polimi.it>
Date: 2010-05-24
Date: 2010-07-29
Copyright (C) 2010 EPFL, Politecnico di Milano
......@@ -24,7 +24,7 @@
*/
/* ========================================================
Simple Darcy test with mixed boundary condition
Simple Darcy test with Dirichlet, Neumann and Robin boundary conditions
Solve the problem
......@@ -32,16 +32,14 @@ Solve the problem
K^{-1} u + \nabla p = 0 in \Omega
3D: with the source term f = 2(x^2+y^2) on an unite cube and the matrix K is the identity matrix.
*/
/**
@file main.hpp
@author A. Fumagalli <alessio.fumagalli@mail.polimi.it>
@date 2010-05-24
*/
@date 2010-07-29
*/
// ===================================================
......@@ -102,24 +100,34 @@ namespace
int main(int argc, char** argv)
{
#ifdef HAVE_MPI
MPI_Init(&argc, &argv);
std::cout << "MPI Initialization" << std::endl;
#endif
#ifdef HAVE_MPI
MPI_Init(&argc, &argv);
std::cout << "MPI Initialization" << std::endl;
#endif
LifeV::po::options_description desc("Specific options");
desc.add_options()("file,f", LifeV::po::value<std::string>()->default_value( "data" ), "data file name");
// Error of the problem
LifeV::Real error(0);
// Error known
const LifeV::Real errorKnown( 0.200340988220163 );
// Tollerance between the error and the errorKnown
const LifeV::Real tollerance( 1e-8 );
darcy Darcy( argc, argv, makeAbout(), desc );
Darcy.run();
error = Darcy.run();
#ifdef HAVE_MPI
MPI_Finalize();
std::cout << "MPI Finalization" << std::endl;
#endif
#ifdef HAVE_MPI
MPI_Finalize();
std::cout << "MPI Finalization" << std::endl;
#endif
return( EXIT_SUCCESS );
if ( abs( error - errorKnown ) > tollerance )
return ( EXIT_FAILURE );
else
return ( EXIT_SUCCESS );
}
Supports Markdown
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