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

Fixing the function enumerator.

parent 928da0bf
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -47,7 +47,6 @@ class tnlCublasWrapper< float, float, Index >
            cublasCreate( &handle );
            cublasSdot( handle, size, v1, 1, v2, 1, &result );
            cublasDestroy( handle );
            cerr<< "~~~~~~~~~~~~~~~" << endl;
            return false;
        }        
};
@@ -62,7 +61,6 @@ class tnlCublasWrapper< double, double, Index >
            cublasCreate( &handle );
            cublasDdot( handle, size, v1, 1, v2, 1, &result );
            cublasDestroy( handle );
            cerr<< "~~~~~~~~~~~~~~~" << endl;
            return false;
        }        
};
+0 −1
Original line number Diff line number Diff line
@@ -352,7 +352,6 @@ typename Vector1 :: RealType tnlVectorOperations< tnlCuda > :: getScalarProduct(

   Real result( 0 );
#if defined HAVE_CUBLAS && defined HAVE_CUDA
   cerr << endl << "##############" << endl;
   if( tnlCublasWrapper< typename Vector1::RealType,
                         typename Vector2::RealType,
                         typename Vector1::IndexType >::dot( v1.getData(), v1.getData(), v1.getSize(), result ) )
+43 −20
Original line number Diff line number Diff line
@@ -86,6 +86,13 @@ class tnlFunctionEnumerator
                                       const IndexType index )
            {
               typedef tnlFunctionAdapter< MeshType, Function > FunctionAdapter;
               if( ! *userData.dofVectorCoefficient  )
                  ( *userData.u )[ index ] =
                     ( *userData.functionCoefficient ) * FunctionAdapter::getValue( mesh,
                                                                                    *userData.function,
                                                                                    index,
                                                                                    *userData.time );
               else                                                                                            
                 ( *userData.u )[ index ] =
                             ( *userData.dofVectorCoefficient ) * ( *userData.u )[ index ] +
                             ( *userData.functionCoefficient ) * FunctionAdapter::getValue( mesh,
@@ -142,6 +149,14 @@ class tnlFunctionEnumerator< tnlGrid< Dimensions, Real, Device, Index >,
            {
               //printf( "Enumerator::processCell mesh =%p \n", &mesh );
               typedef tnlFunctionAdapter< MeshType, Function > FunctionAdapter;
               if( ! ( *userData.dofVectorCoefficient ) )
                  ( *userData.u )[ index ] =
                     ( *userData.functionCoefficient ) * FunctionAdapter::getValue( mesh,
                                                                                    *userData.function,
                                                                                    index,
                                                                                    coordinates,
                                                                                    *userData.time );
               else
                  ( *userData.u )[ index ] =
                           ( *userData.dofVectorCoefficient ) * ( *userData.u )[ index ] +
                           ( *userData.functionCoefficient ) * FunctionAdapter::getValue( mesh,
@@ -161,6 +176,14 @@ class tnlFunctionEnumerator< tnlGrid< Dimensions, Real, Device, Index >,
                                     const CoordinatesType& coordinates )
            {
               typedef tnlFunctionAdapter< MeshType, Function > FunctionAdapter;
               if( ! ( *userData.dofVectorCoefficient ) )
                  ( *userData.u )[ index ] =
                     ( *userData.functionCoefficient ) * FunctionAdapter::getValue( mesh,
                                                                                    *userData.function,
                                                                                    index,
                                                                                    coordinates,
                                                                                    *userData.time );
               else
                  ( *userData.u )[ index ] =
                           ( *userData.dofVectorCoefficient ) * ( *userData.u )[ index ] +
                           ( *userData.functionCoefficient ) * FunctionAdapter::getValue( mesh,
+4 −0
Original line number Diff line number Diff line
@@ -239,6 +239,7 @@ class tnlLinearSystemAssembler< tnlGrid< Dimensions, Real, Device, Index >,
                                  const CoordinatesType& coordinates )
         {
            //printf( "index = %d \n", index );
             ( *userData.b )[ index ] = 0.0;
            typename MatrixType::MatrixRow matrixRow = userData.matrix->getRow( index );
            userData.boundaryConditions->updateLinearSystem( *userData.time,
                                                             mesh,
@@ -259,6 +260,7 @@ class tnlLinearSystemAssembler< tnlGrid< Dimensions, Real, Device, Index >,
         {
            //printf( "index = %d \n", index );
            // printf("Matrix assembler: Index = %d \n", index );
            ( *userData.b )[ index ] = 0.0;
            typename MatrixType::MatrixRow matrixRow = userData.matrix->getRow( index );
            userData.boundaryConditions->updateLinearSystem( *userData.time,
                                                             mesh,
@@ -267,6 +269,7 @@ class tnlLinearSystemAssembler< tnlGrid< Dimensions, Real, Device, Index >,
                                                             *userData.u,
                                                             *userData.b,
                                                             matrixRow );
            //printf( "BC: index = %d, b = %f \n", index, ( *userData.b )[ index ] );
         }


@@ -324,6 +327,7 @@ class tnlLinearSystemAssembler< tnlGrid< Dimensions, Real, Device, Index >,
                                                         ( *userData.u )[ index ],
                                                         ( *userData.tau ),
                                                         rhs );
            //printf( "IC: index = %d, b = %f \n", index, ( *userData.b )[ index ] );
         }

#ifdef HAVE_CUDA