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

Fixing use of MatrixRow in matrxi assembler.

parent b3bf74e8
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ template< typename MeshReal,
          typename MeshIndex,
          typename Real,
          typename Index >
   template< typename Vector, typename MatrixRow >
   template< typename Vector, typename Matrix >
__cuda_callable__
void
tnlLinearDiffusion< tnlGrid< 1, MeshReal, Device, MeshIndex >, Real, Index >::
@@ -87,8 +87,9 @@ updateLinearSystem( const RealType& time,
                    const CoordinatesType& coordinates,
                    Vector& u,
                    Vector& b,
                    MatrixRow& matrixRow ) const
                    Matrix& matrix ) const
{
   typename Matrix::MatrixRow matrixRow = matrix.getRow( index );
   const RealType lambdaX = tau * mesh.getHxSquareInverse();
   //printf( "tau = %f lambda = %f dx_sqr = %f dx = %f, \n", tau, lambdaX, mesh.getHxSquareInverse(), mesh.getHx() );
   matrixRow.setElement( 0, mesh.template getCellNextToCell< -1 >( index ),     - lambdaX );
@@ -156,7 +157,7 @@ template< typename MeshReal,
          typename MeshIndex,
          typename Real,
          typename Index >
   template< typename Vector, typename MatrixRow >
   template< typename Vector, typename Matrix >
__cuda_callable__
void
tnlLinearDiffusion< tnlGrid< 2, MeshReal, Device, MeshIndex >, Real, Index >::
@@ -167,8 +168,9 @@ updateLinearSystem( const RealType& time,
                    const CoordinatesType& coordinates,
                    Vector& u,
                    Vector& b,
                    MatrixRow& matrixRow ) const
                    Matrix& matrix ) const
{
   typename Matrix::MatrixRow matrixRow = matrix.getRow( index );
   const RealType lambdaX = tau * mesh.getHxSquareInverse();
   const RealType lambdaY = tau * mesh.getHySquareInverse();
   matrixRow.setElement( 0, mesh.template getCellNextToCell< 0, -1 >( index ), -lambdaY );
@@ -240,7 +242,7 @@ template< typename MeshReal,
          typename MeshIndex,
          typename Real,
          typename Index >
   template< typename Vector, typename MatrixRow >
   template< typename Vector, typename Matrix >
__cuda_callable__
void
tnlLinearDiffusion< tnlGrid< 3, MeshReal, Device, MeshIndex >, Real, Index >::
@@ -251,8 +253,9 @@ updateLinearSystem( const RealType& time,
                    const CoordinatesType& coordinates,
                    Vector& u,
                    Vector& b,
                    MatrixRow& matrixRow ) const
                    Matrix& matrix ) const
{
   typename Matrix::MatrixRow matrixRow = matrix.getRow( index );
   const RealType lambdaX = tau * mesh.getHxSquareInverse();
   const RealType lambdaY = tau * mesh.getHySquareInverse();
   const RealType lambdaZ = tau * mesh.getHzSquareInverse();
+3 −2
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ template< int Dimensions,
          typename Function,
          typename Real,
          typename Index >
   template< typename MatrixRow >          
   template< typename Matrix >          
__cuda_callable__
void
tnlAnalyticDirichletBoundaryConditions< tnlGrid< Dimensions, MeshReal, Device, MeshIndex >, Function, Real, Index >::
@@ -145,8 +145,9 @@ updateLinearSystem( const RealType& time,
                    const CoordinatesType& coordinates,
                    DofVectorType& u,
                    DofVectorType& b,
                    MatrixRow& matrixRow ) const
                    Matrix& matrix ) const
{
   typename Matrix::MatrixRow matrixRow = matrix.getRow( index );
   matrixRow.setElement( 0, index, 1.0 );
   b[ index ] = function.getValue( mesh.template getCellCenter< VertexType >( coordinates ), time );
}
+9 −6
Original line number Diff line number Diff line
@@ -112,7 +112,7 @@ template< typename MeshReal,
          typename Function,
          typename Real,
          typename Index >
   template< typename MatrixRow >
   template< typename Matrix >
