Loading src/Python/CMakeLists.txt +1 −2 Original line number Diff line number Diff line INSTALL( FILES __init__.py DESTINATION lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/TNL PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) DESTINATION lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/TNL ) src/TNL/Containers/StaticVector.h +68 −8 Original line number Diff line number Diff line Loading @@ -24,8 +24,6 @@ class StaticVector : public StaticArray< Size, Real > typedef StaticVector< Size, Real > ThisType; enum { size = Size }; using StaticArray< Size, Real >::operator=; __cuda_callable__ StaticVector(); Loading Loading @@ -97,6 +95,23 @@ class StaticVector : public StaticArray< Size, Real > __cuda_callable__ Real lpNorm( const Real& p ) const; #ifdef HAVE_MIC __cuda_callable__ inline StaticVector< Size, Real >& operator=( const StaticVector< Size, Real >& vector ) { StaticArray< Size, Real >::operator=( vector ); return *this; } template< typename Vector > __cuda_callable__ inline StaticVector< Size, Real >& operator=( const Vector& vector ) { StaticArray< Size, Real >::operator=( vector ); return *this; } #endif }; template< typename Real > Loading @@ -107,8 +122,6 @@ class StaticVector< 1, Real > : public StaticArray< 1, Real > typedef StaticVector< 1, Real > ThisType; enum { size = 1 }; using StaticArray< 1, Real >::operator=; __cuda_callable__ StaticVector(); Loading Loading @@ -180,6 +193,23 @@ class StaticVector< 1, Real > : public StaticArray< 1, Real > __cuda_callable__ Real lpNorm( const Real& p ) const; #ifdef HAVE_MIC __cuda_callable__ inline StaticVector< 1, Real >& operator=( const StaticVector< 1, Real >& vector ) { StaticArray< 1, Real >::operator=( vector ); return *this; } template< typename Vector > __cuda_callable__ inline StaticVector< 1, Real >& operator=( const Vector& vector ) { StaticArray< 1, Real >::operator=( vector ); return *this; } #endif }; template< typename Real > Loading @@ -190,8 +220,6 @@ class StaticVector< 2, Real > : public StaticArray< 2, Real > typedef StaticVector< 2, Real > ThisType; enum { size = 2 }; using StaticArray< 2, Real >::operator=; __cuda_callable__ StaticVector(); Loading Loading @@ -266,6 +294,23 @@ class StaticVector< 2, Real > : public StaticArray< 2, Real > __cuda_callable__ Real lpNorm( const Real& p ) const; #ifdef HAVE_MIC __cuda_callable__ inline StaticVector< 2, Real >& operator=( const StaticVector< 2, Real >& vector ) { StaticArray< 2, Real >::operator=( vector ); return *this; } template< typename Vector > __cuda_callable__ inline StaticVector< 2, Real >& operator=( const Vector& vector ) { StaticArray< 2, Real >::operator=( vector ); return *this; } #endif }; template< typename Real > Loading @@ -276,8 +321,6 @@ class StaticVector< 3, Real > : public StaticArray< 3, Real > typedef StaticVector< 3, Real > ThisType; enum { size = 3 }; using StaticArray< 3, Real >::operator=; __cuda_callable__ StaticVector(); Loading Loading @@ -352,6 +395,23 @@ class StaticVector< 3, Real > : public StaticArray< 3, Real > __cuda_callable__ Real lpNorm( const Real& p ) const; #ifdef HAVE_MIC __cuda_callable__ inline StaticVector< 3, Real >& operator=( const StaticVector< 3, Real >& vector ) { StaticArray< 3, Real >::operator=( vector ); return *this; } template< typename Vector > __cuda_callable__ inline StaticVector< 3, Real >& operator=( const Vector& vector ) { StaticArray< 3, Real >::operator=( vector ); return *this; } #endif }; template< int Size, typename Real, typename Scalar > Loading src/TNL/Functions/Analytic/SinBumpsSDF_impl.h +2 −2 Original line number Diff line number Diff line Loading @@ -86,7 +86,7 @@ getPartialDerivative( const PointType& v, const Real& time ) const { const RealType& x = v.x(); RealType xp = ::fabs( x ) + sign( x ) * this->phase.x() * this->waveLength.x() / ( 2.0*M_PI ); RealType xp = abs( x ) + sign( x ) * this->phase.x() * this->waveLength.x() / ( 2.0*M_PI ); if( this->wavesNumber.x() != 0.0 && xp > this->wavesNumber.x() * this->waveLength.x() ) return 0.0; if( YDiffOrder != 0 || ZDiffOrder != 0 ) Loading src/TNL/Functions/Analytic/SinBumps_impl.h +6 −6 Original line number Diff line number Diff line Loading @@ -101,7 +101,7 @@ getPartialDerivative( const PointType& v, return 0.0; const RealType& x = v.x(); const RealType xp = ::fabs( x ) + sign( x ) * this->phase.x() * this->waveLength.x() / (2.0*M_PI); const RealType xp = abs( x ) + sign( x ) * this->phase.x() * this->waveLength.x() / (2.0*M_PI); if( this->wavesNumber.x() != 0.0 && xp > this->waveLength.x() * this->wavesNumber.x() ) return 0.0; Loading Loading @@ -162,8 +162,8 @@ getPartialDerivative( const PointType& v, const RealType& x = v.x(); const RealType& y = v.y(); const RealType xp = ::fabs( x ) + sign( x ) * this->phase.x() * this->waveLength.x() / (2.0*M_PI); const RealType yp = ::fabs( y ) + sign( y ) * this->phase.y() * this->waveLength.y() / (2.0*M_PI); const RealType xp = abs( x ) + sign( x ) * this->phase.x() * this->waveLength.x() / (2.0*M_PI); const RealType yp = abs( y ) + sign( y ) * this->phase.y() * this->waveLength.y() / (2.0*M_PI); //std::cerr << "this->wavesNumber.x() = " << this->wavesNumber.x() << "fabs( x ) = " << fabs( x ) << " 2.0*M_PI * this->waveLength.x() * this->wavesNumber.x() = " << 2.0*M_PI * this->waveLength.x() * this->wavesNumber.x() << std::endl; if( ( this->wavesNumber.x() != 0.0 && xp > this->waveLength.x() * this->wavesNumber.x() ) || ( this->wavesNumber.y() != 0.0 && yp > this->waveLength.y() * this->wavesNumber.y() ) ) Loading Loading @@ -235,9 +235,9 @@ getPartialDerivative( const PointType& v, const RealType& y = v.y(); const RealType& z = v.z(); const RealType xp = ::fabs( x ) + sign( x ) * this->phase.x() * this->waveLength.x() / (2.0*M_PI); const RealType yp = ::fabs( y ) + sign( y ) * this->phase.y() * this->waveLength.y() / (2.0*M_PI); const RealType zp = ::fabs( z ) + sign( z ) * this->phase.z() * this->waveLength.z() / (2.0*M_PI); const RealType xp = abs( x ) + sign( x ) * this->phase.x() * this->waveLength.x() / (2.0*M_PI); const RealType yp = abs( y ) + sign( y ) * this->phase.y() * this->waveLength.y() / (2.0*M_PI); const RealType zp = abs( z ) + sign( z ) * this->phase.z() * this->waveLength.z() / (2.0*M_PI); if( ( this->wavesNumber.x() != 0.0 && xp > this->waveLength.x() * this->wavesNumber.x() ) || ( this->wavesNumber.y() != 0.0 && yp > this->waveLength.y() * this->wavesNumber.y() ) || Loading src/TNL/Math.h +2 −3 Original line number Diff line number Diff line Loading @@ -30,9 +30,8 @@ using both_integral_or_floating = typename std::conditional< // 1. If both types are integral or floating-point, the larger type is selected. // 2. If one type is integral and the other floating-point, the floating-point type is selected. // This is necessary only due to the limitations of nvcc. Note that clang and gcc // can handle automatic promotion using a single-type template, exactly like // std::min and std::max are implemented in STL. // Casting both arguments to the same type is necessary because std::min and std::max // are implemented as a single-type template. template< typename T1, typename T2 > using larger_type = typename std::conditional< ( both_integral_or_floating< T1, T2 >::value && sizeof(T1) >= sizeof(T2) ) || Loading Loading
src/Python/CMakeLists.txt +1 −2 Original line number Diff line number Diff line INSTALL( FILES __init__.py DESTINATION lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/TNL PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) DESTINATION lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/TNL )
src/TNL/Containers/StaticVector.h +68 −8 Original line number Diff line number Diff line Loading @@ -24,8 +24,6 @@ class StaticVector : public StaticArray< Size, Real > typedef StaticVector< Size, Real > ThisType; enum { size = Size }; using StaticArray< Size, Real >::operator=; __cuda_callable__ StaticVector(); Loading Loading @@ -97,6 +95,23 @@ class StaticVector : public StaticArray< Size, Real > __cuda_callable__ Real lpNorm( const Real& p ) const; #ifdef HAVE_MIC __cuda_callable__ inline StaticVector< Size, Real >& operator=( const StaticVector< Size, Real >& vector ) { StaticArray< Size, Real >::operator=( vector ); return *this; } template< typename Vector > __cuda_callable__ inline StaticVector< Size, Real >& operator=( const Vector& vector ) { StaticArray< Size, Real >::operator=( vector ); return *this; } #endif }; template< typename Real > Loading @@ -107,8 +122,6 @@ class StaticVector< 1, Real > : public StaticArray< 1, Real > typedef StaticVector< 1, Real > ThisType; enum { size = 1 }; using StaticArray< 1, Real >::operator=; __cuda_callable__ StaticVector(); Loading Loading @@ -180,6 +193,23 @@ class StaticVector< 1, Real > : public StaticArray< 1, Real > __cuda_callable__ Real lpNorm( const Real& p ) const; #ifdef HAVE_MIC __cuda_callable__ inline StaticVector< 1, Real >& operator=( const StaticVector< 1, Real >& vector ) { StaticArray< 1, Real >::operator=( vector ); return *this; } template< typename Vector > __cuda_callable__ inline StaticVector< 1, Real >& operator=( const Vector& vector ) { StaticArray< 1, Real >::operator=( vector ); return *this; } #endif }; template< typename Real > Loading @@ -190,8 +220,6 @@ class StaticVector< 2, Real > : public StaticArray< 2, Real > typedef StaticVector< 2, Real > ThisType; enum { size = 2 }; using StaticArray< 2, Real >::operator=; __cuda_callable__ StaticVector(); Loading Loading @@ -266,6 +294,23 @@ class StaticVector< 2, Real > : public StaticArray< 2, Real > __cuda_callable__ Real lpNorm( const Real& p ) const; #ifdef HAVE_MIC __cuda_callable__ inline StaticVector< 2, Real >& operator=( const StaticVector< 2, Real >& vector ) { StaticArray< 2, Real >::operator=( vector ); return *this; } template< typename Vector > __cuda_callable__ inline StaticVector< 2, Real >& operator=( const Vector& vector ) { StaticArray< 2, Real >::operator=( vector ); return *this; } #endif }; template< typename Real > Loading @@ -276,8 +321,6 @@ class StaticVector< 3, Real > : public StaticArray< 3, Real > typedef StaticVector< 3, Real > ThisType; enum { size = 3 }; using StaticArray< 3, Real >::operator=; __cuda_callable__ StaticVector(); Loading Loading @@ -352,6 +395,23 @@ class StaticVector< 3, Real > : public StaticArray< 3, Real > __cuda_callable__ Real lpNorm( const Real& p ) const; #ifdef HAVE_MIC __cuda_callable__ inline StaticVector< 3, Real >& operator=( const StaticVector< 3, Real >& vector ) { StaticArray< 3, Real >::operator=( vector ); return *this; } template< typename Vector > __cuda_callable__ inline StaticVector< 3, Real >& operator=( const Vector& vector ) { StaticArray< 3, Real >::operator=( vector ); return *this; } #endif }; template< int Size, typename Real, typename Scalar > Loading
src/TNL/Functions/Analytic/SinBumpsSDF_impl.h +2 −2 Original line number Diff line number Diff line Loading @@ -86,7 +86,7 @@ getPartialDerivative( const PointType& v, const Real& time ) const { const RealType& x = v.x(); RealType xp = ::fabs( x ) + sign( x ) * this->phase.x() * this->waveLength.x() / ( 2.0*M_PI ); RealType xp = abs( x ) + sign( x ) * this->phase.x() * this->waveLength.x() / ( 2.0*M_PI ); if( this->wavesNumber.x() != 0.0 && xp > this->wavesNumber.x() * this->waveLength.x() ) return 0.0; if( YDiffOrder != 0 || ZDiffOrder != 0 ) Loading
src/TNL/Functions/Analytic/SinBumps_impl.h +6 −6 Original line number Diff line number Diff line Loading @@ -101,7 +101,7 @@ getPartialDerivative( const PointType& v, return 0.0; const RealType& x = v.x(); const RealType xp = ::fabs( x ) + sign( x ) * this->phase.x() * this->waveLength.x() / (2.0*M_PI); const RealType xp = abs( x ) + sign( x ) * this->phase.x() * this->waveLength.x() / (2.0*M_PI); if( this->wavesNumber.x() != 0.0 && xp > this->waveLength.x() * this->wavesNumber.x() ) return 0.0; Loading Loading @@ -162,8 +162,8 @@ getPartialDerivative( const PointType& v, const RealType& x = v.x(); const RealType& y = v.y(); const RealType xp = ::fabs( x ) + sign( x ) * this->phase.x() * this->waveLength.x() / (2.0*M_PI); const RealType yp = ::fabs( y ) + sign( y ) * this->phase.y() * this->waveLength.y() / (2.0*M_PI); const RealType xp = abs( x ) + sign( x ) * this->phase.x() * this->waveLength.x() / (2.0*M_PI); const RealType yp = abs( y ) + sign( y ) * this->phase.y() * this->waveLength.y() / (2.0*M_PI); //std::cerr << "this->wavesNumber.x() = " << this->wavesNumber.x() << "fabs( x ) = " << fabs( x ) << " 2.0*M_PI * this->waveLength.x() * this->wavesNumber.x() = " << 2.0*M_PI * this->waveLength.x() * this->wavesNumber.x() << std::endl; if( ( this->wavesNumber.x() != 0.0 && xp > this->waveLength.x() * this->wavesNumber.x() ) || ( this->wavesNumber.y() != 0.0 && yp > this->waveLength.y() * this->wavesNumber.y() ) ) Loading Loading @@ -235,9 +235,9 @@ getPartialDerivative( const PointType& v, const RealType& y = v.y(); const RealType& z = v.z(); const RealType xp = ::fabs( x ) + sign( x ) * this->phase.x() * this->waveLength.x() / (2.0*M_PI); const RealType yp = ::fabs( y ) + sign( y ) * this->phase.y() * this->waveLength.y() / (2.0*M_PI); const RealType zp = ::fabs( z ) + sign( z ) * this->phase.z() * this->waveLength.z() / (2.0*M_PI); const RealType xp = abs( x ) + sign( x ) * this->phase.x() * this->waveLength.x() / (2.0*M_PI); const RealType yp = abs( y ) + sign( y ) * this->phase.y() * this->waveLength.y() / (2.0*M_PI); const RealType zp = abs( z ) + sign( z ) * this->phase.z() * this->waveLength.z() / (2.0*M_PI); if( ( this->wavesNumber.x() != 0.0 && xp > this->waveLength.x() * this->wavesNumber.x() ) || ( this->wavesNumber.y() != 0.0 && yp > this->waveLength.y() * this->wavesNumber.y() ) || Loading
src/TNL/Math.h +2 −3 Original line number Diff line number Diff line Loading @@ -30,9 +30,8 @@ using both_integral_or_floating = typename std::conditional< // 1. If both types are integral or floating-point, the larger type is selected. // 2. If one type is integral and the other floating-point, the floating-point type is selected. // This is necessary only due to the limitations of nvcc. Note that clang and gcc // can handle automatic promotion using a single-type template, exactly like // std::min and std::max are implemented in STL. // Casting both arguments to the same type is necessary because std::min and std::max // are implemented as a single-type template. template< typename T1, typename T2 > using larger_type = typename std::conditional< ( both_integral_or_floating< T1, T2 >::value && sizeof(T1) >= sizeof(T2) ) || Loading