Loading src/implementation/mesh/tnlGrid2D_impl.h +1 −1 Original line number Diff line number Diff line Loading @@ -250,7 +250,7 @@ bool tnlGrid< 2, Real, Device, Index> :: write( const MeshFunction& function, for( IndexType i = 0; i < getDimensions(). x(); i++ ) { const RealType x = this -> getLowerCorner(). x() + i * hx; const RealType y = this -> getLowerCorner(). y() + i * hy; const RealType y = this -> getLowerCorner(). y() + j * hy; file << x << " " << " " << y << " " << function[ this -> getNodeIndex( j, i ) ] << endl; } file << endl; Loading src/solvers/ode/tnlEulerSolver.h +33 −1 Original line number Diff line number Diff line Loading @@ -37,6 +37,10 @@ class tnlEulerSolver : public tnlExplicitSolver< Problem > tnlString getType() const; void setCFLCondition( const RealType& cfl ); const RealType& getCFLCondition() const; bool solve( DofVectorType& u ); protected: Loading @@ -46,11 +50,14 @@ class tnlEulerSolver : public tnlExplicitSolver< Problem > DofVectorType k1; RealType cflCondition; }; template< typename Problem > tnlEulerSolver< Problem > :: tnlEulerSolver() : k1( "tnlEulerSolver:k1" ) : k1( "tnlEulerSolver:k1" ), cflCondition( 0.0 ) { }; Loading @@ -62,6 +69,18 @@ tnlString tnlEulerSolver< Problem > :: getType() const tnlString( " >" ); }; template< typename Problem > void tnlEulerSolver< Problem > :: setCFLCondition( const RealType& cfl ) { this -> cflCondition = cfl; } template< typename Problem > const typename Problem :: RealType& tnlEulerSolver< Problem > :: getCFLCondition() const { return this -> cflCondition; } template< typename Problem > bool tnlEulerSolver< Problem > :: solve( DofVectorType& u ) { Loading Loading @@ -104,6 +123,16 @@ bool tnlEulerSolver< Problem > :: solve( DofVectorType& u ) this -> problem -> GetExplicitRHS( time, currentTau, u, k1 ); RealType lastResidue = residue; RealType maxResidue( 0.0 ); if( this -> cflCondition != 0.0 ) { maxResidue = k1. absMax(); if( currentTau * maxResidue > this -> cflCondition ) { currentTau *= 0.9; continue; } } computeNewTimeLevel( u, currentTau, residue ); /**** Loading Loading @@ -138,6 +167,9 @@ bool tnlEulerSolver< Problem > :: solve( DofVectorType& u ) return true; } if( iteration == this -> getMaxIterationsNumber() ) return false; if( this -> cflCondition != 0.0 ) currentTau /= 0.95; } }; Loading Loading
src/implementation/mesh/tnlGrid2D_impl.h +1 −1 Original line number Diff line number Diff line Loading @@ -250,7 +250,7 @@ bool tnlGrid< 2, Real, Device, Index> :: write( const MeshFunction& function, for( IndexType i = 0; i < getDimensions(). x(); i++ ) { const RealType x = this -> getLowerCorner(). x() + i * hx; const RealType y = this -> getLowerCorner(). y() + i * hy; const RealType y = this -> getLowerCorner(). y() + j * hy; file << x << " " << " " << y << " " << function[ this -> getNodeIndex( j, i ) ] << endl; } file << endl; Loading
src/solvers/ode/tnlEulerSolver.h +33 −1 Original line number Diff line number Diff line Loading @@ -37,6 +37,10 @@ class tnlEulerSolver : public tnlExplicitSolver< Problem > tnlString getType() const; void setCFLCondition( const RealType& cfl ); const RealType& getCFLCondition() const; bool solve( DofVectorType& u ); protected: Loading @@ -46,11 +50,14 @@ class tnlEulerSolver : public tnlExplicitSolver< Problem > DofVectorType k1; RealType cflCondition; }; template< typename Problem > tnlEulerSolver< Problem > :: tnlEulerSolver() : k1( "tnlEulerSolver:k1" ) : k1( "tnlEulerSolver:k1" ), cflCondition( 0.0 ) { }; Loading @@ -62,6 +69,18 @@ tnlString tnlEulerSolver< Problem > :: getType() const tnlString( " >" ); }; template< typename Problem > void tnlEulerSolver< Problem > :: setCFLCondition( const RealType& cfl ) { this -> cflCondition = cfl; } template< typename Problem > const typename Problem :: RealType& tnlEulerSolver< Problem > :: getCFLCondition() const { return this -> cflCondition; } template< typename Problem > bool tnlEulerSolver< Problem > :: solve( DofVectorType& u ) { Loading Loading @@ -104,6 +123,16 @@ bool tnlEulerSolver< Problem > :: solve( DofVectorType& u ) this -> problem -> GetExplicitRHS( time, currentTau, u, k1 ); RealType lastResidue = residue; RealType maxResidue( 0.0 ); if( this -> cflCondition != 0.0 ) { maxResidue = k1. absMax(); if( currentTau * maxResidue > this -> cflCondition ) { currentTau *= 0.9; continue; } } computeNewTimeLevel( u, currentTau, residue ); /**** Loading Loading @@ -138,6 +167,9 @@ bool tnlEulerSolver< Problem > :: solve( DofVectorType& u ) return true; } if( iteration == this -> getMaxIterationsNumber() ) return false; if( this -> cflCondition != 0.0 ) currentTau /= 0.95; } }; Loading