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

Fixing the semi-implicit heat-equation solver.

parent 5654ff80
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -67,6 +67,9 @@ class tnlVector : public tnlArray< Real, Device, Index >
   template< typename Vector >
   tnlVector< Real, Device, Index >& operator += ( const Vector& vector );

   // TODO: implement
   //tnlVector< Real, Device, Index >& operator *= ( const RealType& c );

   Real max() const;

   Real min() const;
+3 −3
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ updateLinearSystem( const RealType& time,
   columns[ 1 ] = index;
   columns[ 2 ] = mesh.getCellXSuccessor( index );
   values[ 0 ] = -lambdaX;
   values[ 1 ] = 1.0 + 2.0 * lambdaX;
   values[ 1 ] = 2.0 * lambdaX;
   values[ 2 ] = -lambdaX;
   rowLength = 3;
}
@@ -180,7 +180,7 @@ updateLinearSystem( const RealType& time,
   columns[ 4 ] = mesh.getCellYSuccessor( index );
   values[ 0 ] = -lambdaY;
   values[ 1 ] = -lambdaX;
   values[ 2 ] = 1.0 + 2.0 * ( lambdaX + lambdaY );
   values[ 2 ] = 2.0 * ( lambdaX + lambdaY );
   values[ 3 ] = -lambdaX;
   values[ 4 ] = -lambdaY;
   rowLength = 5;
@@ -282,7 +282,7 @@ updateLinearSystem( const RealType& time,
   values[ 0 ] = -lambdaZ;
   values[ 1 ] = -lambdaY;
   values[ 2 ] = -lambdaX;
   values[ 3 ] = 1.0 + 2.0 * ( lambdaX + lambdaY + lambdaZ );
   values[ 3 ] = 2.0 * ( lambdaX + lambdaY + lambdaZ );
   values[ 4 ] = -lambdaX;
   values[ 5 ] = -lambdaY;
   values[ 6 ] = -lambdaZ;
+1 −0
Original line number Diff line number Diff line
@@ -147,6 +147,7 @@ class tnlCSRMatrix : public tnlSparseMatrix< Real, Device, Index >
             typename OutVector >
   void vectorProduct( const InVector& inVector,
                       OutVector& outVector ) const;
   // TODO: add const RealType& multiplicator = 1.0 )

   template< typename Real2, typename Index2 >
   void addMatrix( const tnlCSRMatrix< Real2, Device, Index2 >& matrix,
+2 −1
Original line number Diff line number Diff line
@@ -4,7 +4,8 @@ ADD_SUBDIRECTORY( euler )

SET( headers tnlFiniteDifferences.h
             tnlDirichletBoundaryConditions.h
             tnlNeumannBoundaryConditions.h )
             tnlNeumannBoundaryConditions.h
             tnlExactOperatorEvaluator.h )

#SET( libtnlmeshincludedir ${TNL_INCLUDE_DIR}/operators )
#SET( libtnlmeshinclude_HEADERS ${headers} )
+8 −2
Original line number Diff line number Diff line
@@ -39,6 +39,8 @@ class tnlDirichletBoundaryConditions< tnlGrid< 1, MeshReal, Device, MeshIndex >,
   bool setup( const tnlParameterContainer& parameters,
               const tnlString& prefix = "" );

   void setFunction( const Function& function );

#ifdef HAVE_CUDA
   __device__ __host__
#endif
@@ -97,6 +99,8 @@ class tnlDirichletBoundaryConditions< tnlGrid< 2, MeshReal, Device, MeshIndex >,
   bool setup( const tnlParameterContainer& parameters,
              const tnlString& prefix = "" );

   void setFunction( const Function& function );

#ifdef HAVE_CUDA
   __device__ __host__
#endif
@@ -156,6 +160,8 @@ class tnlDirichletBoundaryConditions< tnlGrid< 3, MeshReal, Device, MeshIndex >,
   bool setup( const tnlParameterContainer& parameters,
               const tnlString& prefix = "" );

   void setFunction( const Function& function );

#ifdef HAVE_CUDA
   __device__ __host__
#endif
Loading