Skip to content
Snippets Groups Projects
Commit 38035244 authored by Tomas Sobotik's avatar Tomas Sobotik
Browse files

Dimension FORK added for Fast-sweeping

parent 9437c8d7
No related branches found
No related tags found
No related merge requests found
...@@ -29,6 +29,7 @@ class fastSweepingConfig ...@@ -29,6 +29,7 @@ class fastSweepingConfig
config.addDelimiter( "Parallel Eikonal solver settings:" ); config.addDelimiter( "Parallel Eikonal solver settings:" );
config.addEntry < tnlString > ( "problem-name", "This defines particular problem.", "fast-sweeping" ); config.addEntry < tnlString > ( "problem-name", "This defines particular problem.", "fast-sweeping" );
config.addRequiredEntry < tnlString > ( "initial-condition", "Initial condition for solver"); config.addRequiredEntry < tnlString > ( "initial-condition", "Initial condition for solver");
config.addRequiredEntry < tnlString > ( "dim", "Dimension of problem.");
config.addEntry < tnlString > ( "mesh", "Name of mesh.", "mesh.tnl" ); config.addEntry < tnlString > ( "mesh", "Name of mesh.", "mesh.tnl" );
config.addEntry < tnlString > ( "exact-input", "Are the function values near the curve equal to the SDF? (yes/no)", "no" ); config.addEntry < tnlString > ( "exact-input", "Are the function values near the curve equal to the SDF? (yes/no)", "no" );
} }
......
...@@ -43,16 +43,36 @@ int main( int argc, char* argv[] ) ...@@ -43,16 +43,36 @@ int main( int argc, char* argv[] )
if( ! parseCommandLine( argc, argv, configDescription, parameters ) ) if( ! parseCommandLine( argc, argv, configDescription, parameters ) )
return false; return false;
tnlFastSweeping<tnlGrid<3,double,tnlHost, int>, double, int> solver; const tnlString& dim = parameters.getParameter< tnlString >( "dim" );
if(!solver.init(parameters))
if(dim == "2")
{
tnlFastSweeping<tnlGrid<2,double,tnlHost, int>, double, int> solver;
if(!solver.init(parameters))
{
cerr << "Solver failed to initialize." << endl;
return EXIT_FAILURE;
}
checkCudaDevice;
cout << "-------------------------------------------------------------" << endl;
cout << "Starting solver..." << endl;
solver.run();
}
else if(dim == "3")
{ {
cerr << "Solver failed to initialize." << endl; tnlFastSweeping<tnlGrid<3,double,tnlHost, int>, double, int> solver;
return EXIT_FAILURE; if(!solver.init(parameters))
{
cerr << "Solver failed to initialize." << endl;
return EXIT_FAILURE;
}
checkCudaDevice;
cout << "-------------------------------------------------------------" << endl;
cout << "Starting solver..." << endl;
solver.run();
} }
checkCudaDevice; else
cout << "-------------------------------------------------------------" << endl; cerr << "Unsopported no. of dimensions: " << dim << "!" << endl;
cout << "Starting solver..." << endl;
solver.run();
time(&stop); time(&stop);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment