From 2ff4b2bf0410a7518352d46e646caa6cd9aff052 Mon Sep 17 00:00:00 2001 From: Tomas Oberhuber <tomas.oberhuber@fjfi.cvut.cz> Date: Mon, 13 May 2013 15:34:17 +0200 Subject: [PATCH] Fixing the Lax-Fridrichs scheme. --- .../schemes/euler/fvm/tnlLaxFridrichs_impl.h | 19 ++++++++++++++++--- src/schemes/euler/fvm/tnlLaxFridrichs.h | 6 ++++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/implementation/schemes/euler/fvm/tnlLaxFridrichs_impl.h b/src/implementation/schemes/euler/fvm/tnlLaxFridrichs_impl.h index dcbd6dad28..352924c31a 100644 --- a/src/implementation/schemes/euler/fvm/tnlLaxFridrichs_impl.h +++ b/src/implementation/schemes/euler/fvm/tnlLaxFridrichs_impl.h @@ -33,6 +33,19 @@ tnlLaxFridrichs< tnlGrid< 2, Real, Device, Index, GridGeometry >, { } +template< typename Real, + typename Device, + typename Index, + typename PressureGradient, + template< int, typename, typename, typename > class GridGeometry > +tnlString tnlLaxFridrichs< tnlGrid< 2, Real, Device, Index, GridGeometry >, + PressureGradient > :: getTypeStatic() +{ + return tnlString( "tnlLaxFridrichs< " ) + + tnlGrid< 2, Real, Device, Index, GridGeometry > :: getTypeStatic() + ", " + + PressureGradient :: getTypeStatic() + " >"; +} + template< typename Real, typename Device, typename Index, @@ -116,9 +129,9 @@ template< typename Real, typename PressureGradient, template< int, typename, typename, typename > class GridGeometry > void tnlLaxFridrichs< tnlGrid< 2, Real, Device, Index, GridGeometry >, 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 { 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." ) diff --git a/src/schemes/euler/fvm/tnlLaxFridrichs.h b/src/schemes/euler/fvm/tnlLaxFridrichs.h index 70642b94ef..381ce8e6c3 100644 --- a/src/schemes/euler/fvm/tnlLaxFridrichs.h +++ b/src/schemes/euler/fvm/tnlLaxFridrichs.h @@ -23,8 +23,8 @@ #include <mesh/tnlIdenticalGridGeometry.h> #include <schemes/gradient/tnlCentralFDMGradient.h> -template< typename MeshType, - typename PressureGradient = tnlCentralFDMGradient > +template< typename Mesh, + typename PressureGradient = tnlCentralFDMGradient< Mesh > > class tnlLaxFridrichs { }; @@ -47,6 +47,8 @@ class tnlLaxFridrichs< tnlGrid< 2, Real, Device, Index, GridGeometry >, Pressure tnlLaxFridrichs(); + static tnlString getTypeStatic(); + void getExplicitRhs( const IndexType centralVolume, RealType& rho_t, RealType& rho_u1_t, -- GitLab