Commit 1c8fd746 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Improving tools for errors and eoc evaluation.

parent 66933708
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -7,6 +7,11 @@
		<project>image-flow</project>
	</projects>
	<buildSpec>
		<buildCommand>
			<name>org.python.pydev.PyDevBuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.eclipse.linuxtools.cdt.autotools.genmakebuilder</name>
			<arguments>
@@ -24,5 +29,6 @@
		<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
		<nature>org.eclipse.linuxtools.cdt.autotools.autotoolsNature</nature>
		<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
		<nature>org.python.pydev.pythonNature</nature>
	</natures>
</projectDescription>

.pydevproject

0 → 100644
+7 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?eclipse-pydev version="1.0"?>

<pydev_project>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.6</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
</pydev_project>
+1 −0
Original line number Diff line number Diff line
@@ -13,5 +13,6 @@ group IO
   real tau                         [Time period between the subsequent solutions.]; 
   real initial-radius              [Radius of the initial circle.];
   real space-step(0.0)             [Says explicitly the space step of the numerical simulation.];
   integer verbose(1)               [Sets verbosity.];
},[Arguments describing input and output data.];
+2 −2
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ tnlcurve2gnuplot_dbg_CXXFLAGS = $(CXXFLAGS) $(DBGCXXFLAGS)
tnlcurve2gnuplot_dbg_LDADD = ../../src/libtnl-dbg-0.1.la
endif

bin_SCRIPTS = mdiff-err2eoc.py
bin_SCRIPTS = tnl-diff-err2eoc.py

EXTRA_DIST = debug.h \
	         mdiff-err2eoc.py
	         tnl-diff-err2eoc.py
+33 −23
Original line number Diff line number Diff line
@@ -156,12 +156,15 @@ int main( int argc, char* argv[] )
      conf_desc. PrintUsage( argv[ 0 ] );
      return 1;
   }

   int verbose = parameters. GetParameter< int >( "verbose" );
   if( verbose )
   {
      cout << "************************************************************************" << endl;
      cout << "*                                                                      *" << endl;
      cout << "*           mDiff Tools: grid difference                               *" << endl;
      cout << "*                                                                      *" << endl;
      cout << "************************************************************************" << endl;
   }

   tnlString test = parameters. GetParameter< tnlString >( "test" );
   tnlList< tnlString > first_files = parameters. GetParameter< tnlList< tnlString > >( "first-set" );
@@ -176,6 +179,7 @@ int main( int argc, char* argv[] )
      second_files = parameters. GetParameter< tnlList< tnlString > >( "second-set" );
   }
   int size = first_files. Size();
   if( verbose )
      cout << "Processing " << size << " files. " << endl;

   int edge_skip = parameters. GetParameter< int >( "edges-skip" );
