Loading src/TNL/Config/ParameterContainer.h +14 −1 Original line number Diff line number Diff line Loading @@ -82,7 +82,7 @@ public: } /** * \brief Checks whether the parameter \e name already exists in ParameterContainer. * \brief Checks if the ParameterContainer contains a parameter specified by its name. * * \param name Name of the parameter. */ Loading @@ -95,6 +95,19 @@ public: return false; } /** * \brief Checks whether the ParameterContainer contains all specified parameter names. * * \param name Name of the parameter. */ bool checkParameters( std::initializer_list< String > names ) const { for( auto name : names ) if( ! checkParameter( name ) ) return false; return true; } /** * \brief Assigns new \e value to the parameter \e name. * Loading src/Tools/tnl-diff.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -23,10 +23,10 @@ void setupConfig( Config::ConfigDescription& config ) config.addEntryEnum< String >( "halves" ); config.addEntry< bool >( "exact-match", "Check if the data are exactly the same.", false ); config.addEntry< bool >( "write-difference", "Write difference grid function.", false ); config.addEntry< bool >( "write-exact-curve", "Write exact curve with given radius.", false ); // config.addEntry< bool >( "write-exact-curve", "Write exact curve with given radius.", false ); config.addEntry< int >( "edges-skip", "Width of the edges that will be skipped - not included into the error norms.", 0 ); config.addEntry< bool >( "write-graph", "Draws a graph in the Gnuplot format of the dependence of the error norm on t.", true ); config.addEntry< bool >( "write-log-graph", "Draws a logarithmic graph in the Gnuplot format of the dependence of the error norm on t.", true ); // config.addEntry< bool >( "write-graph", "Draws a graph in the Gnuplot format of the dependence of the error norm on t.", true ); // config.addEntry< bool >( "write-log-graph", "Draws a logarithmic graph in the Gnuplot format of the dependence of the error norm on t.", true ); config.addEntry< double >( "snapshot-period", "The period between consecutive snapshots.", 0.0 ); config.addEntry< bool >( "verbose", "Sets verbosity.", true ); } Loading src/Tools/tnl-grid-setup.cpp +16 −15 Original line number Diff line number Diff line Loading @@ -19,7 +19,10 @@ void configSetup( Config::ConfigDescription& config ) config.addDelimiter ( "Grid parameters" ); config.addEntry < String >( "grid-name", "The grid name.", "tnl-grid" ); config.addRequiredEntry< int > ( "dimensions", "The grid dimensions." ); config.addRequiredEntry< int > ( "dimension", "The grid dimension." ); config.addEntryEnum< int >( 1 ); config.addEntryEnum< int >( 2 ); config.addEntryEnum< int >( 3 ); config.addEntry < String >( "real-type", "Precision of the real type describing the grid.", "double" ); config.addEntryEnum < String >( "float" ); config.addEntryEnum < String >( "double" ); Loading Loading @@ -50,5 +53,3 @@ int main( int argc, char* argv[] ) return EXIT_FAILURE; return EXIT_SUCCESS; } src/Tools/tnl-grid-setup.h +38 −26 Original line number Diff line number Diff line Loading @@ -19,13 +19,17 @@ using namespace TNL; template< typename RealType, typename IndexType > bool setupGrid( const Config::ParameterContainer& parameters ) { String gridName = parameters. getParameter< String >( "grid-name" ); String outputFile = parameters. getParameter< String >( "output-file" ); int dimensions = parameters. getParameter< int >( "dimensions" ); if( dimensions == 1 ) const String gridName = parameters.getParameter< String >( "grid-name" ); const String outputFile = parameters.getParameter< String >( "output-file" ); const int dimension = parameters.getParameter< int >( "dimension" ); if( dimension == 1 ) { RealType originX = parameters.getParameter< double >( "origin-x" ); RealType proportionsX = parameters.getParameter< double >( "proportions-x" ); if( ! parameters.checkParameter( "size-x" ) ) { std::cerr << "The parameter size-x is required when the grid dimension is 1." << std::endl; return false; } IndexType sizeX = parameters.getParameter< int >( "size-x" ); typedef Meshes::Grid< 1, RealType, Devices::Host, IndexType > GridType; Loading @@ -46,12 +50,16 @@ bool setupGrid( const Config::ParameterContainer& parameters ) return false; } } if( dimensions == 2 ) if( dimension == 2 ) { RealType originX = parameters.getParameter< double >( "origin-x" ); RealType originY = parameters.getParameter< double >( "origin-y" ); RealType proportionsX = parameters.getParameter< double >( "proportions-x" ); RealType proportionsY = parameters.getParameter< double >( "proportions-y" ); if( ! parameters.checkParameters( {"size-x", "size-y"} ) ) { std::cerr << "The parameters size-x and size-y are required when the grid dimension is 2." << std::endl; return false; } IndexType sizeX = parameters.getParameter< int >( "size-x" ); IndexType sizeY = parameters.getParameter< int >( "size-y" ); typedef Meshes::Grid< 2, RealType, Devices::Host, IndexType > GridType; Loading Loading @@ -84,7 +92,7 @@ bool setupGrid( const Config::ParameterContainer& parameters ) return false; } } if( dimensions == 3 ) if( dimension == 3 ) { RealType originX = parameters.getParameter< double >( "origin-x" ); RealType originY = parameters.getParameter< double >( "origin-y" ); Loading @@ -92,6 +100,10 @@ bool setupGrid( const Config::ParameterContainer& parameters ) RealType proportionsX = parameters.getParameter< double >( "proportions-x" ); RealType proportionsY = parameters.getParameter< double >( "proportions-y" ); RealType proportionsZ = parameters.getParameter< double >( "proportions-z" ); if( ! parameters.checkParameters( {"size-x", "size-y", "size-z"} ) ) { std::cerr << "The parameters size-x, size-y and size-z are required when the grid dimension is 3." << std::endl; return false; } IndexType sizeX = parameters.getParameter< int >( "size-x" ); IndexType sizeY = parameters.getParameter< int >( "size-y" ); IndexType sizeZ = parameters.getParameter< int >( "size-z" ); Loading src/Tools/tnl-view.cpp +16 −17 Original line number Diff line number Diff line Loading @@ -67,14 +67,14 @@ void setupConfig( Config::ConfigDescription& config ) config.addDelimiter( "General settings:" ); config.addEntry < String >( "mesh", "Mesh file.", "mesh.tnl" ); config.addRequiredList < String >( "input-files", "Input files." ); config.addList < String > ( "output-files", "Output files." ); // config.addList < String >( "output-files", "Output files." ); config.addEntry < bool > ( "check-output-file", "If the output file already exists, do not recreate it.", false ); config.addDelimiter( "Grid settings:"); config.addList < double > ( "level-lines", "List of level sets which will be drawn." ); config.addEntry < int > ( "output-x-size", "X size of the output." ); config.addEntry < int > ( "output-y-size", "Y size of the output." ); config.addEntry < int > ( "output-z-size", "Z size of the output." ); // config.addList < double >( "level-lines", "List of level sets which will be drawn." ); // config.addEntry < int > ( "output-x-size", "X size of the output." ); // config.addEntry < int > ( "output-y-size", "Y size of the output." ); // config.addEntry < int > ( "output-z-size", "Z size of the output." ); config.addEntry < double >( "scale", "Multiply the function by given number.", 1.0 ); config.addEntry < String >( "output-format", "Output file format.", "gnuplot" ); config.addEntryEnum< String > ( "gnuplot" ); Loading @@ -90,10 +90,9 @@ int main( int argc, char* argv[] ) if( ! parseCommandLine( argc, argv, conf_desc, parameters ) ) return EXIT_FAILURE; String meshFile = parameters.getParameter< String >( "mesh" ); const String meshFile = parameters.getParameter< String >( "mesh" ); return ! TNL::Meshes::resolveMeshType< TNLViewBuildConfigTag, Devices::Host, FilesProcessor > ( meshFile, parameters ); ( meshFile, parameters ); } src/Tools/tnl-view.h +1 −1 File changed.Contains only whitespace changes. Show changes Loading
src/TNL/Config/ParameterContainer.h +14 −1 Original line number Diff line number Diff line Loading @@ -82,7 +82,7 @@ public: } /** * \brief Checks whether the parameter \e name already exists in ParameterContainer. * \brief Checks if the ParameterContainer contains a parameter specified by its name. * * \param name Name of the parameter. */ Loading @@ -95,6 +95,19 @@ public: return false; } /** * \brief Checks whether the ParameterContainer contains all specified parameter names. * * \param name Name of the parameter. */ bool checkParameters( std::initializer_list< String > names ) const { for( auto name : names ) if( ! checkParameter( name ) ) return false; return true; } /** * \brief Assigns new \e value to the parameter \e name. * Loading
src/Tools/tnl-diff.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -23,10 +23,10 @@ void setupConfig( Config::ConfigDescription& config ) config.addEntryEnum< String >( "halves" ); config.addEntry< bool >( "exact-match", "Check if the data are exactly the same.", false ); config.addEntry< bool >( "write-difference", "Write difference grid function.", false ); config.addEntry< bool >( "write-exact-curve", "Write exact curve with given radius.", false ); // config.addEntry< bool >( "write-exact-curve", "Write exact curve with given radius.", false ); config.addEntry< int >( "edges-skip", "Width of the edges that will be skipped - not included into the error norms.", 0 ); config.addEntry< bool >( "write-graph", "Draws a graph in the Gnuplot format of the dependence of the error norm on t.", true ); config.addEntry< bool >( "write-log-graph", "Draws a logarithmic graph in the Gnuplot format of the dependence of the error norm on t.", true ); // config.addEntry< bool >( "write-graph", "Draws a graph in the Gnuplot format of the dependence of the error norm on t.", true ); // config.addEntry< bool >( "write-log-graph", "Draws a logarithmic graph in the Gnuplot format of the dependence of the error norm on t.", true ); config.addEntry< double >( "snapshot-period", "The period between consecutive snapshots.", 0.0 ); config.addEntry< bool >( "verbose", "Sets verbosity.", true ); } Loading
src/Tools/tnl-grid-setup.cpp +16 −15 Original line number Diff line number Diff line Loading @@ -19,7 +19,10 @@ void configSetup( Config::ConfigDescription& config ) config.addDelimiter ( "Grid parameters" ); config.addEntry < String >( "grid-name", "The grid name.", "tnl-grid" ); config.addRequiredEntry< int > ( "dimensions", "The grid dimensions." ); config.addRequiredEntry< int > ( "dimension", "The grid dimension." ); config.addEntryEnum< int >( 1 ); config.addEntryEnum< int >( 2 ); config.addEntryEnum< int >( 3 ); config.addEntry < String >( "real-type", "Precision of the real type describing the grid.", "double" ); config.addEntryEnum < String >( "float" ); config.addEntryEnum < String >( "double" ); Loading Loading @@ -50,5 +53,3 @@ int main( int argc, char* argv[] ) return EXIT_FAILURE; return EXIT_SUCCESS; }
src/Tools/tnl-grid-setup.h +38 −26 Original line number Diff line number Diff line Loading @@ -19,13 +19,17 @@ using namespace TNL; template< typename RealType, typename IndexType > bool setupGrid( const Config::ParameterContainer& parameters ) { String gridName = parameters. getParameter< String >( "grid-name" ); String outputFile = parameters. getParameter< String >( "output-file" ); int dimensions = parameters. getParameter< int >( "dimensions" ); if( dimensions == 1 ) const String gridName = parameters.getParameter< String >( "grid-name" ); const String outputFile = parameters.getParameter< String >( "output-file" ); const int dimension = parameters.getParameter< int >( "dimension" ); if( dimension == 1 ) { RealType originX = parameters.getParameter< double >( "origin-x" ); RealType proportionsX = parameters.getParameter< double >( "proportions-x" ); if( ! parameters.checkParameter( "size-x" ) ) { std::cerr << "The parameter size-x is required when the grid dimension is 1." << std::endl; return false; } IndexType sizeX = parameters.getParameter< int >( "size-x" ); typedef Meshes::Grid< 1, RealType, Devices::Host, IndexType > GridType; Loading @@ -46,12 +50,16 @@ bool setupGrid( const Config::ParameterContainer& parameters ) return false; } } if( dimensions == 2 ) if( dimension == 2 ) { RealType originX = parameters.getParameter< double >( "origin-x" ); RealType originY = parameters.getParameter< double >( "origin-y" ); RealType proportionsX = parameters.getParameter< double >( "proportions-x" ); RealType proportionsY = parameters.getParameter< double >( "proportions-y" ); if( ! parameters.checkParameters( {"size-x", "size-y"} ) ) { std::cerr << "The parameters size-x and size-y are required when the grid dimension is 2." << std::endl; return false; } IndexType sizeX = parameters.getParameter< int >( "size-x" ); IndexType sizeY = parameters.getParameter< int >( "size-y" ); typedef Meshes::Grid< 2, RealType, Devices::Host, IndexType > GridType; Loading Loading @@ -84,7 +92,7 @@ bool setupGrid( const Config::ParameterContainer& parameters ) return false; } } if( dimensions == 3 ) if( dimension == 3 ) { RealType originX = parameters.getParameter< double >( "origin-x" ); RealType originY = parameters.getParameter< double >( "origin-y" ); Loading @@ -92,6 +100,10 @@ bool setupGrid( const Config::ParameterContainer& parameters ) RealType proportionsX = parameters.getParameter< double >( "proportions-x" ); RealType proportionsY = parameters.getParameter< double >( "proportions-y" ); RealType proportionsZ = parameters.getParameter< double >( "proportions-z" ); if( ! parameters.checkParameters( {"size-x", "size-y", "size-z"} ) ) { std::cerr << "The parameters size-x, size-y and size-z are required when the grid dimension is 3." << std::endl; return false; } IndexType sizeX = parameters.getParameter< int >( "size-x" ); IndexType sizeY = parameters.getParameter< int >( "size-y" ); IndexType sizeZ = parameters.getParameter< int >( "size-z" ); Loading
src/Tools/tnl-view.cpp +16 −17 Original line number Diff line number Diff line Loading @@ -67,14 +67,14 @@ void setupConfig( Config::ConfigDescription& config ) config.addDelimiter( "General settings:" ); config.addEntry < String >( "mesh", "Mesh file.", "mesh.tnl" ); config.addRequiredList < String >( "input-files", "Input files." ); config.addList < String > ( "output-files", "Output files." ); // config.addList < String >( "output-files", "Output files." ); config.addEntry < bool > ( "check-output-file", "If the output file already exists, do not recreate it.", false ); config.addDelimiter( "Grid settings:"); config.addList < double > ( "level-lines", "List of level sets which will be drawn." ); config.addEntry < int > ( "output-x-size", "X size of the output." ); config.addEntry < int > ( "output-y-size", "Y size of the output." ); config.addEntry < int > ( "output-z-size", "Z size of the output." ); // config.addList < double >( "level-lines", "List of level sets which will be drawn." ); // config.addEntry < int > ( "output-x-size", "X size of the output." ); // config.addEntry < int > ( "output-y-size", "Y size of the output." ); // config.addEntry < int > ( "output-z-size", "Z size of the output." ); config.addEntry < double >( "scale", "Multiply the function by given number.", 1.0 ); config.addEntry < String >( "output-format", "Output file format.", "gnuplot" ); config.addEntryEnum< String > ( "gnuplot" ); Loading @@ -90,10 +90,9 @@ int main( int argc, char* argv[] ) if( ! parseCommandLine( argc, argv, conf_desc, parameters ) ) return EXIT_FAILURE; String meshFile = parameters.getParameter< String >( "mesh" ); const String meshFile = parameters.getParameter< String >( "mesh" ); return ! TNL::Meshes::resolveMeshType< TNLViewBuildConfigTag, Devices::Host, FilesProcessor > ( meshFile, parameters ); ( meshFile, parameters ); }