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

Fixing the semi-implicit solver with almost all matrix formats.

parent abc968eb
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -30,6 +30,9 @@
#include <matrices/tnlEllpackMatrix.h>
#include "heatEquationSolver.h"

#include <matrices/tnlSlicedEllpackMatrix.h>
#include <matrices/tnlDenseMatrix.h>


template< typename Mesh,
          typename DifferentialOperator,
@@ -44,7 +47,7 @@ class heatEquationSolver
   typedef typename DifferentialOperator::IndexType IndexType;
   typedef Mesh MeshType;
   typedef tnlVector< RealType, DeviceType, IndexType> DofVectorType;
   typedef tnlCSRMatrix< RealType, DeviceType, IndexType > MatrixType;
   typedef tnlSlicedEllpackMatrix< RealType, DeviceType, IndexType > MatrixType;
   typedef typename MatrixType::RowLengthsVector RowLengthsVectorType;

   static tnlString getTypeStatic();
+4 −2
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@

#include <core/mfilename.h>
#include <matrices/tnlMatrixSetter.h>
#include <matrices/tnlMultidiagonalMatrixSetter.h>
#include "heatEquationSolver.h"


@@ -163,6 +164,7 @@ setupLinearSystem( const MeshType& mesh,
   if( ! matrix.setRowLengths( rowLengths ) )
      return false;
   return true;
   //return tnlMultidiagonalMatrixSetter< Mesh >::setupMatrix( mesh, matrix );
}

template< typename Mesh,
@@ -268,8 +270,8 @@ assemblyLinearSystem( const RealType& time,
                                                          b );
   /*matrix.print( cout );
   cout << endl << b << endl;
   cout << endl << u << endl;*/
   //abort();
   cout << endl << u << endl;
   abort();*/
}

template< typename Mesh,
+1 −0
Original line number Diff line number Diff line
@@ -391,5 +391,6 @@ bool tnlCuda::checkDevice( const char* file_name, int line )
       break;

   }
   throw EXIT_FAILURE;
   return false;
}
+2 −32
Original line number Diff line number Diff line
@@ -152,6 +152,7 @@ template< typename Real,
tnlSharedVector< Real, Device, Index >& tnlSharedVector< Real, Device, Index > :: operator -= ( const Vector& vector )
{
   alphaXPlusBetaY( -1.0, vector, 1.0 );
   return ( *this );
}

template< typename Real,
@@ -161,40 +162,9 @@ template< typename Real,
tnlSharedVector< Real, Device, Index >& tnlSharedVector< Real, Device, Index > :: operator += ( const Vector& vector )
{
   alphaXPlusBetaY( 1.0, vector, 1.0 );
   return ( *this );
}

/*template< typename Element,
          typename Device,
          typename Index >
bool tnlSharedVector< Element, Device, Index > :: save( tnlFile& file ) const
{
   tnlAssert( this -> size != 0,
              cerr << "You try to save empty vector. Its name is " << this -> getName() );
   if( ! tnlObject :: save( file ) )
      return false;
#ifdef HAVE_NOT_CXX11
   if( ! file. write< const Index, Device >( &this -> size ) )
#else               
   if( ! file. write( &this -> size ) )
#endif      
      return false;
   if( ! file. write< Element, Device, Index >( this -> data, this -> size ) )
   {
      cerr << "I was not able to SAVE tnlSharedVector " << this -> getName()
           << " with size " << this -> getSize() << endl;
      return false;
   }
   return true;
};

template< typename Element,
          typename Device,
          typename Index >
bool tnlSharedVector< Element, Device, Index > :: save( const tnlString& fileName ) const
{
   return tnlObject :: save( fileName );
};*/

template< typename Real,
          typename Device,
          typename Index >
+5 −1
Original line number Diff line number Diff line
@@ -9,7 +9,11 @@ SET( headers tnlMatrix_impl.h
             tnlCSRMatrix_impl.h
             tnlMatrixReader_impl.h
             tnlMatrixWriter_impl.h
             tnlMatrixSetter_impl.h )
             tnlMatrixSetter_impl.h
             tnlSparseMatrixRow_impl.h
             tnlDenseMatrixRow_impl.h
             tnlTridiagonalMatrixRow_impl.h
             tnlMultidiagonalMatrixSetter_impl.h )

SET( CURRENT_DIR ${CMAKE_SOURCE_DIR}/src/implementation/matrices )
set( common_SOURCES
Loading