diff --git a/src/implementation/core/tnlString.cpp b/src/implementation/core/tnlString.cpp index 01dabf525a466acc917013d6a7ade61498cd32fd..d128923e3df1f13de951ed0090473ab2336b885c 100644 --- a/src/implementation/core/tnlString.cpp +++ b/src/implementation/core/tnlString.cpp @@ -81,7 +81,7 @@ tnlString :: ~tnlString() { if( string ) delete[] string; } -//--------------------------------------------------------------------------- + void tnlString :: setString( const char* c, int prefix_cut_off, int sufix_cut_off ) { if( ! c ) @@ -111,27 +111,27 @@ void tnlString :: setString( const char* c, int prefix_cut_off, int sufix_cut_of memcpy( string, c + Min( c_len, prefix_cut_off ), sizeof( char ) * ( _length ) ); string[ _length ] = 0; } -//--------------------------------------------------------------------------- + const char& tnlString :: operator[]( int i ) const { tnlAssert( i >= 0 && i < length, cerr << "Accessing char outside the string." ); return string[ i ]; } -//--------------------------------------------------------------------------- + char& tnlString :: operator[]( int i ) { tnlAssert( i >= 0 && i < length, cerr << "Accessing char outside the string." ); return string[ i ]; } -//--------------------------------------------------------------------------- + tnlString& tnlString :: operator = ( const tnlString& str ) { setString( str. getString() ); return * this; } -//--------------------------------------------------------------------------- + tnlString& tnlString :: operator += ( const char* str ) { if( str ) @@ -151,7 +151,7 @@ tnlString& tnlString :: operator += ( const char* str ) } return * this; } -//--------------------------------------------------------------------------- + tnlString& tnlString :: operator += ( const char str ) { int len1 = strlen( string ); @@ -172,22 +172,22 @@ tnlString& tnlString :: operator += ( const char str ) return * this; } -//--------------------------------------------------------------------------- + tnlString& tnlString :: operator += ( const tnlString& str ) { return operator += ( str. getString() ); } -//--------------------------------------------------------------------------- + tnlString tnlString :: operator + ( const tnlString& str ) { return tnlString( *this ) += str; } -//--------------------------------------------------------------------------- + tnlString tnlString :: operator + ( const char* str ) { return tnlString( *this ) += str; } -//--------------------------------------------------------------------------- + bool tnlString :: operator == ( const tnlString& str ) const { assert( string && str. string ); @@ -197,12 +197,12 @@ bool tnlString :: operator == ( const tnlString& str ) const return true; return false; } -//--------------------------------------------------------------------------- + bool tnlString :: operator != ( const tnlString& str ) const { return ! operator == ( str ); } -//--------------------------------------------------------------------------- + bool tnlString :: operator == ( const char* str ) const { //cout << ( void* ) string << " " << ( void* ) str << endl; diff --git a/src/implementation/schemes/euler/fvm/tnlLaxFridrichs_impl.h b/src/implementation/schemes/euler/fvm/tnlLaxFridrichs_impl.h index f564e08d501fc0a2bdb42de6f33177ccf856866e..8cfe1c728e5ddac2f66ef5c1083b76367b446777 100644 --- a/src/implementation/schemes/euler/fvm/tnlLaxFridrichs_impl.h +++ b/src/implementation/schemes/euler/fvm/tnlLaxFridrichs_impl.h @@ -366,9 +366,10 @@ template< typename Real, typename Index, typename PressureGradient > void tnlLaxFridrichs< tnlGrid< 2, Real, Device, Index, tnlIdenticalGridGeometry >, PressureGradient > :: getExplicitRhs( const IndexType centralVolume, - RealType& rho_t, - RealType& rho_u1_t, - RealType& rho_u2_t ) const + RealType& rho_t, + RealType& rho_u1_t, + RealType& rho_u2_t, + const RealType& tau ) const { tnlAssert( mesh, cerr << "No mesh has been binded with the Lax-Fridrichs scheme." ); tnlAssert( pressureGradient, cerr << "No pressure gradient was set in the the Lax-Fridrichs scheme." ) @@ -391,7 +392,7 @@ void tnlLaxFridrichs< tnlGrid< 2, Real, Device, Index, tnlIdenticalGridGeometry const RealType u1_w = rho_u1[ w ] / regularize( rho[ w ] ); const RealType u2_n = rho_u2[ n ] / regularize( rho[ n ] ); const RealType u2_s = rho_u2[ s ] / regularize( rho[ s ] ); - rho_t = this -> viscosityCoefficient * 0.25 * ( rho[ e ] + rho[ w ] + rho[ s ] + rho[ n ] - 4.0 * rho[ c ] ) + rho_t = this -> viscosityCoefficient / tau * 0.25 * ( rho[ e ] + rho[ w ] + rho[ s ] + rho[ n ] - 4.0 * rho[ c ] ) - ( rho[ e ] * u1_e - rho[ w ] * u1_w ) / ( 2.0 * hx ) - ( rho[ n ] * u2_n - rho[ s ] * u2_s ) / ( 2.0 * hy ); @@ -404,14 +405,14 @@ void tnlLaxFridrichs< tnlGrid< 2, Real, Device, Index, tnlIdenticalGridGeometry /**** * ( rho * u1 )_t + ( rho * u1 * u1 )_x + ( rho * u1 * u2 )_y - p_x = 0 */ - rho_u1_t = this -> viscosityCoefficient * 0.25 * ( rho_u1[ e ] + rho_u1[ w ] + rho_u1[ s ] + rho_u1[ n ] - 4.0 * rho_u1[ c ] ) + rho_u1_t = this -> viscosityCoefficient / tau * 0.25 * ( rho_u1[ e ] + rho_u1[ w ] + rho_u1[ s ] + rho_u1[ n ] - 4.0 * rho_u1[ c ] ) - ( rho_u1[ e ] * u1_e - rho_u1[ w ] * u1_w ) / ( 2.0 * hx ) - ( rho_u1[ n ] * u2_n - rho_u1[ s ] * u2_s ) / ( 2.0 * hy ) - grad_p. x(); /**** * ( rho * u2 )_t + ( rho * u2 * u1 )_x + ( rho * u2 * u2 )_y - p_y = 0 */ - rho_u2_t = this -> viscosityCoefficient * 0.25 * ( rho_u2[ e ] + rho_u2[ w ] + rho_u2[ s ] + rho_u2[ n ] - 4.0 * rho_u2[ c ] ) + rho_u2_t = this -> viscosityCoefficient / tau * 0.25 * ( rho_u2[ e ] + rho_u2[ w ] + rho_u2[ s ] + rho_u2[ n ] - 4.0 * rho_u2[ c ] ) - ( rho_u2[ e ] * u1_e - rho_u2[ w ] * u1_w ) / ( 2.0 * hx ) - ( rho_u2[ n ] * u2_n - rho_u2[ s ] * u2_s ) / ( 2.0 * hy ) - grad_p. y();