@@ -240,6 +244,7 @@ int main( int argc, char* argv[] )
      {
         //cout << setw( 85 ) << " ";
         const char* first_file = first_files[ i ]. Data();
         if( verbose )
            cout << "Processing file " << first_file << " ...          \r" << flush;
         if( ! TryUncompressFile( first_file, first_file_uncompressed ) )
         {
@@ -255,6 +260,7 @@ int main( int argc, char* argv[] )
         if( i % first2second_ratio == 0 && i / first2second_ratio < second_files. Size() )
         {
            second_file = second_files[ i / first2second_ratio ]. Data();
            if( verbose )
               cout << "Processing file " << second_file << " ...          \r" << flush;
            if( ! TryUncompressFile( second_file, second_file_uncompressed ) )
            {
@@ -273,7 +279,7 @@ int main( int argc, char* argv[] )
            continue;
         }
         
         double l1_norm( 0.0 ), l2_norm( 0.0 ), max_norm( 0.0 ), h( 0.0 );
         double l1_norm( 0.0 ), l2_norm( 0.0 ), max_norm( 0.0 );
         
         if( first_object_type == "tnlGrid2D< double >" )
         {
@@ -285,7 +291,7 @@ int main( int argc, char* argv[] )
            file. open( first_file_uncompressed. Data(), ios :: in | ios :: binary );
            if( ! u1. Load( file ) )
            {
               cout << " unable to restore the data " << endl;
               cerr << " unable to restore the data " << endl;
               file. close();
               return false;
            }
@@ -293,7 +299,7 @@ int main( int argc, char* argv[] )
            file. open( second_file_uncompressed. Data(), ios :: in | ios :: binary );
            if( ! u2. Load( file ) )
            {
               cout << " unable to restore the data " << endl;
               cerr << " unable to restore the data " << endl;
               file. close();
               return false;
            }
@@ -325,7 +331,7 @@ int main( int argc, char* argv[] )
            file. open( first_file_uncompressed. Data(), ios :: in | ios :: binary );
            if( ! u1. Load( file ) )
            {
               cout << " unable to restore the data " << endl;
               cerr << " unable to restore the data " << endl;
               file. close();
               return false;
            }
@@ -333,7 +339,7 @@ int main( int argc, char* argv[] )
            file. open( second_file_uncompressed. Data(), ios :: in | ios :: binary );
            if( ! u2. Load( file ) )
            {
               cout << " unable to restore the data " << endl;
               cerr << " unable to restore the data " << endl;
               file. close();
               return false;
            }
@@ -359,6 +365,7 @@ int main( int argc, char* argv[] )
         l1_int += tau * l1_norm;
         l2_int += tau * l2_norm * l2_norm;
         max_int = Max( max_int, max_norm );
         if( verbose )
            WriteLine( cout, i, tau, h, l1_norm, l2_norm, max_norm );
         if( output_file )
            WriteLine( output_file, i, tau, h, l1_norm, l2_norm, max_norm );
@@ -366,14 +373,14 @@ int main( int argc, char* argv[] )
            WriteGraphLine( graph_file, i, tau, l1_norm, l2_norm, max_norm );
         if( write_log_graph )
            WriteLogGraphLine( log_graph_file, i, tau, l1_norm, l2_norm, max_norm );

         if( verbose )
            cout << "Compressing opened files back ...                   \r" << flush;
         TryCompressFile( first_file, first_file_uncompressed );
         TryCompressFile( second_file, second_file_uncompressed );

      }
      l2_int = sqrt( l2_int );
      if( tau )
      if( tau && verbose )
         WriteLastLine( cout, h, l1_int, l2_int, max_int );
      if( output_file )
      {
@@ -381,6 +388,7 @@ int main( int argc, char* argv[] )
            WriteLastLine( output_file, h, l1_int, l2_int, max_int );
         output_file. close();
      }
      if( verbose )
         cout << endl << "Bye." << endl;
      return 0;
   }
@@ -475,6 +483,7 @@ int main( int argc, char* argv[] )
         l1_int += tau * l1_norm;
         l2_int += tau * l2_norm * l2_norm;
         max_int = Max( max_int, max_norm );
         if( verbose )
            WriteLine( cout, i, tau, h, l1_norm, l2_norm, max_norm );
         if( output_file )
            WriteLine( output_file, i, tau, h, l1_norm, l2_norm, max_norm );
@@ -485,7 +494,7 @@ int main( int argc, char* argv[] )
         t += tau;
      }
      l2_int = sqrt( l2_int );
      if( tau )
      if( tau && verbose )
         WriteLastLine( cout, h, l1_int, l2_int, max_int );
      if( output_file )
      {
@@ -493,13 +502,14 @@ int main( int argc, char* argv[] )
            WriteLastLine( output_file, h, l1_int, l2_int, max_int );
         output_file. close();
      }
      if( verbose )
         cout << endl << "Bye." << endl;
      if( output_file ) output_file. close();
      if( graph_file ) graph_file. close();
      if( log_graph_file ) log_graph_file. close();
      return 0;
   }
   cout << endl << "Uknown test " << test << ". Bye." << endl;
   cerr << endl << "Uknown test " << test << ". Bye." << endl;
   return -1;
}
Loading