Loading examples/heat-equation/heatEquationSolver_impl.h +12 −5 Original line number Diff line number Diff line Loading @@ -125,8 +125,8 @@ bindAuxiliaryDofs( const MeshType& mesh, template< typename Mesh, typename DifferentialOperator, typename BoundaryCondition, typename RightHandSide > bool heatEquationSolver< Mesh, DifferentialOperator, BoundaryCondition, RightHandSide > :: setInitialCondition( const tnlParameterContainer& parameters, bool heatEquationSolver< Mesh, DifferentialOperator, BoundaryCondition, RightHandSide >:: setInitialCondition( const tnlParameterContainer& parameters, const MeshType& mesh, DofVectorType& dofs ) { Loading @@ -149,13 +149,19 @@ heatEquationSolver< Mesh, DifferentialOperator, BoundaryCondition, RightHandSide setupLinearSystem( const MeshType& mesh, MatrixType& matrix ) { const IndexType dofs = this->getDofs( mesh ); RowLengthsVectorType rowLengths; if( ! rowLengths.setSize( dofs ) ) return false; tnlMatrixSetter< MeshType, DifferentialOperator, BoundaryCondition, RowLengthsVectorType > matrixSetter; matrixSetter.template getRowLengths< Mesh::Dimensions >( mesh, differentialOperator, boundaryCondition, rowLengths ); matrix.setRowLengths( rowLengths ); matrix.setDimensions( dofs, dofs ); if( ! matrix.setRowLengths( rowLengths ) ) return false; return true; } template< typename Mesh, Loading Loading @@ -226,7 +232,7 @@ assemblyLinearSystem( const RealType& time, DofVectorType& b ) { tnlLinearSystemAssembler< Mesh, DofVectorType, DifferentialOperator, BoundaryCondition, RightHandSide, MatrixType > systemAssembler; /*systemAssembler.template assembly< Mesh::Dimensions >( time, systemAssembler.template assembly< Mesh::Dimensions >( time, tau, mesh, this->differentialOperator, Loading @@ -235,7 +241,8 @@ assemblyLinearSystem( const RealType& time, u, matrix, b ); */ //matrix.print( cout ); //abort(); } template< typename Mesh, Loading examples/heat-equation/tnlHeatEquationEocRhs.h +1 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ class tnlHeatEquationEocRhs template< typename Vertex, typename Real > Real getValue( const Vertex& vertex, const Real& time ) const Real& time ) const { return testFunction.getTimeDerivative( vertex, time ) - exactOperator.getValue( testFunction, vertex, time ); Loading src/config/tnlParameterContainer.h +2 −1 Original line number Diff line number Diff line Loading @@ -89,7 +89,8 @@ class tnlParameterContainer for( i = 0; i < size; i ++ ) if( parameters[ i ] -> name == name ) return ( ( tnlParameter< T >* ) parameters[ i ] ) -> value; cerr << "Unknown parameter " << name << endl; cerr << "The program attempts to get unknown parameter " << name << endl; cerr << "Aborting the program." << endl; abort(); } Loading src/implementation/matrices/tnlCSRMatrix_impl.h +3 −0 Original line number Diff line number Diff line Loading @@ -77,11 +77,14 @@ bool tnlCSRMatrix< Real, Device, Index >::setRowLengths( const RowLengthsVector& * necessary length of the vectors this->values * and this->columnIndexes. */ tnlAssert( this->getRows() > 0, ); tnlAssert( this->getColumns() > 0, ); tnlSharedVector< IndexType, DeviceType, IndexType > rowPtrs; rowPtrs.bind( this->rowPointers.getData(), this->getRows() ); rowPtrs = rowLengths; this->rowPointers.setElement( this->rows, 0 ); this->rowPointers.computeExclusivePrefixSum(); this->maxRowLength = rowLengths.max(); /**** * Allocate values and column indexes Loading src/implementation/matrices/tnlChunkedEllpackMatrix_impl.h +3 −0 Original line number Diff line number Diff line Loading @@ -219,6 +219,8 @@ template< typename Real, typename Index > bool tnlChunkedEllpackMatrix< Real, Device, Index >::setRowLengths( const RowLengthsVector& rowLengths ) { tnlAssert( this->getRows() > 0, ); tnlAssert( this->getColumns() > 0, ); IndexType elementsToAllocation( 0 ); Loading Loading @@ -252,6 +254,7 @@ bool tnlChunkedEllpackMatrix< Real, Device, Index >::setRowLengths( const RowLen this->numberOfSlices = hostMatrix.numberOfSlices; elementsToAllocation = hostMatrix.values.getSize(); } this->maxRowLength = rowLengths.max(); return tnlSparseMatrix< Real, Device, Index >::allocateMatrixElements( elementsToAllocation ); } Loading Loading
examples/heat-equation/heatEquationSolver_impl.h +12 −5 Original line number Diff line number Diff line Loading @@ -125,8 +125,8 @@ bindAuxiliaryDofs( const MeshType& mesh, template< typename Mesh, typename DifferentialOperator, typename BoundaryCondition, typename RightHandSide > bool heatEquationSolver< Mesh, DifferentialOperator, BoundaryCondition, RightHandSide > :: setInitialCondition( const tnlParameterContainer& parameters, bool heatEquationSolver< Mesh, DifferentialOperator, BoundaryCondition, RightHandSide >:: setInitialCondition( const tnlParameterContainer& parameters, const MeshType& mesh, DofVectorType& dofs ) { Loading @@ -149,13 +149,19 @@ heatEquationSolver< Mesh, DifferentialOperator, BoundaryCondition, RightHandSide setupLinearSystem( const MeshType& mesh, MatrixType& matrix ) { const IndexType dofs = this->getDofs( mesh ); RowLengthsVectorType rowLengths; if( ! rowLengths.setSize( dofs ) ) return false; tnlMatrixSetter< MeshType, DifferentialOperator, BoundaryCondition, RowLengthsVectorType > matrixSetter; matrixSetter.template getRowLengths< Mesh::Dimensions >( mesh, differentialOperator, boundaryCondition, rowLengths ); matrix.setRowLengths( rowLengths ); matrix.setDimensions( dofs, dofs ); if( ! matrix.setRowLengths( rowLengths ) ) return false; return true; } template< typename Mesh, Loading Loading @@ -226,7 +232,7 @@ assemblyLinearSystem( const RealType& time, DofVectorType& b ) { tnlLinearSystemAssembler< Mesh, DofVectorType, DifferentialOperator, BoundaryCondition, RightHandSide, MatrixType > systemAssembler; /*systemAssembler.template assembly< Mesh::Dimensions >( time, systemAssembler.template assembly< Mesh::Dimensions >( time, tau, mesh, this->differentialOperator, Loading @@ -235,7 +241,8 @@ assemblyLinearSystem( const RealType& time, u, matrix, b ); */ //matrix.print( cout ); //abort(); } template< typename Mesh, Loading
examples/heat-equation/tnlHeatEquationEocRhs.h +1 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ class tnlHeatEquationEocRhs template< typename Vertex, typename Real > Real getValue( const Vertex& vertex, const Real& time ) const Real& time ) const { return testFunction.getTimeDerivative( vertex, time ) - exactOperator.getValue( testFunction, vertex, time ); Loading
src/config/tnlParameterContainer.h +2 −1 Original line number Diff line number Diff line Loading @@ -89,7 +89,8 @@ class tnlParameterContainer for( i = 0; i < size; i ++ ) if( parameters[ i ] -> name == name ) return ( ( tnlParameter< T >* ) parameters[ i ] ) -> value; cerr << "Unknown parameter " << name << endl; cerr << "The program attempts to get unknown parameter " << name << endl; cerr << "Aborting the program." << endl; abort(); } Loading
src/implementation/matrices/tnlCSRMatrix_impl.h +3 −0 Original line number Diff line number Diff line Loading @@ -77,11 +77,14 @@ bool tnlCSRMatrix< Real, Device, Index >::setRowLengths( const RowLengthsVector& * necessary length of the vectors this->values * and this->columnIndexes. */ tnlAssert( this->getRows() > 0, ); tnlAssert( this->getColumns() > 0, ); tnlSharedVector< IndexType, DeviceType, IndexType > rowPtrs; rowPtrs.bind( this->rowPointers.getData(), this->getRows() ); rowPtrs = rowLengths; this->rowPointers.setElement( this->rows, 0 ); this->rowPointers.computeExclusivePrefixSum(); this->maxRowLength = rowLengths.max(); /**** * Allocate values and column indexes Loading
src/implementation/matrices/tnlChunkedEllpackMatrix_impl.h +3 −0 Original line number Diff line number Diff line Loading @@ -219,6 +219,8 @@ template< typename Real, typename Index > bool tnlChunkedEllpackMatrix< Real, Device, Index >::setRowLengths( const RowLengthsVector& rowLengths ) { tnlAssert( this->getRows() > 0, ); tnlAssert( this->getColumns() > 0, ); IndexType elementsToAllocation( 0 ); Loading Loading @@ -252,6 +254,7 @@ bool tnlChunkedEllpackMatrix< Real, Device, Index >::setRowLengths( const RowLen this->numberOfSlices = hostMatrix.numberOfSlices; elementsToAllocation = hostMatrix.values.getSize(); } this->maxRowLength = rowLengths.max(); return tnlSparseMatrix< Real, Device, Index >::allocateMatrixElements( elementsToAllocation ); } Loading