Commit da94aef3 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber

tnl-quicstart and installation scripts were improved.

parent b2840e59
......@@ -45,5 +45,42 @@ then
make install
cd ..
fi
TNL_TEST=`which tnl-bindir`
if test x${TNL_TEST} = x;
then
echo ""
echo "WARNING !!!"
echo ""
echo "Your system does not see TNL which was installed right now."
echo "You need to add it to your system variables PATH and LD_LIBRARY_PATH."
echo "Add the following to your .bashrc file:"
echo ""
PREFIX=${HOME}/local
for option in "$@"
do
case $option in
--prefix=* ) PREFIX="${option#*=}" ;;
esac
done
echo "if test x\${PATH} = x;"
echo "then"
echo " PATH=${PREFIX}/bin"
echo "else"
echo " PATH=\${PATH}:${PREFIX}/bin"
echo "fi"
echo "if test x\${LD_LIBRARY_PATH} = x;"
echo "then"
echo " LD_LIBRARY_PATH=${PREFIX}/lib"
echo "else"
echo " LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:${PREFIX}/lib"
echo "fi"
echo "export PATH"
echo "export LD_LIBRARY_PATH"
fi
exit 0
......@@ -50,7 +50,7 @@ tnlBICGStabSolver< Matrix, Preconditioner >::
configSetup( tnlConfigDescription& config,
const tnlString& prefix )
{
tnlIterativeSolver< RealType, IndexType >::configSetup( config, prefix );
//tnlIterativeSolver< RealType, IndexType >::configSetup( config, prefix );
}
template< typename Matrix,
......
......@@ -40,7 +40,7 @@ tnlCGSolver< Matrix, Preconditioner >::
configSetup( tnlConfigDescription& config,
const tnlString& prefix )
{
tnlIterativeSolver< RealType, IndexType >::configSetup( config, prefix );
//tnlIterativeSolver< RealType, IndexType >::configSetup( config, prefix );
}
template< typename Matrix,
......
......@@ -55,8 +55,8 @@ tnlGMRESSolver< Matrix, Preconditioner >::
configSetup( tnlConfigDescription& config,
const tnlString& prefix )
{
tnlIterativeSolver< RealType, IndexType >::configSetup( config, prefix );
config.addEntry< int >( prefix + "gmres-restarting", "Number of iterations after which the GMRES restarts.", 10 );
//tnlIterativeSolver< RealType, IndexType >::configSetup( config, prefix );
config.addEntry< int >( prefix + "gmres-restarting", "Number of iterations after which the GMRES restarts.", 10 );
}
template< typename Matrix,
......@@ -68,6 +68,7 @@ setup( const tnlParameterContainer& parameters,
{
tnlIterativeSolver< RealType, IndexType >::setup( parameters, prefix );
this->setRestarting( parameters.getParameter< int >( "gmres-restarting" ) );
return true;
}
template< typename Matrix,
......
......@@ -49,7 +49,7 @@ tnlTFQMRSolver< Matrix, Preconditioner >::
configSetup( tnlConfigDescription& config,
const tnlString& prefix )
{
tnlIterativeSolver< RealType, IndexType >::configSetup( config, prefix );
//tnlIterativeSolver< RealType, IndexType >::configSetup( config, prefix );
}
template< typename Matrix,
......@@ -59,7 +59,7 @@ tnlTFQMRSolver< Matrix, Preconditioner >::
setup( const tnlParameterContainer& parameters,
const tnlString& prefix )
{
tnlIterativeSolver< RealType, IndexType >::setup( parameters, prefix );
return tnlIterativeSolver< RealType, IndexType >::setup( parameters, prefix );
}
template< typename Matrix,
......
......@@ -39,7 +39,7 @@ tnlSORSolver< Matrix, Preconditioner >::
configSetup( tnlConfigDescription& config,
const tnlString& prefix )
{
tnlIterativeSolver< RealType, IndexType >::configSetup( config, prefix );
//tnlIterativeSolver< RealType, IndexType >::configSetup( config, prefix );
config.addEntry< double >( prefix + "sor-omega", "Relaxation parameter of the SOR method.", 1.0 );
}
......
......@@ -48,7 +48,7 @@ template< typename Problem >
void tnlEulerSolver< Problem > :: configSetup( tnlConfigDescription& config,
const tnlString& prefix )
{
tnlExplicitSolver< Problem >::configSetup( config, prefix );
//tnlExplicitSolver< Problem >::configSetup( config, prefix );
config.addEntry< double >( prefix + "euler-cfl", "Coefficient C in the Courant–Friedrichs–Lewy condition.", 0.0 );
};
......
......@@ -41,7 +41,7 @@ tnlExplicitSolver< Problem >::
configSetup( tnlConfigDescription& config,
const tnlString& prefix )
{
tnlIterativeSolver< typename Problem::RealType, typename Problem::IndexType >::configSetup( config, prefix );
//tnlIterativeSolver< typename Problem::RealType, typename Problem::IndexType >::configSetup( config, prefix );
}
template< typename Problem >
......
......@@ -111,7 +111,7 @@ template< typename Problem >
void tnlMersonSolver< Problem > :: configSetup( tnlConfigDescription& config,
const tnlString& prefix )
{
tnlExplicitSolver< Problem >::configSetup( config, prefix );
//tnlExplicitSolver< Problem >::configSetup( config, prefix );
config.addEntry< double >( prefix + "merson-adaptivity", "Time step adaptivity controlling coefficient (the smaller the more precise the computation is, zero means no adaptivity).", 1.0e-4 );
};
......
......@@ -100,7 +100,7 @@ bool tnlSolverConfig< ConfigTag, ProblemConfig >::configSetup( tnlConfigDescript
}
config.addRequiredEntry< tnlString >( "discrete-solver", "The solver of the discretised problem:" );
if( tnlConfigTagTimeDiscretisation< ConfigTag, tnlExplicitTimeDiscretisationTag >::enabled )
{
{
if( tnlConfigTagExplicitSolver< ConfigTag, tnlExplicitEulerSolverTag >::enabled )
config.addEntryEnum( "euler" );
if( tnlConfigTagExplicitSolver< ConfigTag, tnlExplicitMersonSolverTag >::enabled )
......@@ -117,9 +117,16 @@ bool tnlSolverConfig< ConfigTag, ProblemConfig >::configSetup( tnlConfigDescript
if( tnlConfigTagSemiImplicitSolver< ConfigTag, tnlSemiImplicitSORSolverTag >::enabled )
config.addEntryEnum( "sor" );
}
if( tnlConfigTagTimeDiscretisation< ConfigTag, tnlExplicitTimeDiscretisationTag >::enabled ||
tnlConfigTagTimeDiscretisation< ConfigTag, tnlSemiImplicitTimeDiscretisationTag >::enabled )
{
config.addDelimiter( " === Iterative solvers parameters === " );
tnlIterativeSolver< double, int >::configSetup( config );
}
if( tnlConfigTagTimeDiscretisation< ConfigTag, tnlExplicitTimeDiscretisationTag >::enabled )
{
config.addDelimiter( " === Explicit solvers parameters === " );
tnlExplicitSolver< tnlDummyProblem< double, tnlHost, int > >::configSetup( config );
if( tnlConfigTagExplicitSolver< ConfigTag, tnlExplicitEulerSolverTag >::enabled )
tnlEulerSolver< tnlDummyProblem< double, tnlHost, int > >::configSetup( config );
......@@ -128,7 +135,7 @@ bool tnlSolverConfig< ConfigTag, ProblemConfig >::configSetup( tnlConfigDescript
}
if( tnlConfigTagTimeDiscretisation< ConfigTag, tnlSemiImplicitTimeDiscretisationTag >::enabled )
{
config.addDelimiter( " === Semi-implicit solvers parameters === " );
config.addDelimiter( " === Semi-implicit solvers parameters === " );
typedef tnlCSRMatrix< double, tnlHost, int > MatrixType;
if( tnlConfigTagSemiImplicitSolver< ConfigTag, tnlSemiImplicitCGSolverTag >::enabled )
tnlCGSolver< MatrixType >::configSetup( config );
......
#!/usr/bin/env bash
tnl-quickstart.py
\ No newline at end of file
PYTHON=`which python3`
TNL_BINDIR=`tnl-bindir`
if test x${PYTHON} = x;
then
echo "It seems that Python 3 is not install on your system."
echo "You may install it as follows:"
echo ""
echo "In Ubuntu: sudo apt-get install python3"
echo "In OpenSuse:"
echo "In CentOS:"
else
${PYTHON} ${TNL_BINDIR}/tnl-quickstart.py
fi
......@@ -38,12 +38,12 @@ def generateMakefile( problemBaseName ):
file.write( "all: $(TARGET)\n" )
file.write( "\n" )
file.write( "clean:\n" )
file.write( "\t rm -f $(OBJECTS)" )
file.write( "\t rm -f *.o" )
file.write( "\n" )
file.write( "dist: $(DIST)" )
file.write( "\t tar zcvf $(TARGET).tgz $(DIST)\n" )
file.write( "\n" )
file.write( "$(TARGET): % : %.o\n" )
file.write( "$(TARGET): $(OBJECTS)\n" )
file.write( "\t$(CXX) -o $@ $< $(LDFLAGS)\n" )
file.write( "\n" )
file.write( "%.o: %.cpp\n" )
......@@ -87,6 +87,10 @@ def generateMain( problemName, problemBaseName, operatorName ):
file.write( " static void configSetup( tnlConfigDescription & config )\n" )
file.write( " {\n" )
file.write( " config.addDelimiter( \"" + problemName + " settings:\" );\n" )
file.write( " config.addEntry< tnlString >( \"boundary-conditions-type\", \"Choose the boundary conditions type.\", \"dirichlet\");\n" )
file.write( " config.addEntryEnum< tnlString >( \"dirichlet\" );\n" )
file.write( " config.addEntryEnum< tnlString >( \"neumann\" );\n" )
file.write( " config.addEntry< double >( \"boundary-conditions-constant\", \"This sets a value in case of the constant boundary conditions.\" );\n" )
file.write( "\n" )
file.write( " /****\n" )
file.write( " * Add definition of your solver command line arguments.\n" )
......@@ -717,7 +721,7 @@ def generateRhs( problemBaseName ):
file.write( " const Real& time ) const\n" )
file.write( " {\n" )
file.write( " typedef typename Mesh::VertexType VertexType;\n" )
file.write( " VertexType v = mesh.getCellCenter( index );\n" )
file.write( " VertexType v = mesh.template getCellCenter< VertexType >( index );\n" )
file.write( " return 0.0;\n" )
file.write( " };\n" )
file.write( "};\n" )
......@@ -738,13 +742,13 @@ def generateRunScript( problemBaseName ):
file.write( " --size-y 100\n" )
file.write( "\n" )
file.write( "tnl-init --test-function sin-wave \\\n" )
file.write( " --output-file u-ini.tnl\n" )
file.write( problemName + " --time-discretisation explicit \\\n" )
file.write( " --output-file init.tnl\n" )
file.write( "./" + problemName + " --time-discretisation explicit \\\n" )
file.write( " --discrete-solver merson \\\n" )
file.write( " --snapshot-period 0.01 \\\n" )
file.write( " --final-time 1.0\n" )
file.write( "\n" )
file.write( "tnl-view --mesh mesh.tnl *tnl \n" )
file.write( "tnl-view --mesh mesh.tnl --input-files *tnl \n" )
file.close()
print( "TNL Quickstart -- solver generator")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment