From 237a9bf09e8bc995dacf86b4c0fff9b9050e3a14 Mon Sep 17 00:00:00 2001 From: Tomas Oberhuber <tomas.oberhuber@fjfi.cvut.cz> Date: Thu, 2 May 2013 22:21:12 +0200 Subject: [PATCH] Fixing the Navier Stokes example. --- examples/navier-stokes/Makefile | 4 +++- examples/navier-stokes/navierStokesSolver_impl.h | 2 +- src/implementation/core/tnlObject.cpp | 1 + tests/unit-tests/core/tnlArrayTest.cpp | 4 ++++ tests/unit-tests/core/tnlArrayTester.h | 2 ++ tests/unit-tests/tnlUnitTestStarter.h | 2 +- 6 files changed, 12 insertions(+), 3 deletions(-) diff --git a/examples/navier-stokes/Makefile b/examples/navier-stokes/Makefile index d689e5125b..834d274fd7 100644 --- a/examples/navier-stokes/Makefile +++ b/examples/navier-stokes/Makefile @@ -10,8 +10,10 @@ CXX = g++ CUDA_CXX = nvcc OMP_FLAGS = -DHAVE_OPENMP -fopenmp #CXX_FLAGS = -std=gnu++0x -I$(TNL_INCLUDE_DIR) -O0 -g -DDEBUG $(OMP_FLAGS) -CXX_FLAGS = -std=gnu++0x -I$(TNL_INCLUDE_DIR) -O3 $(OMP_FLAGS) +#CXX_FLAGS = -std=gnu++0x -I$(TNL_INCLUDE_DIR) -O3 $(OMP_FLAGS) +CXX_FLAGS = -std=gnu++0x -I$(TNL_INCLUDE_DIR) -O3 $(OMP_FLAGS) -pg #CXX_FLAGS = -DHAVE_NOT_CXX11 -I$(TNL_INCLUDE_DIR) -O3 $(OMP_FLAGS) + LD_FLAGS = -L$(TNL_INSTALL_DIR) -ltnl-0.1 -lgomp SOURCES = main.cpp diff --git a/examples/navier-stokes/navierStokesSolver_impl.h b/examples/navier-stokes/navierStokesSolver_impl.h index 213bf7e5c2..bcd38a8cec 100644 --- a/examples/navier-stokes/navierStokesSolver_impl.h +++ b/examples/navier-stokes/navierStokesSolver_impl.h @@ -436,7 +436,7 @@ void navierStokesSolver< Mesh, EulerScheme > :: GetExplicitRHS( const RealType& rho_u2_t[ c ] ); //rho_u1_t[ c ] += ; - rho_u2_t[ c ] -= startUpCoefficient * this -> gravity * this -> rho[ c ]; + //rho_u2_t[ c ] -= startUpCoefficient * this -> gravity * this -> rho[ c ]; /*** * Add the viscosity term diff --git a/src/implementation/core/tnlObject.cpp b/src/implementation/core/tnlObject.cpp index 864624f69a..5dcab3896b 100644 --- a/src/implementation/core/tnlObject.cpp +++ b/src/implementation/core/tnlObject.cpp @@ -208,6 +208,7 @@ bool parseObjectType( const tnlString& objectType, templateBrackets --; i ++; } + return true; } diff --git a/tests/unit-tests/core/tnlArrayTest.cpp b/tests/unit-tests/core/tnlArrayTest.cpp index 7d821f34d2..7dc6f8e5aa 100644 --- a/tests/unit-tests/core/tnlArrayTest.cpp +++ b/tests/unit-tests/core/tnlArrayTest.cpp @@ -20,6 +20,7 @@ int main( int argc, char* argv[] ) { +#ifdef HAVE_CPPUNIT if( ! tnlUnitTestStarter :: run< tnlArrayTester< char, tnlHost, int > >() || ! tnlUnitTestStarter :: run< tnlArrayTester< int, tnlHost, int > >() || ! tnlUnitTestStarter :: run< tnlArrayTester< long int, tnlHost, int > >() || @@ -34,4 +35,7 @@ int main( int argc, char* argv[] ) ! tnlUnitTestStarter :: run< tnlArrayTester< long double, tnlHost, long int > >() ) return EXIT_FAILURE; return EXIT_SUCCESS; +#else + return EXIT_FAILURE; +#endif } diff --git a/tests/unit-tests/core/tnlArrayTester.h b/tests/unit-tests/core/tnlArrayTester.h index b3c01fdf1f..5a9d720faa 100644 --- a/tests/unit-tests/core/tnlArrayTester.h +++ b/tests/unit-tests/core/tnlArrayTester.h @@ -18,6 +18,7 @@ #ifndef TNLARRAYMANAGERTESTER_H_ #define TNLARRAYMANAGERTESTER_H_ +#ifdef HAVE_CPPUNIT #include <cppunit/TestSuite.h> #include <cppunit/TestResult.h> #include <cppunit/TestCaller.h> @@ -208,5 +209,6 @@ class tnlArrayTester : public CppUnit :: TestCase }; +#endif /* HAVE_CPPUNIT */ #endif /* TNLARRAYMANAGERTESTER_H_ */ diff --git a/tests/unit-tests/tnlUnitTestStarter.h b/tests/unit-tests/tnlUnitTestStarter.h index 0c660a257b..b828c2148d 100644 --- a/tests/unit-tests/tnlUnitTestStarter.h +++ b/tests/unit-tests/tnlUnitTestStarter.h @@ -42,7 +42,7 @@ class tnlUnitTestStarter return false; return true; #else - std :: cerr << "Error: CPPUNIT is missing." << endl; + std :: cerr << "Error: CPPUNIT is missing." << std :: endl; return false; #endif }; -- GitLab