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

Working on tnl-view tool.

parent 80811ca0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ template< typename Real,
          typename Index >
tnlString tnlSharedVector< Real, Device, Index > :: getType() const
{
   return tnlString( "tnlSharedVector< " ) + ", " +
   return tnlString( "tnlSharedVector< " ) +
                     getParameterType< Real >() + ", " +
                     Device :: getDeviceType() + ", " +
                     getParameterType< Index >() + " >";
+0 −1
Original line number Diff line number Diff line
@@ -45,7 +45,6 @@ template< typename Real,
           typename Index >
tnlString tnlGrid< 2, Real, Device, Index> :: getType() const
{
   cerr << "################" << endl;
   return this -> getTypeStatic();
}

+7 −1
Original line number Diff line number Diff line
@@ -47,5 +47,11 @@ int main( int argc, char* argv[] )
      return EXIT_FAILURE;
   }
   cout << meshType << " detected in " << meshFile << " file." << endl;
   if( meshType == "tnlGrid< 2, double, tnlHost, int >" )
   {
      if( ! processMesh< tnlGrid< 2, double, tnlHost, int > >( parameters ) )
         return EXIT_FAILURE;
      return EXIT_SUCCESS;
   }
   return EXIT_FAILURE;
}
+35 −0
Original line number Diff line number Diff line
@@ -18,7 +18,42 @@
#ifndef TNL_VIEW_H_
#define TNL_VIEW_H_

#include <config/tnlParameterContainer.h>
#include <mesh/tnlGrid.h>


template< typename Mesh >
bool processMesh( const tnlParameterContainer& parameters )
{
   int verbose = parameters. GetParameter< int >( "verbose");
   tnlString meshFile = parameters. GetParameter< tnlString >( "mesh" );
   Mesh mesh;
   if( ! mesh. load( meshFile ) )
   {
      cerr << "I am not able to load mesh from the file " << meshFile << "." << endl;
      return false;
   }

   tnlList< tnlString > inputFiles = parameters. GetParameter< tnlList< tnlString > >( "input-files" );

   for( int i = 0; i < inputFiles. getSize(); i ++ )
   {
      if( verbose )
         cout << "Processing file " << inputFiles[ i ] << " ... " << flush;


      tnlString objectType;
      if( ! getObjectType( inputFiles[ i ], objectType ) )
          cerr << "unknown object ... SKIPPING!" << endl;
      else
      {
         if( verbose )
            cout << objectType << " detected ... ";
      }
      if( verbose )
         cout << endl;
   }
}


#endif /* TNL_VIEW_H_ */