__cuda_callable__
void
tnlAnalyticNeumannBoundaryConditions< tnlGrid< 1, MeshReal, Device, MeshIndex >, Function, Real, Index >::
@@ -122,8 +122,9 @@ updateLinearSystem( const RealType& time,
                    const CoordinatesType& coordinates,
                    DofVectorType& u,
                    DofVectorType& b,
                    MatrixRow& matrixRow ) const
                    Matrix& matrix ) const
{
   typename Matrix::MatrixRow matrixRow = matrix.getRow( index );
   const Real functionValue = this->function.getValue( mesh.template getCellCenter< VertexType >( coordinates ), time );
   if( coordinates.x() == 0 )
   {
@@ -205,7 +206,7 @@ template< typename MeshReal,
          typename Function,
          typename Real,
          typename Index >
   template< typename MatrixRow >
   template< typename Matrix >
__cuda_callable__
void
tnlAnalyticNeumannBoundaryConditions< tnlGrid< 2, MeshReal, Device, MeshIndex >, Function, Real, Index >::
@@ -215,8 +216,9 @@ updateLinearSystem( const RealType& time,
                    const CoordinatesType& coordinates,
                    DofVectorType& u,
                    DofVectorType& b,
                    MatrixRow& matrixRow ) const
                    Matrix& matrix ) const
{
   typename Matrix::MatrixRow matrixRow = matrix.getRow( index );
   const Real functionValue = this->function.getValue( mesh.template getCellCenter< VertexType >( coordinates ), time );
   if( coordinates.x() == 0 )
   {
@@ -320,7 +322,7 @@ template< typename MeshReal,
          typename Function,
          typename Real,
          typename Index >
   template< typename MatrixRow >
   template< typename Matrix >
__cuda_callable__
void
tnlAnalyticNeumannBoundaryConditions< tnlGrid< 3, MeshReal, Device, MeshIndex >, Function, Real, Index >::
@@ -330,8 +332,9 @@ updateLinearSystem( const RealType& time,
                    const CoordinatesType& coordinates,
                    DofVectorType& u,
                    DofVectorType& b,
                    MatrixRow& matrixRow ) const
                    Matrix& matrix ) const
{
   typename Matrix::MatrixRow matrixRow = matrix.getRow( index );
   const Real functionValue = this->function.getValue( mesh.template getCellCenter< VertexType >( coordinates ), time );
   if( coordinates.x() == 0 )
   {
+3 −2
Original line number Diff line number Diff line
@@ -128,7 +128,7 @@ template< int Dimensions,
          typename Vector,
          typename Real,
          typename Index >
   template< typename MatrixRow >
   template< typename Matrix >
__cuda_callable__
void
tnlDirichletBoundaryConditions< tnlGrid< Dimensions, MeshReal, Device, MeshIndex >, Vector, Real, Index >::
@@ -138,8 +138,9 @@ updateLinearSystem( const RealType& time,
                    const CoordinatesType& coordinates,
                    DofVectorType& u,
                    DofVectorType& b,
                    MatrixRow& matrixRow ) const
                    Matrix& matrix ) const
{
   typename Matrix::MatrixRow matrixRow = matrix.getRow( index );
   matrixRow.setElement( 0, index, 1.0 );
   b[ index ] = this->vector[ index ];
}
+9 −6
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ template< typename MeshReal,
          typename Vector,
          typename Real,
          typename Index >
   template< typename MatrixRow >
   template< typename Matrix >
__cuda_callable__
void
tnlNeumannBoundaryConditions< tnlGrid< 1, MeshReal, Device, MeshIndex >, Vector, Real, Index >::
@@ -99,8 +99,9 @@ updateLinearSystem( const RealType& time,
                    const CoordinatesType& coordinates,
                    DofVectorType& u,
                    DofVectorType& b,
                    MatrixRow& matrixRow ) const
                    Matrix& matrix ) const
{
   typename Matrix::MatrixRow matrixRow = matrix.getRow( index );
   if( coordinates.x() == 0 )
   {
      matrixRow.setElement( 0, index, 1.0 );
@@ -179,7 +180,7 @@ template< typename MeshReal,
          typename Vector,
          typename Real,
          typename Index >
   template< typename MatrixRow >
   template< typename Matrix >
__cuda_callable__
void
tnlNeumannBoundaryConditions< tnlGrid< 2, MeshReal, Device, MeshIndex >, Vector, Real, Index >::
@@ -189,8 +190,9 @@ updateLinearSystem( const RealType& time,
                    const CoordinatesType& coordinates,
                    DofVectorType& u,
                    DofVectorType& b,
                    MatrixRow& matrixRow ) const
                    Matrix& matrix ) const
{
   typename Matrix::MatrixRow matrixRow = matrix.getRow( index );
   if( coordinates.x() == 0 )
   {
      matrixRow.setElement( 0, index,                            1.0 );
@@ -291,7 +293,7 @@ template< typename MeshReal,
          typename Vector,
          typename Real,
          typename Index >
   template< typename MatrixRow >
   template< typename Matrix >
__cuda_callable__
void
tnlNeumannBoundaryConditions< tnlGrid< 3, MeshReal, Device, MeshIndex >, Vector, Real, Index >::
@@ -301,8 +303,9 @@ updateLinearSystem( const RealType& time,
                    const CoordinatesType& coordinates,
                    DofVectorType& u,
                    DofVectorType& b,
                    MatrixRow& matrixRow ) const
                    Matrix& matrix ) const
{
   typename Matrix::MatrixRow matrixRow = matrix.getRow( index );
   if( coordinates.x() == 0 )
   {
      matrixRow.setElement( 0, index,                            1.0 );
Loading