Skip to content
Snippets Groups Projects
Commit f8b7fa52 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Working on tnl-view tool.

parent 80811ca0
No related branches found
No related tags found
No related merge requests found
......@@ -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 >() + " >";
......
......@@ -45,7 +45,6 @@ template< typename Real,
typename Index >
tnlString tnlGrid< 2, Real, Device, Index> :: getType() const
{
cerr << "################" << endl;
return this -> getTypeStatic();
}
......
......@@ -47,5 +47,11 @@ int main( int argc, char* argv[] )
return EXIT_FAILURE;
}
cout << meshType << " detected in " << meshFile << " file." << endl;
return EXIT_SUCCESS;
if( meshType == "tnlGrid< 2, double, tnlHost, int >" )
{
if( ! processMesh< tnlGrid< 2, double, tnlHost, int > >( parameters ) )
return EXIT_FAILURE;
return EXIT_SUCCESS;
}
return EXIT_FAILURE;
}
......@@ -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_ */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment