From b4dfb4af134e8ee9f437f873033b7b197d1db6e4 Mon Sep 17 00:00:00 2001
From: Tomas Oberhuber <tomas.oberhuber@fjfi.cvut.cz>
Date: Mon, 16 Nov 2009 16:03:48 +0000
Subject: [PATCH] Removing of #include <diff/mdiff.h> has been done to speedup
 build process.

---
 TODO.txt                       | 13 +++++++++++
 src/debug/tnlDebug.h           | 12 +++++++++-
 src/dist/Makefile.am           |  1 -
 src/dist/Makefile.in           | 19 ++++++++--------
 src/dist/debug.h               | 40 ----------------------------------
 src/dist/direct.cpp            |  8 +++++--
 src/dist/direct.h              |  3 ++-
 src/dist/fmm2d.cpp             |  9 +++++---
 src/dist/fmm2d.h               |  2 +-
 src/dist/fsm2d.cpp             |  2 +-
 src/dist/fsm2d.h               |  2 +-
 src/dist/ftm2d.cpp             | 33 ++++++++++++++++------------
 src/dist/init_band.cpp         |  6 +++--
 src/dist/init_band.h           |  6 ++++-
 src/dist/initial-condition.h   |  3 ++-
 src/dist/iter1d.cpp            |  4 ++--
 src/dist/iter1d.h              |  2 +-
 src/dist/iter2d.cpp            |  4 ++--
 src/dist/iter2d.h              |  2 +-
 src/dist/mDistAux.h            |  2 --
 src/dist/main.cpp              |  3 ++-
 src/dist/mdist-test.cpp        |  6 ++---
 src/dist/mdist.cpp             |  9 +-------
 src/dist/msdfIterBase.cpp      |  7 ++++++
 src/dist/msdfIterBase.h        |  5 ++++-
 src/dist/msdfSussmanFatemi.cpp |  7 +++++-
 src/dist/msdfSussmanFatemi.h   |  3 ++-
 src/dist/param-crv-dst.cpp     |  8 +++++--
 src/dist/param-crv-dst.h       |  2 +-
 src/dist/sdf-restore.cpp       |  5 ++++-
 tools/src/bin2gnuplot.cpp      |  2 +-
 tools/src/compare-objects.cpp  |  3 +++
 tools/src/compare-objects.h    |  3 ++-
 tools/src/diff-norm.cpp        |  2 +-
 tools/src/mcurve2gnuplot.cpp   |  6 ++++-
 tools/src/mdiff-err-norms.cpp  | 14 ++++++++++--
 tools/src/mgrid-view.cpp       |  9 +++++++-
 tools/src/mgrid2gnuplot.cpp    |  5 ++++-
 tools/src/read-file.h          |  2 +-
 39 files changed, 159 insertions(+), 115 deletions(-)
 delete mode 100644 src/dist/debug.h

diff --git a/TODO.txt b/TODO.txt
index e69de29bb2..76c317a4e0 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -0,0 +1,13 @@
+TODO: implementovat tridu tnlFileName pro generovani jmen souboru
+
+TODO: implementovat tridu tnlParabolicSolver pro odvozovani resicu k casove promennym uloham
+
+TODO: Nahradit mGrid2D, mGrid3D za mGrid obecne dimenze
+
+TODO: zavets iteratory pres uzle site misto for cyklu
+
+TODO: implementovat Mersona v CUDA
+
+TODO: metoda Test do tnlObject
+
+TODO: trida tnlTester pro rizeni testu   
\ No newline at end of file
diff --git a/src/debug/tnlDebug.h b/src/debug/tnlDebug.h
index eb4a8bf6b2..eecdb0079c 100644
--- a/src/debug/tnlDebug.h
+++ b/src/debug/tnlDebug.h
@@ -2,7 +2,7 @@
                           tnlDebug.h  -  description
                              -------------------
     begin                : 2004/09/05
-    copyright            : (C) 2004 by Tom� Oberhuber
+    copyright            : (C) 2004 by Tom� Oberhuber
     email                : oberhuber@seznam.cz
  ***************************************************************************/
 
@@ -64,6 +64,16 @@ extern int __tnldbg_mpi_i_proc;
       << __LINE__ << " | " << #expr << " -> "                 \
       << expr << endl << flush;
 
+#define dbgCondExpr( condition, expr )         \
+   if( _tnldbg_debug_func( _tnldbg_debug_class_name,   \
+                       _tnldbg_debug_func_name ) )  \
+      if( condition )                            \
+         cout << "# MPI proc. " << __tnldbg_mpi_i_proc << " | "  \
+         << _tnldbg_debug_class_name << " :: " \
+         << _tnldbg_debug_func_name << " @ "        \
+         << __LINE__ << " | "                    \
+      << #expr << " -> " << expr << flush << endl;
+
 #else   // now non-MPI definitions
 
 #define dbgCout( args )                                      \
diff --git a/src/dist/Makefile.am b/src/dist/Makefile.am
index 5c19b61164..b500da5eb3 100644
--- a/src/dist/Makefile.am
+++ b/src/dist/Makefile.am
@@ -1,7 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 
 headers = \
-   debug.h \
    direct.h \
    fmm2d.h \
    fsm2d.h \
diff --git a/src/dist/Makefile.in b/src/dist/Makefile.in
index 6caeedb081..6c0491ae35 100644
--- a/src/dist/Makefile.in
+++ b/src/dist/Makefile.in
@@ -69,9 +69,9 @@ libtnldist_dbg_0_1_la_LIBADD =
 am__libtnldist_dbg_0_1_la_SOURCES_DIST = direct.cpp fmm2d.cpp \
 	fsm2d.cpp ftm2d.cpp init_band.cpp iter1d.cpp iter2d.cpp \
 	iter3d.cpp param-crv-dst.cpp msdfSussmanFatemi.cpp \
-	msdfIterBase.cpp debug.h direct.h fmm2d.h fsm2d.h ftm2d.h \
-	init_band.h iter1d.h iter2d.h iter3d.h mdist.h mDistAux.h \
-	param-crv-dst.h msdfSussmanFatemi.h msdfIterBase.h
+	msdfIterBase.cpp direct.h fmm2d.h fsm2d.h ftm2d.h init_band.h \
+	iter1d.h iter2d.h iter3d.h mdist.h mDistAux.h param-crv-dst.h \
+	msdfSussmanFatemi.h msdfIterBase.h debug.h
 am__objects_3 = libtnldist_dbg_0_1_la-direct.lo \
 	libtnldist_dbg_0_1_la-fmm2d.lo libtnldist_dbg_0_1_la-fsm2d.lo \
 	libtnldist_dbg_0_1_la-ftm2d.lo \
@@ -94,9 +94,9 @@ libtnldist_mpi_0_1_la_LIBADD =
 am__libtnldist_mpi_0_1_la_SOURCES_DIST = direct.cpp fmm2d.cpp \
 	fsm2d.cpp ftm2d.cpp init_band.cpp iter1d.cpp iter2d.cpp \
 	iter3d.cpp param-crv-dst.cpp msdfSussmanFatemi.cpp \
-	msdfIterBase.cpp debug.h direct.h fmm2d.h fsm2d.h ftm2d.h \
-	init_band.h iter1d.h iter2d.h iter3d.h mdist.h mDistAux.h \
-	param-crv-dst.h msdfSussmanFatemi.h msdfIterBase.h
+	msdfIterBase.cpp direct.h fmm2d.h fsm2d.h ftm2d.h init_band.h \
+	iter1d.h iter2d.h iter3d.h mdist.h mDistAux.h param-crv-dst.h \
+	msdfSussmanFatemi.h msdfIterBase.h debug.h
 am__objects_4 = libtnldist_mpi_0_1_la-direct.lo \
 	libtnldist_mpi_0_1_la-fmm2d.lo libtnldist_mpi_0_1_la-fsm2d.lo \
 	libtnldist_mpi_0_1_la-ftm2d.lo \
@@ -119,9 +119,9 @@ libtnldist_mpi_dbg_0_1_la_LIBADD =
 am__libtnldist_mpi_dbg_0_1_la_SOURCES_DIST = direct.cpp fmm2d.cpp \
 	fsm2d.cpp ftm2d.cpp init_band.cpp iter1d.cpp iter2d.cpp \
 	iter3d.cpp param-crv-dst.cpp msdfSussmanFatemi.cpp \
