Commit 9b72926e authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Fixes after merge.

parent 9e64c7d5
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -6,18 +6,18 @@ set( tnl_flow_sw_SOURCES
     navierStokes.cu )
               
IF( BUILD_CUDA )
   CUDA_ADD_EXECUTABLE(tnl-navier-stokes-sw${debugExt} navierStokes.cu)
   target_link_libraries (tnl-navier-stokes-sw${debugExt} tnl${debugExt}-${tnlVersion}  ${CUSPARSE_LIBRARY} )
   CUDA_ADD_EXECUTABLE(tnl-navier-stokes-sw navierStokes.cu)
   target_link_libraries (tnl-navier-stokes-sw tnl ${CUSPARSE_LIBRARY} )
ELSE(  BUILD_CUDA )               
   ADD_EXECUTABLE(tnl-navier-stokes-sw${debugExt} navierStokes.cpp)     
   target_link_libraries (tnl-navier-stokes-sw${debugExt} tnl${debugExt}-${tnlVersion} )
   ADD_EXECUTABLE(tnl-navier-stokes-sw navierStokes.cpp)     
   target_link_libraries (tnl-navier-stokes-sw tnl )
ENDIF( BUILD_CUDA )


INSTALL( TARGETS tnl-navier-stokes-sw${debugExt}
INSTALL( TARGETS tnl-navier-stokes-sw
         RUNTIME DESTINATION bin
         PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE )
        
INSTALL( FILES run-navier-stokes-sw
               ${tnl_inviscid_flow_SOURCES}
         DESTINATION share/tnl-${tnlVersion}/examples/navier-stokes-sw )
         DESTINATION ${TNL_TARGET_DATA_DIRECTORY}/examples/navier-stokes-sw )
+2 −5
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ class UpwindContinuityBase
          this->velocity = velocity;
      };

      __cuda_callable__
      RealType positiveDensityFlux( const RealType& density, const RealType& velocity, const RealType& pressure ) const
      {
         const RealType& speedOfSound = std::sqrt( this->gamma * pressure / density );
@@ -79,6 +80,7 @@ class UpwindContinuityBase
            return density * velocity;
      };

      __cuda_callable__
      RealType negativeDensityFlux( const RealType& density, const RealType& velocity, const RealType& pressure ) const
      {
         const RealType& speedOfSound = std::sqrt( this->gamma * pressure / density );
@@ -93,11 +95,6 @@ class UpwindContinuityBase
            return 0.0;
      };
      
      RealType multiply (const RealType& a, const RealType& b ) const
      {
         return a * b;
      };
      

      protected:
         
+2 −0
Original line number Diff line number Diff line
@@ -124,6 +124,7 @@ class UpwindEnergy< Meshes::Grid< 1, MeshReal, Device, MeshIndex >, Real, Index
      using typename BaseType::VelocityFieldPointer;
      using BaseType::Dimensions;      

      __cuda_callable__
      RealType positiveEnergyFlux( const RealType& density, const RealType& velocity_main, const RealType& pressure ) const
      {
         const RealType& speedOfSound = std::sqrt( this->gamma * pressure / density );
@@ -148,6 +149,7 @@ class UpwindEnergy< Meshes::Grid< 1, MeshReal, Device, MeshIndex >, Real, Index
            return velocity_main * ( pressure + pressure / ( this->gamma - 1.0 ) + 0.5 * density * ( velocity_main * velocity_main ) );
      };
      
      __cuda_callable__
      RealType negativeEnergyFlux( const RealType& density, const RealType& velocity_main, const RealType& pressure ) const
      {
         const RealType& speedOfSound = std::sqrt( this->gamma * pressure / density );
+4 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ class UpwindMomentumBase
         this->dynamicalViscosity = dynamicalViscosity;
      }

      __cuda_callable__
      RealType positiveMainMomentumFlux( const RealType& density, const RealType& velocity, const RealType& pressure ) const
      {
         const RealType& speedOfSound = std::sqrt( this->gamma * pressure / density );
@@ -76,6 +77,7 @@ class UpwindMomentumBase
            return density * velocity * velocity + pressure;
      };

      __cuda_callable__
      RealType negativeMainMomentumFlux( const RealType& density, const RealType& velocity, const RealType& pressure ) const
      {
         const RealType& speedOfSound = std::sqrt( this->gamma * pressure / density );
@@ -90,6 +92,7 @@ class UpwindMomentumBase
            return 0; 
      };

      __cuda_callable__
      RealType positiveOtherMomentumFlux( const RealType& density, const RealType& velocity_main, const RealType& velocity_other, const RealType& pressure ) const
      {
         const RealType& speedOfSound = std::sqrt( this->gamma * pressure / density );
@@ -104,6 +107,7 @@ class UpwindMomentumBase
            return density * velocity_main * velocity_other;
      };

      __cuda_callable__
      RealType negativeOtherMomentumFlux( const RealType& density, const RealType& velocity_main, const RealType& velocity_other, const RealType& pressure ) const
      {
         const RealType& speedOfSound = std::sqrt( this->gamma * pressure / density );
+21 −12
Original line number Diff line number Diff line
@@ -21,18 +21,6 @@ template<> struct ConfigTagReal< navierStokesBuildConfigTag, long double > { enu
template<> struct ConfigTagIndex< navierStokesBuildConfigTag, short int >{ enum { enabled = false }; };
template<> struct ConfigTagIndex< navierStokesBuildConfigTag, long int >{ enum { enabled = false }; };

//template< int Dimension > struct ConfigTagDimension< navierStokesBuildConfigTag, Dimension >{ enum { enabled = ( Dimension == 1 ) }; };

/****
 * Use of Grid is enabled for allowed dimensions and Real, Device and Index types.
 */
template< int Dimension, typename Real, typename Device, typename Index >
   struct ConfigTagMesh< navierStokesBuildConfigTag, Meshes::Grid< Dimension, Real, Device, Index > >
      { enum { enabled = ConfigTagDimension< navierStokesBuildConfigTag, Dimension >::enabled  &&
                         ConfigTagReal< navierStokesBuildConfigTag, Real >::enabled &&
                         ConfigTagDevice< navierStokesBuildConfigTag, Device >::enabled &&
                         ConfigTagIndex< navierStokesBuildConfigTag, Index >::enabled }; };

/****
 * Please, chose your preferred time discretisation  here.
 */
@@ -46,6 +34,27 @@ template<> struct ConfigTagTimeDiscretisation< navierStokesBuildConfigTag, Impli
template<> struct ConfigTagExplicitSolver< navierStokesBuildConfigTag, ExplicitEulerSolverTag >{ enum { enabled = true }; };

} // namespace Solvers

namespace Meshes {
namespace BuildConfigTags {

template< int Dimensions > struct GridDimensionTag< navierStokesBuildConfigTag, Dimensions >{ enum { enabled = ( Dimensions == 1 ) }; };

/****
 * Turn off support for float and long double.
 */
template<> struct GridRealTag< navierStokesBuildConfigTag, float > { enum { enabled = false }; };
template<> struct GridRealTag< navierStokesBuildConfigTag, long double > { enum { enabled = false }; };

/****
 * Turn off support for short int and long int indexing.
 */
template<> struct GridIndexTag< navierStokesBuildConfigTag, short int >{ enum { enabled = false }; };
template<> struct GridIndexTag< navierStokesBuildConfigTag, long int >{ enum { enabled = false }; };

} // namespace BuildConfigTags
} // namespace Meshes

} // namespace TNL

#endif /* navierStokesBUILDCONFIGTAG_H_ */
Loading