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

Dimension for 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
config.addDelimiter( "Parallel Eikonal solver settings:" );
config.addEntry < tnlString > ( "problem-name", "This defines particular problem.", "fast-sweeping" );
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 > ( "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[] )
if( ! parseCommandLine( argc, argv, configDescription, parameters ) )
return false;
tnlFastSweeping<tnlGrid<3,double,tnlHost, int>, double, int> solver;
if(!solver.init(parameters))
const tnlString& dim = parameters.getParameter< tnlString >( "dim" );
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;
return EXIT_FAILURE;
tnlFastSweeping<tnlGrid<3,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();
}
checkCudaDevice;
cout << "-------------------------------------------------------------" << endl;
cout << "Starting solver..." << endl;
solver.run();
else
cerr << "Unsopported no. of dimensions: " << dim << "!" << endl;
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