-	msdfIterBase.cpp debug.h direct.h fmm2d.h fsm2d.h ftm2d.h \
-	init_band.h iter1d.h iter2d.h iter3d.h mdist.h mDistAux.h \
-	param-crv-dst.h msdfSussmanFatemi.h msdfIterBase.h
+	msdfIterBase.cpp direct.h fmm2d.h fsm2d.h ftm2d.h init_band.h \
+	iter1d.h iter2d.h iter3d.h mdist.h mDistAux.h param-crv-dst.h \
+	msdfSussmanFatemi.h msdfIterBase.h debug.h
 am__objects_5 = libtnldist_mpi_dbg_0_1_la-direct.lo \
 	libtnldist_mpi_dbg_0_1_la-fmm2d.lo \
 	libtnldist_mpi_dbg_0_1_la-fsm2d.lo \
@@ -322,7 +322,6 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 headers = \
-   debug.h \
    direct.h \
    fmm2d.h \
    fsm2d.h \
diff --git a/src/dist/debug.h b/src/dist/debug.h
deleted file mode 100644
index 3c7a829e7a..0000000000
--- a/src/dist/debug.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/***************************************************************************
-                          debug.h  -  description
-                             -------------------
-    begin                : 2005/07/02
-    copyright            : (C) 2005 by Tom� Oberhuber
-    email                : oberhuber@seznam.cz
- ***************************************************************************/
-
-/***************************************************************************
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- ***************************************************************************/
-
-#ifndef debugH
-#define debugH
-
-#include <config.h>
-
-#ifdef HAVE_POUND_H
-#include <pound.h>
-#else
-   #define dbgInit( file_name )
-   #define dbgFunctionName( _class, _func )
-   #define dbgCout( args )
-   #define DBG_PRINTF( expr )
-   #define dbgExpr( expr )
-   #define DBG_CALL( expr )
-   #define DBG_WAIT( )
-   #define DBG_COND_COUT( condition, args )
-   #define DBG_COND_PRINTF( condition, expr )
-   #define DBG_COND_EXPR( condition, expr )
-   #define DBG_COND_CALL( condition, expr )
-   #define DBG_COND_WAIT( condition )
-#endif
-
-#endif
diff --git a/src/dist/direct.cpp b/src/dist/direct.cpp
index 28302c0b69..7b55008b7d 100644
--- a/src/dist/direct.cpp
+++ b/src/dist/direct.cpp
@@ -15,10 +15,14 @@
  *                                                                         *
  ***************************************************************************/
 
-#include <diff/mdiff.h>
-#include "debug.h"
+#include <math.h>
+
+#include <core/mfuncs.h>
+#include <debug/tnlDebug.h>
+
 #include "direct.h"
 
+
 //--------------------------------------------------------------------------
 static double SolvePoint( const double& a,
                           const double& b,
diff --git a/src/dist/direct.h b/src/dist/direct.h
index cff9250f5d..e721b7e7e5 100644
--- a/src/dist/direct.h
+++ b/src/dist/direct.h
@@ -18,7 +18,8 @@
 #ifndef directH
 #define directH
 
-#include <diff/mdiff.h>
+#include <diff/mGrid2D.h>
+
 
 enum mDstDirection { mDstSouth,
                      mDstNorth,
diff --git a/src/dist/fmm2d.cpp b/src/dist/fmm2d.cpp
index 32cb52fff6..b332f647e2 100644
--- a/src/dist/fmm2d.cpp
+++ b/src/dist/fmm2d.cpp
@@ -15,8 +15,11 @@
  *                                                                         *
  ***************************************************************************/
 
-#include <diff/mdiff.h>
-#include "debug.h"
+#include <debug/tnlDebug.h>
+#include <diff/mGrid2D.h>
+#include <core/mList.h>
+#include <core/mVector.h>
+#include <debug/tnlDebug.h>
 #include "direct.h"
 #include "fmm2d.h"
 #include "init_band.h"
@@ -147,7 +150,7 @@ void DstFastMarching2D( mGrid2D< double >& phi,
          }
       }
       //dbgExpr( smallest );
-      dbgExpr( phi( smallest. i, smallest. j ) );
+      dbgExpr( phi( smallest[ 0 ], smallest[ 1 ] ) );
       
       //Add( alive_points, smallest -> data );
       int s_i = smallest[ 0 ];
diff --git a/src/dist/fmm2d.h b/src/dist/fmm2d.h
index 8a251f0149..cb55dfda48 100644
--- a/src/dist/fmm2d.h
+++ b/src/dist/fmm2d.h
@@ -18,7 +18,7 @@
 #ifndef fmm2dH
 #define fmm2dH
 
-#include <diff/mdiff.h>
+#include <diff/mGrid2D.h>
 
 void DstFastMarching2D( mGrid2D< double >& phi, 
                         const double& band_width,
diff --git a/src/dist/fsm2d.cpp b/src/dist/fsm2d.cpp
index 7450d0044f..b7dabdc673 100644
--- a/src/dist/fsm2d.cpp
+++ b/src/dist/fsm2d.cpp
@@ -16,7 +16,7 @@
  ***************************************************************************/
 
 #include <float.h>
-#include "debug.h"
+#include <debug/tnlDebug.h>
 #include "direct.h"
 #include "fsm2d.h"
 #include "init_band.h"
diff --git a/src/dist/fsm2d.h b/src/dist/fsm2d.h
index 8a7d19d797..8740c6e662 100644
--- a/src/dist/fsm2d.h
+++ b/src/dist/fsm2d.h
@@ -18,7 +18,7 @@
 #ifndef fsm2dH
 #define fsm2dH
 
-#include <diff/mdiff.h>
+#include <diff/mGrid2D.h>
 
 #define MDST_VERBOSE_ON true
 #define MDST_VERBOSE_OFF false
diff --git a/src/dist/ftm2d.cpp b/src/dist/ftm2d.cpp
index 401e0f6623..6f61bad7c6 100644
--- a/src/dist/ftm2d.cpp
+++ b/src/dist/ftm2d.cpp
@@ -16,12 +16,17 @@
  ***************************************************************************/
 
 #include <float.h>
-#include <diff/mdiff.h>
-#include "debug.h"
+#include <fstream>
+
+#include <diff/mGrid2D.h>
+#include <core/mVector.h>
+#include <debug/tnlDebug.h>
 #include "direct.h"
 #include "ftm2d.h"
 #include "init_band.h"
 
+using namespace std;
+
 //--------------------------------------------------------------------------
 void DrawStack( const mGrid2D< double >& phi, 
                 mVector< 2, int > * stack,
@@ -69,18 +74,18 @@ double UpdatePoint( mGrid2D< double >& phi,
       s = mDstTentative;
    if( j < y_size - 1 && in_stack( i, j + 1 ) != 0 )
       n = mDstTentative;
-   DBG_COND_EXPR( e == mDstTentative, e );
-   DBG_COND_EXPR( e == mDstTentative, phi( i + 1, j ) );
-   DBG_COND_EXPR( e == mDstTentative, in_stack( i + 1, j ) );
-   DBG_COND_EXPR( w == mDstTentative, w );
-   DBG_COND_EXPR( w == mDstTentative, phi( i - 1, j ) );
-   DBG_COND_EXPR( w == mDstTentative, in_stack( i - 1, j ) );
-   DBG_COND_EXPR( s == mDstTentative, s );
-   DBG_COND_EXPR( s == mDstTentative, phi( i, j - 1 ) );
-   DBG_COND_EXPR( s == mDstTentative, in_stack( i, j - 1 ) );
-   DBG_COND_EXPR( n == mDstTentative, n );
-   DBG_COND_EXPR( n == mDstTentative, phi( i, j + 1 ) );
-   DBG_COND_EXPR( n == mDstTentative, in_stack( i, j + 1 ) );
+   dbgCondExpr( e == mDstTentative, e );
+   dbgCondExpr( e == mDstTentative, phi( i + 1, j ) );
+   dbgCondExpr( e == mDstTentative, in_stack( i + 1, j ) );
+   dbgCondExpr( w == mDstTentative, w );
+   dbgCondExpr( w == mDstTentative, phi( i - 1, j ) );
+   dbgCondExpr( w == mDstTentative, in_stack( i - 1, j ) );
+   dbgCondExpr( s == mDstTentative, s );
+   dbgCondExpr( s == mDstTentative, phi( i, j - 1 ) );
+   dbgCondExpr( s == mDstTentative, in_stack( i, j - 1 ) );
+   dbgCondExpr( n == mDstTentative, n );
+   dbgCondExpr( n == mDstTentative, phi( i, j + 1 ) );
+   dbgCondExpr( n == mDstTentative, in_stack( i, j + 1 ) );
 
    double smallest( DBL_MAX );
    mDstDirection smallest_direction;
diff --git a/src/dist/init_band.cpp b/src/dist/init_band.cpp
index bca6f14c24..0c58884e24 100644
--- a/src/dist/init_band.cpp
+++ b/src/dist/init_band.cpp
@@ -15,9 +15,11 @@
  *                                                                         *
  ***************************************************************************/
 
-#include <diff/mdiff.h>
+#include <diff/mGrid2D.h>
+#include <core/mVector.h>
+#include <debug/tnlDebug.h>
 #include "init_band.h"
-#include "debug.h"
+
 
 //--------------------------------------------------------------------------
 static void AddCubes( int i, int j,
diff --git a/src/dist/init_band.h b/src/dist/init_band.h
index 52eb43838f..888ffb28e2 100644
--- a/src/dist/init_band.h
+++ b/src/dist/init_band.h
@@ -18,7 +18,11 @@
 #ifndef init_bandH
 #define init_bandH
 
-#include <diff/mdiff.h>
+#include <math.h>
+
+#include <diff/mGrid2D.h>
+#include <core/mVector.h>
+#include <core/mfuncs.h>
 
 //! Cretes initial band along the curve given as a zero level set
 /*! Only points having a neighbour with different sign will be
diff --git a/src/dist/initial-condition.h b/src/dist/initial-condition.h
index 029bb17bf8..cb8114f428 100644
--- a/src/dist/initial-condition.h
+++ b/src/dist/initial-condition.h
@@ -18,7 +18,8 @@
 #ifndef initial_conditionH
 #define initial_conditionH
 
-#include <diff/mdiff.h>
+#include <diff/mGrid2D.h>
+#include <core/mParameterContainer.h>
 
 bool GetInitialCondition( const mParameterContainer& parameters,
                           mGrid2D< double >*& u );
diff --git a/src/dist/iter1d.cpp b/src/dist/iter1d.cpp
index a1bb349823..e1fcdfb87d 100644
--- a/src/dist/iter1d.cpp
+++ b/src/dist/iter1d.cpp
@@ -15,8 +15,8 @@
  *                                                                         *
  ***************************************************************************/
 
-#include <diff/mdiff.h>
-#include "debug.h"
+#include <diff/mGrid1D.h>
+#include <debug/tnlDebug.h>
 #include "iter1d.h"
 #include "mDistAux.h"
 
diff --git a/src/dist/iter1d.h b/src/dist/iter1d.h
index 6db42c6633..9a36c41ecc 100644
--- a/src/dist/iter1d.h
+++ b/src/dist/iter1d.h
@@ -18,7 +18,7 @@
 #ifndef iter1dH
 #define iter1dH
 
-#include <diff/mdiff.h>
+#include <diff/mGrid1D.h>
 
 
 //! Function computing right-hand side of the evolutionary equation
diff --git a/src/dist/iter2d.cpp b/src/dist/iter2d.cpp
index 25bd7545c0..e795252122 100644
--- a/src/dist/iter2d.cpp
+++ b/src/dist/iter2d.cpp
@@ -15,8 +15,8 @@
  *                                                                         *
  ***************************************************************************/
 
-#include <diff/mdiff.h>
-#include "debug.h"
+#include <diff/mGrid2D.h>
+#include <debug/tnlDebug.h>
 #include "iter1d.h"
 #include "mDistAux.h"
 
diff --git a/src/dist/iter2d.h b/src/dist/iter2d.h
index 1a7c9280eb..b989f81ff8 100644
--- a/src/dist/iter2d.h
+++ b/src/dist/iter2d.h
@@ -18,7 +18,7 @@
 #ifndef iter2dH
 #define iter2dH
 
-#include <diff/mdiff.h>
+#include <diff/mGrid2D.h>
 
 //! Function computing right-hand side of the evolutionary equation
 /*void mDstIter2D( const m_real& t,
diff --git a/src/dist/mDistAux.h b/src/dist/mDistAux.h
index 8506bad0d4..d1008b6052 100644
--- a/src/dist/mDistAux.h
+++ b/src/dist/mDistAux.h
@@ -18,8 +18,6 @@
 #ifndef mDistAuxH
 #define mDistAuxH
 
-#include <diff/mdiff.h>
-
 enum mDistIterMethod { mDstNone = 0,
                        mDstRegularisedScheme,
                        mDstUpwindScheme,
diff --git a/src/dist/main.cpp b/src/dist/main.cpp
index 04bb83e337..8ceb2f5769 100644
--- a/src/dist/main.cpp
+++ b/src/dist/main.cpp
@@ -15,7 +15,8 @@
  *                                                                         *
  ***************************************************************************/
 
-#include <diff/mdiff.h>
+#include <core/mConfig.h>
+#include <debug/tnlDebug.h>
 
 //--------------------------------------------------------------------------
 m_bool GetConfiguration( mConfig& config, 
diff --git a/src/dist/mdist-test.cpp b/src/dist/mdist-test.cpp
index ed9731ddbe..b72b52aeaa 100644
--- a/src/dist/mdist-test.cpp
+++ b/src/dist/mdist-test.cpp
@@ -15,9 +15,9 @@
  *                                                                         *
  ***************************************************************************/
 
-//--------------------------------------------------------------------------
-#include <diff/mdiff.h>
-#include "debug.h"
+#include <core/mCurve.h>
+#include <diff/mGrid2D.h>
+#include <debug/tnlDebug.h>
 #include "mdist.h"
 
 void ParamCircle( const double& t, void* crv_data, double& x, double& y )
diff --git a/src/dist/mdist.cpp b/src/dist/mdist.cpp
index d15f4b752f..1c06577cbf 100644
--- a/src/dist/mdist.cpp
+++ b/src/dist/mdist.cpp
@@ -15,14 +15,7 @@
  *                                                                         *
  ***************************************************************************/
 
-#include <diff/mdiff.h>
-#include "lib/iter1d.h"
-#include "lib/iter2d.h"
-#include "lib/iter3d.h"
-#include "lib/fmm2d.h"
-#include "lib/fsm2d.h"
-#include "lib/ftm2d.h"
-#include "lib/debug.h"
+#include <debug/tnlDebug.h>
 
 m_bool CheckParameters( mConfig& config )
 {
diff --git a/src/dist/msdfIterBase.cpp b/src/dist/msdfIterBase.cpp
index b564799ec2..8906cb67d0 100644
--- a/src/dist/msdfIterBase.cpp
+++ b/src/dist/msdfIterBase.cpp
@@ -16,6 +16,13 @@
  ***************************************************************************/
 
 #include "msdfIterBase.h"
+#include <core/mCurve.h>
+#include <core/mfuncs.h>
+#include <core/mfilename.h>
+#include <diff/drawGrid2D.h>
+#include <diff/mExplicitSolver.h>
+#include <diff/curve-ident.h>
+
 
 //--------------------------------------------------------------------------
 msdfIterBase :: msdfIterBase()
diff --git a/src/dist/msdfIterBase.h b/src/dist/msdfIterBase.h
index 6091072d53..34e2aa93b6 100644
--- a/src/dist/msdfIterBase.h
+++ b/src/dist/msdfIterBase.h
@@ -18,7 +18,10 @@
 #ifndef msdfIterBaseH
 #define msdfIterBaseH
 
-#include<diff/mdiff.h>
+#include <diff/mGrid2D.h>
+#include <core/mParameterContainer.h>
+
+template< class GRID, class SCHEME, typename T > class mExplicitSolver;
 
 class msdfIterBase 
 {
diff --git a/src/dist/msdfSussmanFatemi.cpp b/src/dist/msdfSussmanFatemi.cpp
index f866981d61..decf8dd287 100644
--- a/src/dist/msdfSussmanFatemi.cpp
+++ b/src/dist/msdfSussmanFatemi.cpp
@@ -15,10 +15,15 @@
  *                                                                         *
  ***************************************************************************/
 
-#include <config.h>
 #include "msdfSussmanFatemi.h"
 
+#include <config.h>
 #include <float.h>
+#include <math.h>
+#include <core/mfuncs.h>
+#include <diff/mEulerSolver.h>
+#include <diff/mMersonSolver.h>
+#include <diff/mNonlinearRungeKuttaSolver.h>
 
 //--------------------------------------------------------------------------
 msdfSussmanFatemi :: msdfSussmanFatemi()
diff --git a/src/dist/msdfSussmanFatemi.h b/src/dist/msdfSussmanFatemi.h
index 7e893ca05f..064bedc5ac 100644
--- a/src/dist/msdfSussmanFatemi.h
+++ b/src/dist/msdfSussmanFatemi.h
@@ -18,7 +18,8 @@
 #ifndef msdfSussmanFatemiH
 #define msdfSussmanFatemiH
 
-#include <diff/mdiff.h>
+#include <diff/mGrid2D.h>
+#include <core/mParameterContainer.h>
 #include "msdfIterBase.h"
 
 class msdfSussmanFatemi : public msdfIterBase
diff --git a/src/dist/param-crv-dst.cpp b/src/dist/param-crv-dst.cpp
index 763d6d3a8f..2ec608038d 100644
--- a/src/dist/param-crv-dst.cpp
+++ b/src/dist/param-crv-dst.cpp
@@ -15,11 +15,15 @@
  *                                                                         *
  ***************************************************************************/
 
+#include "param-crv-dst.h"
+
 #include <math.h>
 #include <float.h>
-#include "debug.h"
+
+#include <debug/tnlDebug.h>
+#include <core/mfuncs.h>
 #include "fsm2d.h"
-#include "param-crv-dst.h"
+
 
 //--------------------------------------------------------------------------
 mLevelSetCreator :: mLevelSetCreator()
diff --git a/src/dist/param-crv-dst.h b/src/dist/param-crv-dst.h
index 259be58c98..5d3adee5fd 100644
--- a/src/dist/param-crv-dst.h
+++ b/src/dist/param-crv-dst.h
@@ -18,7 +18,7 @@
 #ifndef param_crv_dstH
 #define param_crv_dstH
 
-#include <diff/mdiff.h>
+#include <diff/mGrid2D.h>
 
 class mLevelSetCreator
 {
diff --git a/src/dist/sdf-restore.cpp b/src/dist/sdf-restore.cpp
index 8ef4ecfb81..f52ed66a98 100644
--- a/src/dist/sdf-restore.cpp
+++ b/src/dist/sdf-restore.cpp
@@ -18,7 +18,10 @@
 //--------------------------------------------------------------------------
 #include <sys/utsname.h>
 #include <time.h>
-#include <diff/mdiff.h>
+#include <core/mParameterContainer.h>
+#include <core/mLogger.h>
+
+
 #include "debug.h"
 #include "mdist.h"
 #include "sdf-restore-def.h"
diff --git a/tools/src/bin2gnuplot.cpp b/tools/src/bin2gnuplot.cpp
index 610a9c7d98..902e546f1e 100644
--- a/tools/src/bin2gnuplot.cpp
+++ b/tools/src/bin2gnuplot.cpp
@@ -16,7 +16,7 @@
  ***************************************************************************/
 
 #include <fstream>
-#include <diff/mdiff.h>
+#include <diff/mGrid2D.h>
 #include <stdio.h>
 
 //--------------------------------------------------------------------------
diff --git a/tools/src/compare-objects.cpp b/tools/src/compare-objects.cpp
index a78999602a..fb36709cbb 100644
--- a/tools/src/compare-objects.cpp
+++ b/tools/src/compare-objects.cpp
@@ -17,6 +17,9 @@
 
 #include "compare-objects.h"
 
+#include <math.h>
+#include <core/mfuncs.h>
+
 //--------------------------------------------------------------------------
 bool Compare( const mGrid2D< double >& u1,
               const mGrid2D< double >& u2,
diff --git a/tools/src/compare-objects.h b/tools/src/compare-objects.h
index ee8302432c..0fd2446692 100644
--- a/tools/src/compare-objects.h
+++ b/tools/src/compare-objects.h
@@ -18,7 +18,8 @@
 #ifndef compare_objetsH
 #define compare_objetsH
 
-#include <diff/mdiff.h>
+#include <diff/mGrid2D.h>
+#include <diff/mGrid3D.h>
 
 bool Compare( const mGrid2D< double >& u1,
               const mGrid2D< double >& u2,
diff --git a/tools/src/diff-norm.cpp b/tools/src/diff-norm.cpp
index 905f0efad4..f32821ed4b 100644
--- a/tools/src/diff-norm.cpp
+++ b/tools/src/diff-norm.cpp
@@ -16,7 +16,7 @@
  ***************************************************************************/
 
 #include <fstream>
-#include <diff/mdiff.h>
+#include <diff/mGrid2D.h>
 #include <stdio.h>
 
 bool ReadInputFile( const char* file_name, 
diff --git a/tools/src/mcurve2gnuplot.cpp b/tools/src/mcurve2gnuplot.cpp
index 1609f6f9c5..236696cc39 100644
--- a/tools/src/mcurve2gnuplot.cpp
+++ b/tools/src/mcurve2gnuplot.cpp
@@ -15,8 +15,12 @@
  *                                                                         *
  ***************************************************************************/
 
-#include <diff/mdiff.h>
 #include "mcurve2gnuplot-def.h"
+#include <core/mParameterContainer.h>
+#include <core/compress-file.h>
+#include <core/mCurve.h>
+#include <core/mVector.h>
+
 
 //--------------------------------------------------------------------------
 int main( int argc, char* argv[] )
diff --git a/tools/src/mdiff-err-norms.cpp b/tools/src/mdiff-err-norms.cpp
index 02eb8d6287..d795223378 100644
--- a/tools/src/mdiff-err-norms.cpp
+++ b/tools/src/mdiff-err-norms.cpp
@@ -15,10 +15,19 @@
  *                                                                         *
  ***************************************************************************/
 
-#include <debug/tnlDebug.h>
-#include <diff/mdiff.h>
 #include <fstream>
 #include <stdio.h>
+#include <math.h>
+
+#include <debug/tnlDebug.h>
+#include <diff/mGrid1D.h>
+#include <diff/mGrid2D.h>
+#include <diff/drawGrid1D.h>
+#include <diff/drawGrid2D.h>
+#include <core/mConfigDescription.h>
+#include <core/mParameterContainer.h>
+#include <core/mCurve.h>
+
 #include "../../mdiff-err-norms-def.h"
 #include "read-file.h"
 #include "compare-objects.h"
@@ -129,6 +138,7 @@ bool TryCompressFile( const char* file_name,
       cerr << "Unable to compress back the file " << file_name << "." << endl;
       return false;
    }
+   return true;
 }
 //--------------------------------------------------------------------------
 int main( int argc, char* argv[] )
diff --git a/tools/src/mgrid-view.cpp b/tools/src/mgrid-view.cpp
index f880d13ba2..524a875322 100644
--- a/tools/src/mgrid-view.cpp
+++ b/tools/src/mgrid-view.cpp
@@ -15,9 +15,16 @@
  *                                                                         *
  ***************************************************************************/
 
-#include <diff/mdiff.h>
 #include "mgrid-view-def.h"
 
+#include <core/compress-file.h>
+#include <core/mCurve.h>
+#include <core/mConfigDescription.h>
+#include <core/mParameterContainer.h>
+#include <diff/curve-ident.h>
+#include <diff/drawGrid2D.h>
+#include <diff/drawGrid3D.h>
+
 bool ProcessmGrid2D( const mString& file_name, 
                      const mParameterContainer& parameters,
                      int file_index,
diff --git a/tools/src/mgrid2gnuplot.cpp b/tools/src/mgrid2gnuplot.cpp
index 1ba791df13..781bcda2a4 100644
--- a/tools/src/mgrid2gnuplot.cpp
+++ b/tools/src/mgrid2gnuplot.cpp
@@ -15,9 +15,12 @@
  *                                                                         *
  ***************************************************************************/
 
-#include <diff/mdiff.h>
 #include "mgrid2gnuplot-def.h"
 
+#include <diff/mGrid2D.h>
+#include <core/mParameterContainer.h>
+
+
 //--------------------------------------------------------------------------
 int main( int argc, char* argv[] )
 {
diff --git a/tools/src/read-file.h b/tools/src/read-file.h
index 1362dae1b8..29bdc7af1a 100644
--- a/tools/src/read-file.h
+++ b/tools/src/read-file.h
@@ -19,7 +19,7 @@
 #define read_fileH
 
 
-#include <diff/mdiff.h>
+#include <core/compress-file.h>
 
 template< class T > bool ReadFile( const char* input_file, T& u )
 {
-- 
GitLab