From 3652aaf535c56d7f9b526ae58e69e0fb00718a36 Mon Sep 17 00:00:00 2001 From: "Automatic Deployment (GitHub Action)" Date: Mon, 22 Jan 2024 19:50:28 +0000 Subject: [PATCH] Documentation Update --- ...HypreSemiStructuredSolver_8hpp_source.html | 1653 +++++----- ...id__HypreStructuredSolver_8hpp_source.html | 2735 +++++++++-------- ...id_1_1HypreSemiStructBiCGSTAB-members.html | 6 +- ...na_1_1Grid_1_1HypreSemiStructBiCGSTAB.html | 89 +- ...id_1_1HypreSemiStructDiagonal-members.html | 75 +- ...na_1_1Grid_1_1HypreSemiStructDiagonal.html | 89 +- ...1Grid_1_1HypreSemiStructGMRES-members.html | 6 +- ...abana_1_1Grid_1_1HypreSemiStructGMRES.html | 89 +- ...1_1Grid_1_1HypreSemiStructPCG-members.html | 6 +- ...sCabana_1_1Grid_1_1HypreSemiStructPCG.html | 89 +- ..._1_1HypreSemiStructuredSolver-members.html | 71 +- ..._1_1Grid_1_1HypreSemiStructuredSolver.html | 62 +- ..._1Grid_1_1HypreStructBiCGSTAB-members.html | 6 +- ...Cabana_1_1Grid_1_1HypreStructBiCGSTAB.html | 70 +- ..._1Grid_1_1HypreStructDiagonal-members.html | 69 +- ...Cabana_1_1Grid_1_1HypreStructDiagonal.html | 70 +- ...a_1_1Grid_1_1HypreStructGMRES-members.html | 6 +- ...assCabana_1_1Grid_1_1HypreStructGMRES.html | 70 +- ..._1_1Grid_1_1HypreStructJacobi-members.html | 6 +- ...ssCabana_1_1Grid_1_1HypreStructJacobi.html | 70 +- ...ana_1_1Grid_1_1HypreStructPCG-members.html | 6 +- ...classCabana_1_1Grid_1_1HypreStructPCG.html | 70 +- ...na_1_1Grid_1_1HypreStructPFMG-members.html | 6 +- ...lassCabana_1_1Grid_1_1HypreStructPFMG.html | 70 +- ...ana_1_1Grid_1_1HypreStructSMG-members.html | 6 +- ...classCabana_1_1Grid_1_1HypreStructSMG.html | 70 +- ...Grid_1_1HypreStructuredSolver-members.html | 65 +- ...bana_1_1Grid_1_1HypreStructuredSolver.html | 62 +- doxygen/functions.html | 5 +- doxygen/functions_a.html | 4 +- doxygen/functions_b.html | 3 +- doxygen/functions_func_b.html | 2 +- doxygen/functions_func_s.html | 4 +- doxygen/functions_s.html | 4 +- doxygen/functions_type_b.html | 3 +- doxygen/functions_vars.html | 5 +- doxygen/search/all_0.js | 57 +- doxygen/search/all_1.js | 39 +- doxygen/search/all_13.js | 4 +- doxygen/search/all_2.js | 74 +- doxygen/search/all_7.js | 29 +- doxygen/search/functions_0.js | 4 +- doxygen/search/functions_1.js | 4 +- doxygen/search/functions_12.js | 4 +- doxygen/search/functions_6.js | 4 +- doxygen/search/typedefs_1.js | 11 +- doxygen/search/variables_0.js | 57 +- 47 files changed, 3037 insertions(+), 2972 deletions(-) diff --git a/doxygen/Cabana__Grid__HypreSemiStructuredSolver_8hpp_source.html b/doxygen/Cabana__Grid__HypreSemiStructuredSolver_8hpp_source.html index 677464e5f..d8f02f8ab 100644 --- a/doxygen/Cabana__Grid__HypreSemiStructuredSolver_8hpp_source.html +++ b/doxygen/Cabana__Grid__HypreSemiStructuredSolver_8hpp_source.html @@ -238,37 +238,37 @@
168 _stencil_index.resize( n_vars,
169 std::vector<unsigned>( n_vars + 1 ) );
170
-
171 error = HYPRE_SStructVectorCreate( _comm, _grid, &_b );
+
171 error = HYPRE_SStructVectorCreate( _comm, _grid, &_b );
172 checkHypreError( error );
-
173 error = HYPRE_SStructVectorSetObjectType( _b, object_type );
+
173 error = HYPRE_SStructVectorSetObjectType( _b, object_type );
174 checkHypreError( error );
-
175 error = HYPRE_SStructVectorInitialize( _b );
+
175 error = HYPRE_SStructVectorInitialize( _b );
176 checkHypreError( error );
177 for ( int i = 0; i < n_vars; ++i )
178 {
179 error = HYPRE_SStructVectorSetBoxValues(
-
180 _b, part, _lower.data(), _upper.data(), i,
+
180 _b, part, _lower.data(), _upper.data(), i,
181 vector_values.data() );
182 checkHypreError( error );
183 }
-
184 error = HYPRE_SStructVectorAssemble( _b );
+
184 error = HYPRE_SStructVectorAssemble( _b );
185 checkHypreError( error );
186
-
187 error = HYPRE_SStructVectorCreate( _comm, _grid, &_x );
+
187 error = HYPRE_SStructVectorCreate( _comm, _grid, &_x );
188 checkHypreError( error );
-
189 error = HYPRE_SStructVectorSetObjectType( _x, object_type );
+
189 error = HYPRE_SStructVectorSetObjectType( _x, object_type );
190 checkHypreError( error );
-
191 error = HYPRE_SStructVectorInitialize( _x );
+
191 error = HYPRE_SStructVectorInitialize( _x );
192 checkHypreError( error );
193 for ( int i = 0; i < n_vars; ++i )
194 {
195 error = HYPRE_SStructVectorSetBoxValues(
-
196 _x, part, _lower.data(), _upper.data(), i,
+
196 _x, part, _lower.data(), _upper.data(), i,
197 vector_values.data() );
198 checkHypreError( error );
199 }
200 checkHypreError( error );
-
201 error = HYPRE_SStructVectorAssemble( _x );
+
201 error = HYPRE_SStructVectorAssemble( _x );
202 checkHypreError( error );
203 }
204 }
@@ -280,9 +280,9 @@
209 // We only make data if this is not a preconditioner.
210 if ( !_is_preconditioner )
211 {
-
212 HYPRE_SStructVectorDestroy( _x );
-
213 HYPRE_SStructVectorDestroy( _b );
-
214 HYPRE_SStructMatrixDestroy( _A );
+
212 HYPRE_SStructVectorDestroy( _x );
+
213 HYPRE_SStructVectorDestroy( _b );
+
214 HYPRE_SStructMatrixDestroy( _A );
215 for ( std::size_t i = 0; i < _stencils.size(); ++i )
216 {
217 HYPRE_SStructStencilDestroy( _stencils[i] );
@@ -380,15 +380,15 @@
329 checkHypreError( error );
330
331 // Create the matrix. must be done after graph is assembled
-
332 error = HYPRE_SStructMatrixCreate( _comm, _graph, &_A );
+
332 error = HYPRE_SStructMatrixCreate( _comm, _graph, &_A );
333 checkHypreError( error );
334
335 // Set the SStruct matrix object type
-
336 error = HYPRE_SStructMatrixSetObjectType( _A, object_type );
+
336 error = HYPRE_SStructMatrixSetObjectType( _A, object_type );
337 checkHypreError( error );
338
339 // Prepare the matrix for setting values
-
340 error = HYPRE_SStructMatrixInitialize( _A );
+
340 error = HYPRE_SStructMatrixInitialize( _A );
341 checkHypreError( error );
342 }
@@ -451,7 +451,7 @@
410 int start = _stencil_index[v_h][v_x];
411 std::iota( indices.begin(), indices.end(), start );
412 auto error = HYPRE_SStructMatrixSetBoxValues(
-
413 _A, part, _lower.data(), _upper.data(), v_h, indices.size(),
+
413 _A, part, _lower.data(), _upper.data(), v_h, indices.size(),
414 indices.data(), a_values.data() );
415 checkHypreError( error );
416 }
@@ -460,21 +460,21 @@
422 void printMatrix( const char* prefix )
423 {
-
424 HYPRE_SStructMatrixPrint( prefix, _A, 0 );
+
424 HYPRE_SStructMatrixPrint( prefix, _A, 0 );
425 }
426
431 void printLHS( const char* prefix )
432 {
-
433 HYPRE_SStructVectorPrint( prefix, _x, 0 );
+
433 HYPRE_SStructVectorPrint( prefix, _x, 0 );
434 }
435
440 void printRHS( const char* prefix )
441 {
-
442 HYPRE_SStructVectorPrint( prefix, _b, 0 );
+
442 HYPRE_SStructVectorPrint( prefix, _b, 0 );
443 }
444
@@ -515,10 +515,10 @@
479 if ( _is_preconditioner )
480 throw std::logic_error( "Cannot call setup() on preconditioners" );
481
-
482 auto error = HYPRE_SStructMatrixAssemble( _A );
+
482 auto error = HYPRE_SStructMatrixAssemble( _A );
483 checkHypreError( error );
484
-
485 this->setupImpl( _A, _b, _x );
+
485 this->setupImpl();
486 }
487
@@ -580,15 +580,15 @@
548
549 Kokkos::deep_copy( b_values, b_subv );
550 error = HYPRE_SStructVectorSetBoxValues(
-
551 _b, part, _lower.data(), _upper.data(), var, b_values.data() );
+
551 _b, part, _lower.data(), _upper.data(), var, b_values.data() );
552 checkHypreError( error );
553 }
554
-
555 error = HYPRE_SStructVectorAssemble( _b );
+
555 error = HYPRE_SStructVectorAssemble( _b );
556 checkHypreError( error );
557
558 // Solve the problem
-
559 this->solveImpl( _A, _b, _x );
+
559 this->solveImpl();
560
561 // Extract the solution from the LHS
562 for ( int var = 0; var < n_vars; ++var )
@@ -606,7 +606,7 @@
574 // Use a pair here to retain the view rank.
575
576 error = HYPRE_SStructVectorGetBoxValues(
-
577 _x, part, _lower.data(), _upper.data(), var, x_values.data() );
+
577 _x, part, _lower.data(), _upper.data(), var, x_values.data() );
578 checkHypreError( error );
579
580 // Copy the HYPRE solution to the LHS.
@@ -638,835 +638,838 @@
610
612 virtual void setPrintLevelImpl( const int print_level ) = 0;
613
-
615 virtual void setupImpl( HYPRE_SStructMatrix A, HYPRE_SStructVector b,
-
616 HYPRE_SStructVector x ) = 0;
-
617
-
619 virtual void solveImpl( HYPRE_SStructMatrix A, HYPRE_SStructVector b,
-
620 HYPRE_SStructVector x ) = 0;
-
621
-
623 virtual int getNumIterImpl() = 0;
-
624
-
626 virtual double getFinalRelativeResidualNormImpl() = 0;
-
627
-
629 virtual void setPreconditionerImpl(
-
630 const HypreSemiStructuredSolver<Scalar, EntityType, MemorySpace>&
-
631 preconditioner ) = 0;
-
632
-
-
634 void checkHypreError( const int error ) const
-
635 {
-
636 if ( error > 0 )
-
637 {
-
638 char error_msg[256];
-
639 HYPRE_DescribeError( error, error_msg );
-
640 std::stringstream out;
-
641 out << "HYPRE semi-structured solver error: ";
-
642 out << error << " " << error_msg;
-
643 HYPRE_ClearError( error );
-
644 throw std::runtime_error( out.str() );
-
645 }
-
646 }
-
-
647
-
648 private:
-
649 MPI_Comm _comm;
-
650 bool _is_preconditioner;
-
651 HYPRE_SStructGrid _grid;
-
652 std::vector<HYPRE_Int> _lower;
-
653 std::vector<HYPRE_Int> _upper;
-
654 std::vector<HYPRE_SStructStencil> _stencils;
-
655 HYPRE_SStructGraph _graph;
-
656 std::vector<unsigned> _stencil_size;
-
657 std::vector<std::vector<unsigned>> _stencil_index;
-
658 HYPRE_SStructMatrix _A;
-
659 HYPRE_SStructVector _b;
-
660 HYPRE_SStructVector _x;
-
661 std::shared_ptr<HypreSemiStructuredSolver<Scalar, EntityType, MemorySpace>>
-
662 _preconditioner;
-
663};
- -
664
-
665//---------------------------------------------------------------------------//
-
667template <class Scalar, class EntityType, class MemorySpace>
-
- -
669 : public HypreSemiStructuredSolver<Scalar, EntityType, MemorySpace>
-
670{
-
671 public:
- -
675 template <class ArrayLayout_t>
-
-
676 HypreSemiStructPCG( const ArrayLayout_t& layout, int n_vars,
-
677 const bool is_preconditioner = false )
-
678 : Base( layout, n_vars, is_preconditioner )
-
679 {
-
680 if ( is_preconditioner )
-
681 throw std::logic_error(
-
682 "HYPRE PCG cannot be used as a preconditioner" );
-
683
-
684 auto error = HYPRE_SStructPCGCreate(
-
685 layout.localGrid()->globalGrid().comm(), &_solver );
-
686 this->checkHypreError( error );
-
687
-
688 HYPRE_SStructPCGSetTwoNorm( _solver, 1 );
-
689 }
-
+
615 virtual void setupImpl() = 0;
+
616
+
618 virtual void solveImpl() = 0;
+
619
+
621 virtual int getNumIterImpl() = 0;
+
622
+ +
625
+ + +
629 preconditioner ) = 0;
+
630
+
+
632 void checkHypreError( const int error ) const
+
633 {
+
634 if ( error > 0 )
+
635 {
+
636 char error_msg[256];
+
637 HYPRE_DescribeError( error, error_msg );
+
638 std::stringstream out;
+
639 out << "HYPRE semi-structured solver error: ";
+
640 out << error << " " << error_msg;
+
641 HYPRE_ClearError( error );
+
642 throw std::runtime_error( out.str() );
+
643 }
+
644 }
+
+
645
+
647 HYPRE_SStructMatrix _A;
+
649 HYPRE_SStructVector _b;
+
651 HYPRE_SStructVector _x;
+
652
+
653 private:
+
654 MPI_Comm _comm;
+
655 bool _is_preconditioner;
+
656 HYPRE_SStructGrid _grid;
+
657 std::vector<HYPRE_Int> _lower;
+
658 std::vector<HYPRE_Int> _upper;
+
659 std::vector<HYPRE_SStructStencil> _stencils;
+
660 HYPRE_SStructGraph _graph;
+
661 std::vector<unsigned> _stencil_size;
+
662 std::vector<std::vector<unsigned>> _stencil_index;
+
663 std::shared_ptr<HypreSemiStructuredSolver<Scalar, EntityType, MemorySpace>>
+
664 _preconditioner;
+
665};
+
+
666
+
667//---------------------------------------------------------------------------//
+
669template <class Scalar, class EntityType, class MemorySpace>
+
+ +
671 : public HypreSemiStructuredSolver<Scalar, EntityType, MemorySpace>
+
672{
+
673 public:
+
675 using base_type =
+ +
678 template <class ArrayLayout_t>
+
+
679 HypreSemiStructPCG( const ArrayLayout_t& layout, int n_vars,
+
680 const bool is_preconditioner = false )
+
681 : base_type( layout, n_vars, is_preconditioner )
+
682 {
+
683 if ( is_preconditioner )
+
684 throw std::logic_error(
+
685 "HYPRE PCG cannot be used as a preconditioner" );
+
686
+
687 auto error = HYPRE_SStructPCGCreate(
+
688 layout.localGrid()->globalGrid().comm(), &_solver );
+
689 this->checkHypreError( error );
690
-
691 ~HypreSemiStructPCG() { HYPRE_SStructPCGDestroy( _solver ); }
-
692
-
693 // PCG SETTINGS
-
694
-
-
696 void setAbsoluteTol( const double tol )
-
697 {
-
698 auto error = HYPRE_SStructPCGSetAbsoluteTol( _solver, tol );
-
699 this->checkHypreError( error );
-
700 }
-
-
701
-
-
704 void setRelChange( const int rel_change )
-
705 {
-
706 auto error = HYPRE_SStructPCGSetRelChange( _solver, rel_change );
-
707 this->checkHypreError( error );
-
708 }
-
-
709
-
-
711 void setLogging( const int logging )
-
712 {
-
713 auto error = HYPRE_SStructPCGSetLogging( _solver, logging );
-
714 this->checkHypreError( error );
-
715 }
-
-
716
-
717 HYPRE_SStructSolver getHypreSolver() const override { return _solver; }
-
-
718 HYPRE_PtrToSStructSolverFcn getHypreSetupFunction() const override
-
719 {
-
720 return HYPRE_SStructPCGSetup;
-
721 }
-
-
-
722 HYPRE_PtrToSStructSolverFcn getHypreSolveFunction() const override
-
723 {
-
724 return HYPRE_SStructPCGSolve;
-
725 }
-
-
726
-
727 protected:
-
-
728 void setToleranceImpl( const double tol ) override
-
729 {
-
730 auto error = HYPRE_SStructPCGSetTol( _solver, tol );
-
731 this->checkHypreError( error );
-
732 }
-
-
733
-
-
734 void setMaxIterImpl( const int max_iter ) override
-
735 {
-
736 auto error = HYPRE_SStructPCGSetMaxIter( _solver, max_iter );
-
737 this->checkHypreError( error );
-
738 }
-
-
739
-
-
740 void setPrintLevelImpl( const int print_level ) override
-
741 {
-
742 auto error = HYPRE_SStructPCGSetPrintLevel( _solver, print_level );
-
743 this->checkHypreError( error );
-
744 }
-
-
745
-
-
746 void setupImpl( HYPRE_SStructMatrix A, HYPRE_SStructVector b,
-
747 HYPRE_SStructVector x ) override
-
748 {
-
749 auto error = HYPRE_SStructPCGSetup( _solver, A, b, x );
-
750 this->checkHypreError( error );
-
751 }
-
-
752
-
-
753 void solveImpl( HYPRE_SStructMatrix A, HYPRE_SStructVector b,
-
754 HYPRE_SStructVector x ) override
-
755 {
-
756 auto error = HYPRE_SStructPCGSolve( _solver, A, b, x );
-
757 this->checkHypreError( error );
-
758 }
-
-
759
-
-
760 int getNumIterImpl() override
-
761 {
-
762 HYPRE_Int num_iter;
-
763 auto error = HYPRE_SStructPCGGetNumIterations( _solver, &num_iter );
-
764 this->checkHypreError( error );
-
765 return num_iter;
-
766 }
-
-
767
-
- -
769 {
-
770 HYPRE_Real norm;
-
771 auto error =
-
772 HYPRE_SStructPCGGetFinalRelativeResidualNorm( _solver, &norm );
-
773 this->checkHypreError( error );
-
774 return norm;
-
775 }
-
-
776
-
- - -
779 preconditioner ) override
-
780 {
-
781 auto error = HYPRE_SStructPCGSetPrecond(
-
782 _solver, preconditioner.getHypreSolveFunction(),
-
783 preconditioner.getHypreSetupFunction(),
-
784 preconditioner.getHypreSolver() );
-
785 this->checkHypreError( error );
-
786 }
-
-
787
-
788 private:
-
789 HYPRE_SStructSolver _solver;
-
790};
-
-
791
-
792//---------------------------------------------------------------------------//
-
794template <class Scalar, class EntityType, class MemorySpace>
-
- -
796 : public HypreSemiStructuredSolver<Scalar, EntityType, MemorySpace>
-
797{
-
798 public:
- -
802 template <class ArrayLayout_t>
-
-
803 HypreSemiStructGMRES( const ArrayLayout_t& layout, int n_vars,
-
804 const bool is_preconditioner = false )
-
805 : Base( layout, n_vars, is_preconditioner )
-
806 {
-
807 if ( is_preconditioner )
-
808 throw std::logic_error(
-
809 "HYPRE GMRES cannot be used as a preconditioner" );
-
810
-
811 auto error = HYPRE_SStructGMRESCreate(
-
812 layout.localGrid()->globalGrid().comm(), &_solver );
-
813 this->checkHypreError( error );
-
814 }
-
+
691 HYPRE_SStructPCGSetTwoNorm( _solver, 1 );
+
692 }
+
+
693
+
694 ~HypreSemiStructPCG() { HYPRE_SStructPCGDestroy( _solver ); }
+
695
+
696 // PCG SETTINGS
+
697
+
+
699 void setAbsoluteTol( const double tol )
+
700 {
+
701 auto error = HYPRE_SStructPCGSetAbsoluteTol( _solver, tol );
+
702 this->checkHypreError( error );
+
703 }
+
+
704
+
+
707 void setRelChange( const int rel_change )
+
708 {
+
709 auto error = HYPRE_SStructPCGSetRelChange( _solver, rel_change );
+
710 this->checkHypreError( error );
+
711 }
+
+
712
+
+
714 void setLogging( const int logging )
+
715 {
+
716 auto error = HYPRE_SStructPCGSetLogging( _solver, logging );
+
717 this->checkHypreError( error );
+
718 }
+
+
719
+
720 HYPRE_SStructSolver getHypreSolver() const override { return _solver; }
+
+
721 HYPRE_PtrToSStructSolverFcn getHypreSetupFunction() const override
+
722 {
+
723 return HYPRE_SStructPCGSetup;
+
724 }
+
+
+
725 HYPRE_PtrToSStructSolverFcn getHypreSolveFunction() const override
+
726 {
+
727 return HYPRE_SStructPCGSolve;
+
728 }
+
+
729
+
730 protected:
+
+
731 void setToleranceImpl( const double tol ) override
+
732 {
+
733 auto error = HYPRE_SStructPCGSetTol( _solver, tol );
+
734 this->checkHypreError( error );
+
735 }
+
+
736
+
+
737 void setMaxIterImpl( const int max_iter ) override
+
738 {
+
739 auto error = HYPRE_SStructPCGSetMaxIter( _solver, max_iter );
+
740 this->checkHypreError( error );
+
741 }
+
+
742
+
+
743 void setPrintLevelImpl( const int print_level ) override
+
744 {
+
745 auto error = HYPRE_SStructPCGSetPrintLevel( _solver, print_level );
+
746 this->checkHypreError( error );
+
747 }
+
+
748
+
+
749 void setupImpl() override
+
750 {
+
751 auto error = HYPRE_SStructPCGSetup( _solver, _A, _b, _x );
+
752 this->checkHypreError( error );
+
753 }
+
+
754
+
+
755 void solveImpl() override
+
756 {
+
757 auto error = HYPRE_SStructPCGSolve( _solver, _A, _b, _x );
+
758 this->checkHypreError( error );
+
759 }
+
+
760
+
+
761 int getNumIterImpl() override
+
762 {
+
763 HYPRE_Int num_iter;
+
764 auto error = HYPRE_SStructPCGGetNumIterations( _solver, &num_iter );
+
765 this->checkHypreError( error );
+
766 return num_iter;
+
767 }
+
+
768
+
+ +
770 {
+
771 HYPRE_Real norm;
+
772 auto error =
+
773 HYPRE_SStructPCGGetFinalRelativeResidualNorm( _solver, &norm );
+
774 this->checkHypreError( error );
+
775 return norm;
+
776 }
+
+
777
+
+ + +
780 preconditioner ) override
+
781 {
+
782 auto error = HYPRE_SStructPCGSetPrecond(
+
783 _solver, preconditioner.getHypreSolveFunction(),
+
784 preconditioner.getHypreSetupFunction(),
+
785 preconditioner.getHypreSolver() );
+
786 this->checkHypreError( error );
+
787 }
+
+
788
+
789 private:
+
790 HYPRE_SStructSolver _solver;
+
791 using base_type::_A;
+
792 using base_type::_b;
+
793 using base_type::_x;
+
794};
+
+
795
+
796//---------------------------------------------------------------------------//
+
798template <class Scalar, class EntityType, class MemorySpace>
+
+ +
800 : public HypreSemiStructuredSolver<Scalar, EntityType, MemorySpace>
+
801{
+
802 public:
+
804 using base_type =
+ +
807 template <class ArrayLayout_t>
+
+
808 HypreSemiStructGMRES( const ArrayLayout_t& layout, int n_vars,
+
809 const bool is_preconditioner = false )
+
810 : base_type( layout, n_vars, is_preconditioner )
+
811 {
+
812 if ( is_preconditioner )
+
813 throw std::logic_error(
+
814 "HYPRE GMRES cannot be used as a preconditioner" );
815
-
816 ~HypreSemiStructGMRES() { HYPRE_SStructGMRESDestroy( _solver ); }
-
817
-
818 // GMRES SETTINGS
-
819
-
-
821 void setAbsoluteTol( const double tol )
-
822 {
-
823 auto error = HYPRE_SStructGMRESSetAbsoluteTol( _solver, tol );
-
824 this->checkHypreError( error );
-
825 }
-
-
826
-
-
828 void setKDim( const int k_dim )
-
829 {
-
830 auto error = HYPRE_SStructGMRESSetKDim( _solver, k_dim );
-
831 this->checkHypreError( error );
-
832 }
-
-
833
-
-
835 void setLogging( const int logging )
-
836 {
-
837 auto error = HYPRE_SStructGMRESSetLogging( _solver, logging );
-
838 this->checkHypreError( error );
-
839 }
-
-
840
-
841 HYPRE_SStructSolver getHypreSolver() const override { return _solver; }
-
-
842 HYPRE_PtrToSStructSolverFcn getHypreSetupFunction() const override
-
843 {
-
844 return HYPRE_SStructGMRESSetup;
-
845 }
-
-
-
846 HYPRE_PtrToSStructSolverFcn getHypreSolveFunction() const override
-
847 {
-
848 return HYPRE_SStructGMRESSolve;
-
849 }
-
-
850
-
851 protected:
-
-
852 void setToleranceImpl( const double tol ) override
-
853 {
-
854 auto error = HYPRE_SStructGMRESSetTol( _solver, tol );
-
855 this->checkHypreError( error );
-
856 }
-
-
857
-
-
858 void setMaxIterImpl( const int max_iter ) override
-
859 {
-
860 auto error = HYPRE_SStructGMRESSetMaxIter( _solver, max_iter );
-
861 this->checkHypreError( error );
-
862 }
-
-
863
-
-
864 void setPrintLevelImpl( const int print_level ) override
-
865 {
-
866 auto error = HYPRE_SStructGMRESSetPrintLevel( _solver, print_level );
-
867 this->checkHypreError( error );
-
868 }
-
-
869
-
-
870 void setupImpl( HYPRE_SStructMatrix A, HYPRE_SStructVector b,
-
871 HYPRE_SStructVector x ) override
-
872 {
-
873 auto error = HYPRE_SStructGMRESSetup( _solver, A, b, x );
-
874 this->checkHypreError( error );
-
875 }
-
-
876
-
-
877 void solveImpl( HYPRE_SStructMatrix A, HYPRE_SStructVector b,
-
878 HYPRE_SStructVector x ) override
-
879 {
-
880 auto error = HYPRE_SStructGMRESSolve( _solver, A, b, x );
-
881 this->checkHypreError( error );
-
882 }
-
-
883
-
-
884 int getNumIterImpl() override
-
885 {
-
886 HYPRE_Int num_iter;
-
887 auto error = HYPRE_SStructGMRESGetNumIterations( _solver, &num_iter );
-
888 this->checkHypreError( error );
-
889 return num_iter;
-
890 }
-
-
891
-
- -
893 {
-
894 HYPRE_Real norm;
-
895 auto error =
-
896 HYPRE_SStructGMRESGetFinalRelativeResidualNorm( _solver, &norm );
-
897 this->checkHypreError( error );
-
898 return norm;
-
899 }
-
-
900
-
- - -
903 preconditioner ) override
-
904 {
-
905 auto error = HYPRE_SStructGMRESSetPrecond(
-
906 _solver, preconditioner.getHypreSolveFunction(),
-
907 preconditioner.getHypreSetupFunction(),
-
908 preconditioner.getHypreSolver() );
-
909 this->checkHypreError( error );
-
910 }
-
-
911
-
912 private:
-
913 HYPRE_SStructSolver _solver;
-
914};
-
-
915
-
916//---------------------------------------------------------------------------//
-
918template <class Scalar, class EntityType, class MemorySpace>
-
- -
920 : public HypreSemiStructuredSolver<Scalar, EntityType, MemorySpace>
-
921{
-
922 public:
- -
926 template <class ArrayLayout_t>
-
-
927 HypreSemiStructBiCGSTAB( const ArrayLayout_t& layout,
-
928 const bool is_preconditioner = false,
-
929 int n_vars = 3 )
-
930 : Base( layout, n_vars, is_preconditioner )
-
931 {
-
932 if ( is_preconditioner )
-
933 throw std::logic_error(
-
934 "HYPRE BiCGSTAB cannot be used as a preconditioner" );
-
935
-
936 auto error = HYPRE_SStructBiCGSTABCreate(
-
937 layout.localGrid()->globalGrid().comm(), &_solver );
-
938 this->checkHypreError( error );
-
939 }
-
-
940
-
941 ~HypreSemiStructBiCGSTAB() { HYPRE_SStructBiCGSTABDestroy( _solver ); }
+
816 auto error = HYPRE_SStructGMRESCreate(
+
817 layout.localGrid()->globalGrid().comm(), &_solver );
+
818 this->checkHypreError( error );
+
819 }
+
+
820
+
821 ~HypreSemiStructGMRES() { HYPRE_SStructGMRESDestroy( _solver ); }
+
822
+
823 // GMRES SETTINGS
+
824
+
+
826 void setAbsoluteTol( const double tol )
+
827 {
+
828 auto error = HYPRE_SStructGMRESSetAbsoluteTol( _solver, tol );
+
829 this->checkHypreError( error );
+
830 }
+
+
831
+
+
833 void setKDim( const int k_dim )
+
834 {
+
835 auto error = HYPRE_SStructGMRESSetKDim( _solver, k_dim );
+
836 this->checkHypreError( error );
+
837 }
+
+
838
+
+
840 void setLogging( const int logging )
+
841 {
+
842 auto error = HYPRE_SStructGMRESSetLogging( _solver, logging );
+
843 this->checkHypreError( error );
+
844 }
+
+
845
+
846 HYPRE_SStructSolver getHypreSolver() const override { return _solver; }
+
+
847 HYPRE_PtrToSStructSolverFcn getHypreSetupFunction() const override
+
848 {
+
849 return HYPRE_SStructGMRESSetup;
+
850 }
+
+
+
851 HYPRE_PtrToSStructSolverFcn getHypreSolveFunction() const override
+
852 {
+
853 return HYPRE_SStructGMRESSolve;
+
854 }
+
+
855
+
856 protected:
+
+
857 void setToleranceImpl( const double tol ) override
+
858 {
+
859 auto error = HYPRE_SStructGMRESSetTol( _solver, tol );
+
860 this->checkHypreError( error );
+
861 }
+
+
862
+
+
863 void setMaxIterImpl( const int max_iter ) override
+
864 {
+
865 auto error = HYPRE_SStructGMRESSetMaxIter( _solver, max_iter );
+
866 this->checkHypreError( error );
+
867 }
+
+
868
+
+
869 void setPrintLevelImpl( const int print_level ) override
+
870 {
+
871 auto error = HYPRE_SStructGMRESSetPrintLevel( _solver, print_level );
+
872 this->checkHypreError( error );
+
873 }
+
+
874
+
+
875 void setupImpl() override
+
876 {
+
877 auto error = HYPRE_SStructGMRESSetup( _solver, _A, _b, _x );
+
878 this->checkHypreError( error );
+
879 }
+
+
880
+
+
881 void solveImpl() override
+
882 {
+
883 auto error = HYPRE_SStructGMRESSolve( _solver, _A, _b, _x );
+
884 this->checkHypreError( error );
+
885 }
+
+
886
+
+
887 int getNumIterImpl() override
+
888 {
+
889 HYPRE_Int num_iter;
+
890 auto error = HYPRE_SStructGMRESGetNumIterations( _solver, &num_iter );
+
891 this->checkHypreError( error );
+
892 return num_iter;
+
893 }
+
+
894
+
+ +
896 {
+
897 HYPRE_Real norm;
+
898 auto error =
+
899 HYPRE_SStructGMRESGetFinalRelativeResidualNorm( _solver, &norm );
+
900 this->checkHypreError( error );
+
901 return norm;
+
902 }
+
+
903
+
+ + +
906 preconditioner ) override
+
907 {
+
908 auto error = HYPRE_SStructGMRESSetPrecond(
+
909 _solver, preconditioner.getHypreSolveFunction(),
+
910 preconditioner.getHypreSetupFunction(),
+
911 preconditioner.getHypreSolver() );
+
912 this->checkHypreError( error );
+
913 }
+
+
914
+
915 private:
+
916 HYPRE_SStructSolver _solver;
+
917 using base_type::_A;
+
918 using base_type::_b;
+
919 using base_type::_x;
+
920};
+
+
921
+
922//---------------------------------------------------------------------------//
+
924template <class Scalar, class EntityType, class MemorySpace>
+
+ +
926 : public HypreSemiStructuredSolver<Scalar, EntityType, MemorySpace>
+
927{
+
928 public:
+
930 using base_type =
+ +
933 template <class ArrayLayout_t>
+
+
934 HypreSemiStructBiCGSTAB( const ArrayLayout_t& layout,
+
935 const bool is_preconditioner = false,
+
936 int n_vars = 3 )
+
937 : base_type( layout, n_vars, is_preconditioner )
+
938 {
+
939 if ( is_preconditioner )
+
940 throw std::logic_error(
+
941 "HYPRE BiCGSTAB cannot be used as a preconditioner" );
942
-
943 // BiCGSTAB SETTINGS
-
944
-
-
946 void setAbsoluteTol( const double tol )
-
947 {
-
948 auto error = HYPRE_SStructBiCGSTABSetAbsoluteTol( _solver, tol );
-
949 this->checkHypreError( error );
-
950 }
-
+
943 auto error = HYPRE_SStructBiCGSTABCreate(
+
944 layout.localGrid()->globalGrid().comm(), &_solver );
+
945 this->checkHypreError( error );
+
946 }
+
+
947
+
948 ~HypreSemiStructBiCGSTAB() { HYPRE_SStructBiCGSTABDestroy( _solver ); }
+
949
+
950 // BiCGSTAB SETTINGS
951
-
953 void setLogging( const int logging )
+
953 void setAbsoluteTol( const double tol )
954 {
-
955 auto error = HYPRE_SStructBiCGSTABSetLogging( _solver, logging );
+
955 auto error = HYPRE_SStructBiCGSTABSetAbsoluteTol( _solver, tol );
956 this->checkHypreError( error );
957 }
958
-
959 HYPRE_SStructSolver getHypreSolver() const override { return _solver; }
-
960 HYPRE_PtrToSStructSolverFcn getHypreSetupFunction() const override
-
961 {
-
962 return HYPRE_SStructBiCGSTABSetup;
-
963 }
-
-
-
964 HYPRE_PtrToSStructSolverFcn getHypreSolveFunction() const override
-
965 {
-
966 return HYPRE_SStructBiCGSTABSolve;
-
967 }
-
-
968
-
969 protected:
-
-
970 void setToleranceImpl( const double tol ) override
-
971 {
-
972 auto error = HYPRE_SStructBiCGSTABSetTol( _solver, tol );
-
973 this->checkHypreError( error );
+
960 void setLogging( const int logging )
+
961 {
+
962 auto error = HYPRE_SStructBiCGSTABSetLogging( _solver, logging );
+
963 this->checkHypreError( error );
+
964 }
+
+
965
+
966 HYPRE_SStructSolver getHypreSolver() const override { return _solver; }
+
+
967 HYPRE_PtrToSStructSolverFcn getHypreSetupFunction() const override
+
968 {
+
969 return HYPRE_SStructBiCGSTABSetup;
+
970 }
+
+
+
971 HYPRE_PtrToSStructSolverFcn getHypreSolveFunction() const override
+
972 {
+
973 return HYPRE_SStructBiCGSTABSolve;
974 }
975
-
-
976 void setMaxIterImpl( const int max_iter ) override
-
977 {
-
978 auto error = HYPRE_SStructBiCGSTABSetMaxIter( _solver, max_iter );
-
979 this->checkHypreError( error );
-
980 }
-
-
981
-
-
982 void setPrintLevelImpl( const int print_level ) override
-
983 {
-
984 auto error = HYPRE_SStructBiCGSTABSetPrintLevel( _solver, print_level );
-
985 this->checkHypreError( error );
-
986 }
-
-
987
-
-
988 void setupImpl( HYPRE_SStructMatrix A, HYPRE_SStructVector b,
-
989 HYPRE_SStructVector x ) override
+
976 protected:
+
+
977 void setToleranceImpl( const double tol ) override
+
978 {
+
979 auto error = HYPRE_SStructBiCGSTABSetTol( _solver, tol );
+
980 this->checkHypreError( error );
+
981 }
+
+
982
+
+
983 void setMaxIterImpl( const int max_iter ) override
+
984 {
+
985 auto error = HYPRE_SStructBiCGSTABSetMaxIter( _solver, max_iter );
+
986 this->checkHypreError( error );
+
987 }
+
+
988
+
+
989 void setPrintLevelImpl( const int print_level ) override
990 {
-
991 auto error = HYPRE_SStructBiCGSTABSetup( _solver, A, b, x );
+
991 auto error = HYPRE_SStructBiCGSTABSetPrintLevel( _solver, print_level );
992 this->checkHypreError( error );
993 }
994
-
995 void solveImpl( HYPRE_SStructMatrix A, HYPRE_SStructVector b,
-
996 HYPRE_SStructVector x ) override
-
997 {
-
998 auto error = HYPRE_SStructBiCGSTABSolve( _solver, A, b, x );
-
999 this->checkHypreError( error );
-
1000 }
-
-
1001
-
-
1002 int getNumIterImpl() override
-
1003 {
-
1004 HYPRE_Int num_iter;
-
1005 auto error =
-
1006 HYPRE_SStructBiCGSTABGetNumIterations( _solver, &num_iter );
-
1007 this->checkHypreError( error );
-
1008 return num_iter;
-
1009 }
-
-
1010
-
- -
1012 {
-
1013 HYPRE_Real norm;
-
1014 auto error =
-
1015 HYPRE_SStructBiCGSTABGetFinalRelativeResidualNorm( _solver, &norm );
-
1016 this->checkHypreError( error );
-
1017 return norm;
-
1018 }
-
-
1019
-
- - -
1022 preconditioner ) override
-
1023 {
-
1024 auto error = HYPRE_SStructBiCGSTABSetPrecond(
-
1025 _solver, preconditioner.getHypreSolveFunction(),
-
1026 preconditioner.getHypreSetupFunction(),
-
1027 preconditioner.getHypreSolver() );
-
1028 this->checkHypreError( error );
-
1029 }
-
-
1030
-
1031 private:
-
1032 HYPRE_SStructSolver _solver;
-
1033};
-
-
1034
-
1035//---------------------------------------------------------------------------//
-
1037template <class Scalar, class EntityType, class MemorySpace>
-
- -
1039 : public HypreSemiStructuredSolver<Scalar, EntityType, MemorySpace>
-
1040{
-
1041 public:
- -
1045 template <class ArrayLayout_t>
-
-
1046 HypreSemiStructDiagonal( const ArrayLayout_t& layout,
-
1047 const bool is_preconditioner = false,
-
1048 int n_vars = 3 )
-
1049 : Base( layout, n_vars, is_preconditioner )
-
1050 {
-
1051 if ( !is_preconditioner )
-
1052 throw std::logic_error(
-
1053 "Diagonal preconditioner cannot be used as a solver" );
-
1054 }
-
-
1055
-
1056 HYPRE_SStructSolver getHypreSolver() const override { return nullptr; }
-
-
1057 HYPRE_PtrToSStructSolverFcn getHypreSetupFunction() const override
-
1058 {
-
1059 return HYPRE_SStructDiagScaleSetup;
-
1060 }
-
-
-
1061 HYPRE_PtrToSStructSolverFcn getHypreSolveFunction() const override
-
1062 {
-
1063 return HYPRE_SStructDiagScale;
-
1064 }
-
-
1065
-
1066 protected:
-
-
1067 void setToleranceImpl( const double ) override
-
1068 {
-
1069 throw std::logic_error(
-
1070 "Diagonal preconditioner cannot be used as a solver" );
-
1071 }
-
-
1072
-
-
1073 void setMaxIterImpl( const int ) override
-
1074 {
-
1075 throw std::logic_error(
-
1076 "Diagonal preconditioner cannot be used as a solver" );
-
1077 }
-
-
1078
-
-
1079 void setPrintLevelImpl( const int ) override
-
1080 {
-
1081 throw std::logic_error(
-
1082 "Diagonal preconditioner cannot be used as a solver" );
-
1083 }
-
-
1084
-
-
1085 void setupImpl( HYPRE_SStructMatrix, HYPRE_SStructVector,
-
1086 HYPRE_SStructVector ) override
-
1087 {
-
1088 throw std::logic_error(
-
1089 "Diagonal preconditioner cannot be used as a solver" );
-
1090 }
-
-
1091
-
-
1092 void solveImpl( HYPRE_SStructMatrix, HYPRE_SStructVector,
-
1093 HYPRE_SStructVector ) override
-
1094 {
-
1095 throw std::logic_error(
-
1096 "Diagonal preconditioner cannot be used as a solver" );
-
1097 }
-
-
1098
-
-
1099 int getNumIterImpl() override
-
1100 {
-
1101 throw std::logic_error(
-
1102 "Diagonal preconditioner cannot be used as a solver" );
-
1103 }
-
-
1104
-
- -
1106 {
-
1107 throw std::logic_error(
-
1108 "Diagonal preconditioner cannot be used as a solver" );
-
1109 }
-
-
1110
-
- - -
1113 override
-
1114 {
-
1115 throw std::logic_error(
-
1116 "Diagonal preconditioner does not support preconditioning." );
-
1117 }
-
-
1118};
-
-
1119
-
1120//---------------------------------------------------------------------------//
-
1121// Builders
-
1122//---------------------------------------------------------------------------//
-
1124template <class Scalar, class MemorySpace, class ArrayLayout_t>
-
1125std::shared_ptr<HypreSemiStructPCG<Scalar, typename ArrayLayout_t::entity_type,
-
1126 MemorySpace>>
-
-
1127createHypreSemiStructPCG( const ArrayLayout_t& layout,
-
1128 const bool is_preconditioner = false, int n_vars = 3 )
-
1129{
- -
1131 "Must use an array layout" );
-
1132 return std::make_shared<HypreSemiStructPCG<
-
1133 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>(
-
1134 layout, n_vars, is_preconditioner );
-
1135}
-
-
1136
-
1138template <class Scalar, class MemorySpace, class ArrayLayout_t>
-
1139std::shared_ptr<HypreSemiStructGMRES<
-
1140 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>
-
-
1141createHypreSemiStructGMRES( const ArrayLayout_t& layout,
-
1142 const bool is_preconditioner = false,
-
1143 int n_vars = 3 )
-
1144{
- -
1146 "Must use an array layout" );
-
1147 return std::make_shared<HypreSemiStructGMRES<
-
1148 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>(
-
1149 layout, n_vars, is_preconditioner );
-
1150}
-
-
1151
-
1153template <class Scalar, class MemorySpace, class ArrayLayout_t>
-
1154std::shared_ptr<HypreSemiStructBiCGSTAB<
-
1155 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>
-
-
1156createHypreSemiStructBiCGSTAB( const ArrayLayout_t& layout,
-
1157 const bool is_preconditioner = false,
-
1158 int n_vars = 3 )
-
1159{
- -
1161 "Must use an array layout" );
-
1162 return std::make_shared<HypreSemiStructBiCGSTAB<
-
1163 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>(
-
1164 layout, is_preconditioner, n_vars );
-
1165}
-
-
1166
-
1168template <class Scalar, class MemorySpace, class ArrayLayout_t>
-
1169std::shared_ptr<HypreSemiStructDiagonal<
-
1170 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>
-
-
1171createHypreSemiStructDiagonal( const ArrayLayout_t& layout,
-
1172 const bool is_preconditioner = false,
-
1173 int n_vars = 3 )
-
1174{
- -
1176 "Must use an array layout" );
-
1177 return std::make_shared<HypreSemiStructDiagonal<
-
1178 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>(
-
1179 layout, is_preconditioner, n_vars );
-
1180}
-
-
1181
-
1182//---------------------------------------------------------------------------//
-
1183// Factory
-
1184//---------------------------------------------------------------------------//
-
1193template <class Scalar, class MemorySpace, class ArrayLayout_t>
-
1194std::shared_ptr<HypreSemiStructuredSolver<
-
1195 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>
-
-
1196createHypreSemiStructuredSolver( const std::string& solver_type,
-
1197 const ArrayLayout_t& layout,
-
1198 const bool is_preconditioner = false,
-
1199 int n_vars = 3 )
-
1200{
- -
1202 "Must use an array layout" );
-
1203
-
1204 if ( "PCG" == solver_type )
-
1205 return createHypreSemiStructPCG<Scalar, MemorySpace>(
-
1206 layout, is_preconditioner, n_vars );
-
1207 else if ( "GMRES" == solver_type )
-
1208 return createHypreSemiStructGMRES<Scalar, MemorySpace>(
-
1209 layout, is_preconditioner, n_vars );
-
1210 else if ( "BiCGSTAB" == solver_type )
-
1211 return createHypreSemiStructBiCGSTAB<Scalar, MemorySpace>(
-
1212 layout, is_preconditioner, n_vars );
-
1213 else if ( "Diagonal" == solver_type )
-
1214 return createHypreSemiStructDiagonal<Scalar, MemorySpace>(
-
1215 layout, is_preconditioner, n_vars );
-
1216 else
-
1217 throw std::runtime_error( "Invalid solver type" );
-
1218}
-
-
1219
-
1220//---------------------------------------------------------------------------//
-
1221
-
1222} // namespace Grid
-
1223} // namespace Cabana
-
1224
-
1225namespace Cajita
-
1226{
-
1228template <class Scalar, class EntityType, class MemorySpace>
-
1229using HypreSemiStructuredSolver CAJITA_DEPRECATED =
- +
995 void setupImpl() override
+
996 {
+
997 auto error = HYPRE_SStructBiCGSTABSetup( _solver, _A, _b, _x );
+
998 this->checkHypreError( error );
+
999 }
+
+
1000
+
+
1001 void solveImpl() override
+
1002 {
+
1003 auto error = HYPRE_SStructBiCGSTABSolve( _solver, _A, _b, _x );
+
1004 this->checkHypreError( error );
+
1005 }
+
+
1006
+
+
1007 int getNumIterImpl() override
+
1008 {
+
1009 HYPRE_Int num_iter;
+
1010 auto error =
+
1011 HYPRE_SStructBiCGSTABGetNumIterations( _solver, &num_iter );
+
1012 this->checkHypreError( error );
+
1013 return num_iter;
+
1014 }
+
+
1015
+
+ +
1017 {
+
1018 HYPRE_Real norm;
+
1019 auto error =
+
1020 HYPRE_SStructBiCGSTABGetFinalRelativeResidualNorm( _solver, &norm );
+
1021 this->checkHypreError( error );
+
1022 return norm;
+
1023 }
+
+
1024
+
+ + +
1027 preconditioner ) override
+
1028 {
+
1029 auto error = HYPRE_SStructBiCGSTABSetPrecond(
+
1030 _solver, preconditioner.getHypreSolveFunction(),
+
1031 preconditioner.getHypreSetupFunction(),
+
1032 preconditioner.getHypreSolver() );
+
1033 this->checkHypreError( error );
+
1034 }
+
+
1035
+
1036 private:
+
1037 HYPRE_SStructSolver _solver;
+
1038 using base_type::_A;
+
1039 using base_type::_b;
+
1040 using base_type::_x;
+
1041};
+ +
1042
+
1043//---------------------------------------------------------------------------//
+
1045template <class Scalar, class EntityType, class MemorySpace>
+
+ +
1047 : public HypreSemiStructuredSolver<Scalar, EntityType, MemorySpace>
+
1048{
+
1049 public:
+ + +
1054 template <class ArrayLayout_t>
+
+
1055 HypreSemiStructDiagonal( const ArrayLayout_t& layout,
+
1056 const bool is_preconditioner = false,
+
1057 int n_vars = 3 )
+
1058 : base_type( layout, n_vars, is_preconditioner )
+
1059 {
+
1060 if ( !is_preconditioner )
+
1061 throw std::logic_error(
+
1062 "Diagonal preconditioner cannot be used as a solver" );
+
1063 }
+
+
1064
+
1065 HYPRE_SStructSolver getHypreSolver() const override { return nullptr; }
+
+
1066 HYPRE_PtrToSStructSolverFcn getHypreSetupFunction() const override
+
1067 {
+
1068 return HYPRE_SStructDiagScaleSetup;
+
1069 }
+
+
+
1070 HYPRE_PtrToSStructSolverFcn getHypreSolveFunction() const override
+
1071 {
+
1072 return HYPRE_SStructDiagScale;
+
1073 }
+
+
1074
+
1075 protected:
+
+
1076 void setToleranceImpl( const double ) override
+
1077 {
+
1078 throw std::logic_error(
+
1079 "Diagonal preconditioner cannot be used as a solver" );
+
1080 }
+
+
1081
+
+
1082 void setMaxIterImpl( const int ) override
+
1083 {
+
1084 throw std::logic_error(
+
1085 "Diagonal preconditioner cannot be used as a solver" );
+
1086 }
+
+
1087
+
+
1088 void setPrintLevelImpl( const int ) override
+
1089 {
+
1090 throw std::logic_error(
+
1091 "Diagonal preconditioner cannot be used as a solver" );
+
1092 }
+
+
1093
+
+
1094 void setupImpl() override
+
1095 {
+
1096 throw std::logic_error(
+
1097 "Diagonal preconditioner cannot be used as a solver" );
+
1098 }
+
+
1099
+
+
1100 void solveImpl() override
+
1101 {
+
1102 throw std::logic_error(
+
1103 "Diagonal preconditioner cannot be used as a solver" );
+
1104 }
+
+
1105
+
+
1106 int getNumIterImpl() override
+
1107 {
+
1108 throw std::logic_error(
+
1109 "Diagonal preconditioner cannot be used as a solver" );
+
1110 }
+
+
1111
+
+ +
1113 {
+
1114 throw std::logic_error(
+
1115 "Diagonal preconditioner cannot be used as a solver" );
+
1116 }
+
+
1117
+
+ + +
1120 override
+
1121 {
+
1122 throw std::logic_error(
+
1123 "Diagonal preconditioner does not support preconditioning." );
+
1124 }
+
+
1125};
+
+
1126
+
1127//---------------------------------------------------------------------------//
+
1128// Builders
+
1129//---------------------------------------------------------------------------//
+
1131template <class Scalar, class MemorySpace, class ArrayLayout_t>
+
1132std::shared_ptr<HypreSemiStructPCG<Scalar, typename ArrayLayout_t::entity_type,
+
1133 MemorySpace>>
+
+
1134createHypreSemiStructPCG( const ArrayLayout_t& layout,
+
1135 const bool is_preconditioner = false, int n_vars = 3 )
+
1136{
+ +
1138 "Must use an array layout" );
+
1139 return std::make_shared<HypreSemiStructPCG<
+
1140 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>(
+
1141 layout, n_vars, is_preconditioner );
+
1142}
+
+
1143
+
1145template <class Scalar, class MemorySpace, class ArrayLayout_t>
+
1146std::shared_ptr<HypreSemiStructGMRES<
+
1147 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>
+
+
1148createHypreSemiStructGMRES( const ArrayLayout_t& layout,
+
1149 const bool is_preconditioner = false,
+
1150 int n_vars = 3 )
+
1151{
+ +
1153 "Must use an array layout" );
+
1154 return std::make_shared<HypreSemiStructGMRES<
+
1155 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>(
+
1156 layout, n_vars, is_preconditioner );
+
1157}
+
+
1158
+
1160template <class Scalar, class MemorySpace, class ArrayLayout_t>
+
1161std::shared_ptr<HypreSemiStructBiCGSTAB<
+
1162 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>
+
+
1163createHypreSemiStructBiCGSTAB( const ArrayLayout_t& layout,
+
1164 const bool is_preconditioner = false,
+
1165 int n_vars = 3 )
+
1166{
+ +
1168 "Must use an array layout" );
+
1169 return std::make_shared<HypreSemiStructBiCGSTAB<
+
1170 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>(
+
1171 layout, is_preconditioner, n_vars );
+
1172}
+
+
1173
+
1175template <class Scalar, class MemorySpace, class ArrayLayout_t>
+
1176std::shared_ptr<HypreSemiStructDiagonal<
+
1177 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>
+
+
1178createHypreSemiStructDiagonal( const ArrayLayout_t& layout,
+
1179 const bool is_preconditioner = false,
+
1180 int n_vars = 3 )
+
1181{
+ +
1183 "Must use an array layout" );
+
1184 return std::make_shared<HypreSemiStructDiagonal<
+
1185 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>(
+
1186 layout, is_preconditioner, n_vars );
+
1187}
+
+
1188
+
1189//---------------------------------------------------------------------------//
+
1190// Factory
+
1191//---------------------------------------------------------------------------//
+
1200template <class Scalar, class MemorySpace, class ArrayLayout_t>
+
1201std::shared_ptr<HypreSemiStructuredSolver<
+
1202 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>
+
+
1203createHypreSemiStructuredSolver( const std::string& solver_type,
+
1204 const ArrayLayout_t& layout,
+
1205 const bool is_preconditioner = false,
+
1206 int n_vars = 3 )
+
1207{
+ +
1209 "Must use an array layout" );
+
1210
+
1211 if ( "PCG" == solver_type )
+
1212 return createHypreSemiStructPCG<Scalar, MemorySpace>(
+
1213 layout, is_preconditioner, n_vars );
+
1214 else if ( "GMRES" == solver_type )
+
1215 return createHypreSemiStructGMRES<Scalar, MemorySpace>(
+
1216 layout, is_preconditioner, n_vars );
+
1217 else if ( "BiCGSTAB" == solver_type )
+
1218 return createHypreSemiStructBiCGSTAB<Scalar, MemorySpace>(
+
1219 layout, is_preconditioner, n_vars );
+
1220 else if ( "Diagonal" == solver_type )
+
1221 return createHypreSemiStructDiagonal<Scalar, MemorySpace>(
+
1222 layout, is_preconditioner, n_vars );
+
1223 else
+
1224 throw std::runtime_error( "Invalid solver type" );
+
1225}
+
+
1226
+
1227//---------------------------------------------------------------------------//
+
1228
+
1229} // namespace Grid
+
1230} // namespace Cabana
1231
-
1232template <class Scalar, class EntityType, class MemorySpace>
-
1233using HypreSemiStructPCG CAJITA_DEPRECATED =
-
1234 Cabana::Grid::HypreSemiStructPCG<Scalar, EntityType, MemorySpace>;
-
1235
-
1236template <class Scalar, class EntityType, class MemorySpace>
-
1237using HypreSemiStructGMRES CAJITA_DEPRECATED =
-
1238 Cabana::Grid::HypreSemiStructGMRES<Scalar, EntityType, MemorySpace>;
-
1239
-
1240template <class Scalar, class EntityType, class MemorySpace>
-
1241using HypreSemiStructBiCGSTAB CAJITA_DEPRECATED =
-
1242 Cabana::Grid::HypreSemiStructBiCGSTAB<Scalar, EntityType, MemorySpace>;
-
1243
-
1244template <class Scalar, class EntityType, class MemorySpace>
-
1245using HypreSemiStructDiagonal CAJITA_DEPRECATED =
-
1246 Cabana::Grid::HypreSemiStructDiagonal<Scalar, EntityType, MemorySpace>;
-
1247
-
1248template <class... Args>
-
1249CAJITA_DEPRECATED auto createHypreSemiStructPCG( Args&&... args )
-
1250{
-
1251 return Cabana::Grid::createHypreSemiStructPCG(
-
1252 std::forward<Args>( args )... );
-
1253}
-
1254template <class... Args>
-
1255CAJITA_DEPRECATED auto createHypreSemiStructGMRES( Args&&... args )
-
1256{
-
1257 return Cabana::Grid::createHypreSemiStructGMRES(
-
1258 std::forward<Args>( args )... );
-
1259}
-
1260template <class... Args>
-
1261CAJITA_DEPRECATED auto createHypreSemiStructBiCGSTAB( Args&&... args )
-
1262{
-
1263 return Cabana::Grid::createHypreSemiStructBiCGSTAB(
-
1264 std::forward<Args>( args )... );
-
1265}
-
1266template <class... Args>
-
1267CAJITA_DEPRECATED auto createHypreSemiStructDiagonal( Args&&... args )
-
1268{
-
1269 return Cabana::Grid::createHypreSemiStructDiagonal(
-
1270 std::forward<Args>( args )... );
-
1271}
-
1272
-
1273template <class Scalar, class MemorySpace, class... Args>
-
1274CAJITA_DEPRECATED auto createHypreSemiStructuredSolver( Args&&... args )
+
1232namespace Cajita
+
1233{
+
1235template <class Scalar, class EntityType, class MemorySpace>
+
1236using HypreSemiStructuredSolver CAJITA_DEPRECATED =
+
1237 Cabana::Grid::HypreSemiStructuredSolver<Scalar, EntityType, MemorySpace>;
+
1238
+
1239template <class Scalar, class EntityType, class MemorySpace>
+
1240using HypreSemiStructPCG CAJITA_DEPRECATED =
+
1241 Cabana::Grid::HypreSemiStructPCG<Scalar, EntityType, MemorySpace>;
+
1242
+
1243template <class Scalar, class EntityType, class MemorySpace>
+
1244using HypreSemiStructGMRES CAJITA_DEPRECATED =
+
1245 Cabana::Grid::HypreSemiStructGMRES<Scalar, EntityType, MemorySpace>;
+
1246
+
1247template <class Scalar, class EntityType, class MemorySpace>
+
1248using HypreSemiStructBiCGSTAB CAJITA_DEPRECATED =
+
1249 Cabana::Grid::HypreSemiStructBiCGSTAB<Scalar, EntityType, MemorySpace>;
+
1250
+
1251template <class Scalar, class EntityType, class MemorySpace>
+
1252using HypreSemiStructDiagonal CAJITA_DEPRECATED =
+
1253 Cabana::Grid::HypreSemiStructDiagonal<Scalar, EntityType, MemorySpace>;
+
1254
+
1255template <class... Args>
+
1256CAJITA_DEPRECATED auto createHypreSemiStructPCG( Args&&... args )
+
1257{
+
1258 return Cabana::Grid::createHypreSemiStructPCG(
+
1259 std::forward<Args>( args )... );
+
1260}
+
1261template <class... Args>
+
1262CAJITA_DEPRECATED auto createHypreSemiStructGMRES( Args&&... args )
+
1263{
+
1264 return Cabana::Grid::createHypreSemiStructGMRES(
+
1265 std::forward<Args>( args )... );
+
1266}
+
1267template <class... Args>
+
1268CAJITA_DEPRECATED auto createHypreSemiStructBiCGSTAB( Args&&... args )
+
1269{
+
1270 return Cabana::Grid::createHypreSemiStructBiCGSTAB(
+
1271 std::forward<Args>( args )... );
+
1272}
+
1273template <class... Args>
+
1274CAJITA_DEPRECATED auto createHypreSemiStructDiagonal( Args&&... args )
1275{
-
1276 return Cabana::Grid::createHypreSemiStructuredSolver<Scalar, MemorySpace>(
+
1276 return Cabana::Grid::createHypreSemiStructDiagonal(
1277 std::forward<Args>( args )... );
1278}
-
1280} // namespace Cajita
-
1281
-
1282#endif // end CABANA_GRID_HypreSemiStRUCTUREDSOLVER_HPP
+
1279
+
1280template <class Scalar, class MemorySpace, class... Args>
+
1281CAJITA_DEPRECATED auto createHypreSemiStructuredSolver( Args&&... args )
+
1282{
+
1283 return Cabana::Grid::createHypreSemiStructuredSolver<Scalar, MemorySpace>(
+
1284 std::forward<Args>( args )... );
+
1285}
+
1287} // namespace Cajita
+
1288
+
1289#endif // end CABANA_GRID_HypreSemiStRUCTUREDSOLVER_HPP
Grid field arrays.
Global grid.
-
std::shared_ptr< HypreSemiStructPCG< Scalar, typename ArrayLayout_t::entity_type, MemorySpace > > createHypreSemiStructPCG(const ArrayLayout_t &layout, const bool is_preconditioner=false, int n_vars=3)
Create a HYPRE PCG semi-structured solver.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1127
-
std::shared_ptr< HypreSemiStructuredSolver< Scalar, typename ArrayLayout_t::entity_type, MemorySpace > > createHypreSemiStructuredSolver(const std::string &solver_type, const ArrayLayout_t &layout, const bool is_preconditioner=false, int n_vars=3)
Create a HYPRE semi-structured solver.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1196
-
std::shared_ptr< HypreSemiStructBiCGSTAB< Scalar, typename ArrayLayout_t::entity_type, MemorySpace > > createHypreSemiStructBiCGSTAB(const ArrayLayout_t &layout, const bool is_preconditioner=false, int n_vars=3)
Create a HYPRE BiCGSTAB semi-structured solver.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1156
-
std::shared_ptr< HypreSemiStructGMRES< Scalar, typename ArrayLayout_t::entity_type, MemorySpace > > createHypreSemiStructGMRES(const ArrayLayout_t &layout, const bool is_preconditioner=false, int n_vars=3)
Create a HYPRE GMRES semi-structured solver.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1141
-
std::shared_ptr< HypreSemiStructDiagonal< Scalar, typename ArrayLayout_t::entity_type, MemorySpace > > createHypreSemiStructDiagonal(const ArrayLayout_t &layout, const bool is_preconditioner=false, int n_vars=3)
Create a HYPRE Diagonal semi-structured solver.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1171
+
std::shared_ptr< HypreSemiStructPCG< Scalar, typename ArrayLayout_t::entity_type, MemorySpace > > createHypreSemiStructPCG(const ArrayLayout_t &layout, const bool is_preconditioner=false, int n_vars=3)
Create a HYPRE PCG semi-structured solver.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1134
+
std::shared_ptr< HypreSemiStructuredSolver< Scalar, typename ArrayLayout_t::entity_type, MemorySpace > > createHypreSemiStructuredSolver(const std::string &solver_type, const ArrayLayout_t &layout, const bool is_preconditioner=false, int n_vars=3)
Create a HYPRE semi-structured solver.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1203
+
std::shared_ptr< HypreSemiStructBiCGSTAB< Scalar, typename ArrayLayout_t::entity_type, MemorySpace > > createHypreSemiStructBiCGSTAB(const ArrayLayout_t &layout, const bool is_preconditioner=false, int n_vars=3)
Create a HYPRE BiCGSTAB semi-structured solver.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1163
+
std::shared_ptr< HypreSemiStructGMRES< Scalar, typename ArrayLayout_t::entity_type, MemorySpace > > createHypreSemiStructGMRES(const ArrayLayout_t &layout, const bool is_preconditioner=false, int n_vars=3)
Create a HYPRE GMRES semi-structured solver.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1148
+
std::shared_ptr< HypreSemiStructDiagonal< Scalar, typename ArrayLayout_t::entity_type, MemorySpace > > createHypreSemiStructDiagonal(const ArrayLayout_t &layout, const bool is_preconditioner=false, int n_vars=3)
Create a HYPRE Diagonal semi-structured solver.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1178
HYPRE memory space handling.
Logical grid indexing.
KOKKOS_INLINE_FUNCTION auto createSubview(const ViewType &view, const IndexSpace< 1 > &index_space) -> decltype(Kokkos::subview(view, index_space.range(0)))
Given a view create a subview over the given index space.
Definition Cabana_Grid_IndexSpace.hpp:369
Local grid.
Grid type tags.
Cabana utilities.
-
BiCGSTAB solver.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:921
-
double getFinalRelativeResidualNormImpl() override
Get the relative residual norm achieved on the last solve.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1011
-
HYPRE_PtrToSStructSolverFcn getHypreSetupFunction() const override
Get the preconditioner setup function.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:960
-
void setLogging(const int logging)
Set the amount of logging to do.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:953
-
HypreSemiStructBiCGSTAB(const ArrayLayout_t &layout, const bool is_preconditioner=false, int n_vars=3)
Constructor.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:927
-
HYPRE_SStructSolver getHypreSolver() const override
Get the preconditioner.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:959
-
int getNumIterImpl() override
Get the number of iterations taken on the last solve.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1002
-
void setPrintLevelImpl(const int print_level) override
Set the output level.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:982
-
void setMaxIterImpl(const int max_iter) override
Set maximum iteration implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:976
-
HYPRE_PtrToSStructSolverFcn getHypreSolveFunction() const override
Get the preconditioner solve function.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:964
-
void setPreconditionerImpl(const HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace > &preconditioner) override
Set a preconditioner.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1020
-
void setAbsoluteTol(const double tol)
Set the absolute tolerance.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:946
-
void solveImpl(HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x) override
Solver implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:995
-
void setToleranceImpl(const double tol) override
Set convergence tolerance implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:970
-
void setupImpl(HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x) override
Setup implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:988
-
Diagonal preconditioner.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1040
-
void setMaxIterImpl(const int) override
Set maximum iteration implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1073
-
int getNumIterImpl() override
Get the number of iterations taken on the last solve.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1099
-
HYPRE_PtrToSStructSolverFcn getHypreSolveFunction() const override
Get the preconditioner solve function.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1061
-
void solveImpl(HYPRE_SStructMatrix, HYPRE_SStructVector, HYPRE_SStructVector) override
Solver implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1092
-
void setPrintLevelImpl(const int) override
Set the output level.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1079
-
void setToleranceImpl(const double) override
Set convergence tolerance implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1067
-
void setPreconditionerImpl(const HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace > &) override
Set a preconditioner.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1111
-
void setupImpl(HYPRE_SStructMatrix, HYPRE_SStructVector, HYPRE_SStructVector) override
Setup implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1085
-
HypreSemiStructDiagonal(const ArrayLayout_t &layout, const bool is_preconditioner=false, int n_vars=3)
Constructor.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1046
-
double getFinalRelativeResidualNormImpl() override
Get the relative residual norm achieved on the last solve.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1105
-
HYPRE_SStructSolver getHypreSolver() const override
Get the preconditioner.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1056
-
HYPRE_PtrToSStructSolverFcn getHypreSetupFunction() const override
Get the preconditioner setup function.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1057
-
GMRES solver.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:797
-
void setPrintLevelImpl(const int print_level) override
Set the output level.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:864
-
HypreSemiStructGMRES(const ArrayLayout_t &layout, int n_vars, const bool is_preconditioner=false)
Constructor.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:803
-
void setMaxIterImpl(const int max_iter) override
Set maximum iteration implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:858
-
void setToleranceImpl(const double tol) override
Set convergence tolerance implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:852
-
int getNumIterImpl() override
Get the number of iterations taken on the last solve.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:884
-
HYPRE_PtrToSStructSolverFcn getHypreSolveFunction() const override
Get the preconditioner solve function.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:846
-
void solveImpl(HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x) override
Solver implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:877
-
double getFinalRelativeResidualNormImpl() override
Get the relative residual norm achieved on the last solve.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:892
-
void setKDim(const int k_dim)
Set the max size of the Krylov space.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:828
-
HYPRE_PtrToSStructSolverFcn getHypreSetupFunction() const override
Get the preconditioner setup function.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:842
-
HYPRE_SStructSolver getHypreSolver() const override
Get the preconditioner.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:841
-
void setLogging(const int logging)
Set the amount of logging to do.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:835
-
void setupImpl(HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x) override
Setup implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:870
-
void setPreconditionerImpl(const HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace > &preconditioner) override
Set a preconditioner.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:901
-
void setAbsoluteTol(const double tol)
Set the absolute tolerance.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:821
-
PCG solver.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:670
-
HypreSemiStructPCG(const ArrayLayout_t &layout, int n_vars, const bool is_preconditioner=false)
Constructor.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:676
-
void setupImpl(HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x) override
Setup implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:746
-
HYPRE_PtrToSStructSolverFcn getHypreSolveFunction() const override
Get the preconditioner solve function.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:722
-
void setLogging(const int logging)
Set the amount of logging to do.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:711
-
double getFinalRelativeResidualNormImpl() override
Get the relative residual norm achieved on the last solve.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:768
-
HYPRE_PtrToSStructSolverFcn getHypreSetupFunction() const override
Get the preconditioner setup function.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:718
-
void solveImpl(HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x) override
Solver implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:753
-
void setPreconditionerImpl(const HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace > &preconditioner) override
Set a preconditioner.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:777
-
void setPrintLevelImpl(const int print_level) override
Set the output level.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:740
-
void setRelChange(const int rel_change)
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:704
-
void setMaxIterImpl(const int max_iter) override
Set maximum iteration implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:734
-
HYPRE_SStructSolver getHypreSolver() const override
Get the preconditioner.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:717
-
void setAbsoluteTol(const double tol)
Set the absolute tolerance.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:696
-
int getNumIterImpl() override
Get the number of iterations taken on the last solve.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:760
-
void setToleranceImpl(const double tol) override
Set convergence tolerance implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:728
+
BiCGSTAB solver.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:927
+
void solveImpl() override
Solver implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1001
+
double getFinalRelativeResidualNormImpl() override
Get the relative residual norm achieved on the last solve.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1016
+
HYPRE_PtrToSStructSolverFcn getHypreSetupFunction() const override
Get the preconditioner setup function.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:967
+
void setupImpl() override
Setup implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:995
+
void setLogging(const int logging)
Set the amount of logging to do.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:960
+
HypreSemiStructBiCGSTAB(const ArrayLayout_t &layout, const bool is_preconditioner=false, int n_vars=3)
Constructor.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:934
+
HYPRE_SStructSolver getHypreSolver() const override
Get the preconditioner.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:966
+
int getNumIterImpl() override
Get the number of iterations taken on the last solve.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1007
+
void setPrintLevelImpl(const int print_level) override
Set the output level.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:989
+
void setMaxIterImpl(const int max_iter) override
Set maximum iteration implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:983
+
HYPRE_PtrToSStructSolverFcn getHypreSolveFunction() const override
Get the preconditioner solve function.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:971
+
void setPreconditionerImpl(const HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace > &preconditioner) override
Set a preconditioner.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1025
+
void setAbsoluteTol(const double tol)
Set the absolute tolerance.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:953
+
void setToleranceImpl(const double tol) override
Set convergence tolerance implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:977
+
Diagonal preconditioner.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1048
+
void setMaxIterImpl(const int) override
Set maximum iteration implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1082
+
int getNumIterImpl() override
Get the number of iterations taken on the last solve.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1106
+
HYPRE_PtrToSStructSolverFcn getHypreSolveFunction() const override
Get the preconditioner solve function.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1070
+
void setPrintLevelImpl(const int) override
Set the output level.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1088
+
void setToleranceImpl(const double) override
Set convergence tolerance implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1076
+
void solveImpl() override
Solver implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1100
+
void setPreconditionerImpl(const HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace > &) override
Set a preconditioner.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1118
+
HypreSemiStructDiagonal(const ArrayLayout_t &layout, const bool is_preconditioner=false, int n_vars=3)
Constructor.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1055
+
double getFinalRelativeResidualNormImpl() override
Get the relative residual norm achieved on the last solve.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1112
+
HYPRE_SStructSolver getHypreSolver() const override
Get the preconditioner.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1065
+
void setupImpl() override
Setup implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1094
+
HYPRE_PtrToSStructSolverFcn getHypreSetupFunction() const override
Get the preconditioner setup function.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:1066
+
GMRES solver.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:801
+
void setPrintLevelImpl(const int print_level) override
Set the output level.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:869
+
HypreSemiStructGMRES(const ArrayLayout_t &layout, int n_vars, const bool is_preconditioner=false)
Constructor.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:808
+
void setMaxIterImpl(const int max_iter) override
Set maximum iteration implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:863
+
void setToleranceImpl(const double tol) override
Set convergence tolerance implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:857
+
int getNumIterImpl() override
Get the number of iterations taken on the last solve.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:887
+
HYPRE_PtrToSStructSolverFcn getHypreSolveFunction() const override
Get the preconditioner solve function.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:851
+
double getFinalRelativeResidualNormImpl() override
Get the relative residual norm achieved on the last solve.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:895
+
void setKDim(const int k_dim)
Set the max size of the Krylov space.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:833
+
void solveImpl() override
Solver implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:881
+
void setupImpl() override
Setup implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:875
+
HYPRE_PtrToSStructSolverFcn getHypreSetupFunction() const override
Get the preconditioner setup function.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:847
+
HYPRE_SStructSolver getHypreSolver() const override
Get the preconditioner.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:846
+
void setLogging(const int logging)
Set the amount of logging to do.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:840
+
void setPreconditionerImpl(const HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace > &preconditioner) override
Set a preconditioner.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:904
+
void setAbsoluteTol(const double tol)
Set the absolute tolerance.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:826
+
PCG solver.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:672
+
HypreSemiStructPCG(const ArrayLayout_t &layout, int n_vars, const bool is_preconditioner=false)
Constructor.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:679
+
HYPRE_PtrToSStructSolverFcn getHypreSolveFunction() const override
Get the preconditioner solve function.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:725
+
void setLogging(const int logging)
Set the amount of logging to do.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:714
+
double getFinalRelativeResidualNormImpl() override
Get the relative residual norm achieved on the last solve.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:769
+
HYPRE_PtrToSStructSolverFcn getHypreSetupFunction() const override
Get the preconditioner setup function.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:721
+
void setPreconditionerImpl(const HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace > &preconditioner) override
Set a preconditioner.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:778
+
void solveImpl() override
Solver implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:755
+
void setPrintLevelImpl(const int print_level) override
Set the output level.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:743
+
void setRelChange(const int rel_change)
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:707
+
void setMaxIterImpl(const int max_iter) override
Set maximum iteration implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:737
+
HYPRE_SStructSolver getHypreSolver() const override
Get the preconditioner.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:720
+
void setupImpl() override
Setup implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:749
+
void setAbsoluteTol(const double tol)
Set the absolute tolerance.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:699
+
int getNumIterImpl() override
Get the number of iterations taken on the last solve.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:761
+
void setToleranceImpl(const double tol) override
Set convergence tolerance implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:731
Hypre semi-structured solver interface for scalar fields.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:52
virtual void setToleranceImpl(const double tol)=0
Set convergence tolerance implementation.
-
virtual void setupImpl(HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x)=0
Setup implementation.
void setup()
Setup the problem.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:476
void printLHS(const char *prefix)
Print the hypre LHS to ouput file.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:431
const int object_type
Object Type for SStruct.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:61
@@ -1477,11 +1480,13 @@
void solve(const Array_t &b, Array_t &x, int n_vars=3)
Solve the problem Ax = b for x.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:495
void setMaxIter(const int max_iter)
Set maximum iteration implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:449
virtual int getNumIterImpl()=0
Get the number of iterations taken on the last solve.
+
HYPRE_SStructMatrix _A
Matrix for the problem Ax = b.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:647
virtual double getFinalRelativeResidualNormImpl()=0
Get the relative residual norm achieved on the last solve.
virtual void setPreconditionerImpl(const HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace > &preconditioner)=0
Set a preconditioner.
double getFinalRelativeResidualNorm()
Get the relative residual norm achieved on the last solve.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:592
void setMatrixValues(const Array_t &values, int v_x, int v_h)
Set the matrix values.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:357
void setTolerance(const double tol)
Set convergence tolerance implementation.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:446
+
virtual void solveImpl()=0
Solver implementation.
virtual void setMaxIterImpl(const int max_iter)=0
Set maximum iteration implementation.
HypreSemiStructuredSolver(const ArrayLayout_t &layout, int n_vars, const bool is_preconditioner=false)
Hypre memory space compatibility check.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:74
MemorySpace memory_space
Kokkos memory space..
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:57
@@ -1489,14 +1494,16 @@
void setSolverGraph(int n_vars)
Set the solver graph.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:301
void printRHS(const char *prefix)
Print the hypre RHS to ouput file.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:440
EntityType entity_type
Entity type.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:55
-
void checkHypreError(const int error) const
Check a hypre error.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:634
+
void checkHypreError(const int error) const
Check a hypre error.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:632
+
virtual void setupImpl()=0
Setup implementation.
void createMatrixStencil(int NumSpaceDim, int var=0, int n_vars=3, std::vector< unsigned > stencil_length={ 7, 7, 7 })
Create the operator stencil to be filled by setMatrixStencil.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:239
void setMatrixStencil(const std::vector< std::array< int, NumSpaceDim > > &stencil, int var=0, int dep=0)
Set the operator stencil.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:275
+
HYPRE_SStructVector _x
Solution to the problem Ax = b.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:651
bool isPreconditioner() const
Return if this solver is a preconditioner.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:227
virtual HYPRE_PtrToSStructSolverFcn getHypreSolveFunction() const =0
Get the preconditioner solve function.
void printMatrix(const char *prefix)
Print the hypre matrix to ouput file.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:422
Scalar value_type
Scalar value type.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:59
-
virtual void solveImpl(HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x)=0
Solver implementation.
+
HYPRE_SStructVector _b
Forcing term for the problem Ax = b.
Definition Cabana_Grid_HypreSemiStructuredSolver.hpp:649
virtual HYPRE_SStructSolver getHypreSolver() const =0
Get the preconditioner.
Structured index space.
Definition Cabana_Grid_IndexSpace.hpp:37
Core: particle data structures and algorithms.
Definition Cabana_AoSoA.hpp:36
diff --git a/doxygen/Cabana__Grid__HypreStructuredSolver_8hpp_source.html b/doxygen/Cabana__Grid__HypreStructuredSolver_8hpp_source.html index b8cd83c91..296f47e26 100644 --- a/doxygen/Cabana__Grid__HypreStructuredSolver_8hpp_source.html +++ b/doxygen/Cabana__Grid__HypreStructuredSolver_8hpp_source.html @@ -210,24 +210,24 @@
138 "vector_values", reorder_space );
139 Kokkos::deep_copy( vector_values, 0.0 );
140
-
141 error = HYPRE_StructVectorCreate( _comm, _grid, &_b );
+
141 error = HYPRE_StructVectorCreate( _comm, _grid, &_b );
142 checkHypreError( error );
-
143 error = HYPRE_StructVectorInitialize( _b );
+
143 error = HYPRE_StructVectorInitialize( _b );
144 checkHypreError( error );
145 error = HYPRE_StructVectorSetBoxValues(
-
146 _b, _lower.data(), _upper.data(), vector_values.data() );
+
146 _b, _lower.data(), _upper.data(), vector_values.data() );
147 checkHypreError( error );
-
148 error = HYPRE_StructVectorAssemble( _b );
+
148 error = HYPRE_StructVectorAssemble( _b );
149 checkHypreError( error );
150
-
151 error = HYPRE_StructVectorCreate( _comm, _grid, &_x );
+
151 error = HYPRE_StructVectorCreate( _comm, _grid, &_x );
152 checkHypreError( error );
-
153 error = HYPRE_StructVectorInitialize( _x );
+
153 error = HYPRE_StructVectorInitialize( _x );
154 checkHypreError( error );
155 error = HYPRE_StructVectorSetBoxValues(
-
156 _x, _lower.data(), _upper.data(), vector_values.data() );
+
156 _x, _lower.data(), _upper.data(), vector_values.data() );
157 checkHypreError( error );
-
158 error = HYPRE_StructVectorAssemble( _x );
+
158 error = HYPRE_StructVectorAssemble( _x );
159 checkHypreError( error );
160 }
161 }
@@ -239,9 +239,9 @@
166 // We only make data if this is not a preconditioner.
167 if ( !_is_preconditioner )
168 {
-
169 HYPRE_StructVectorDestroy( _x );
-
170 HYPRE_StructVectorDestroy( _b );
-
171 HYPRE_StructMatrixDestroy( _A );
+
169 HYPRE_StructVectorDestroy( _x );
+
170 HYPRE_StructVectorDestroy( _b );
+
171 HYPRE_StructMatrixDestroy( _A );
172 HYPRE_StructStencilDestroy( _stencil );
173 HYPRE_StructGridDestroy( _grid );
174 }
@@ -275,11 +275,11 @@
210 }
211
212 // Create the matrix object. Must be done after the stencil is setup
-
213 error = HYPRE_StructMatrixCreate( _comm, _grid, _stencil, &_A );
+
213 error = HYPRE_StructMatrixCreate( _comm, _grid, _stencil, &_A );
214 checkHypreError( error );
-
215 error = HYPRE_StructMatrixSetSymmetric( _A, is_symmetric );
+
215 error = HYPRE_StructMatrixSetSymmetric( _A, is_symmetric );
216 checkHypreError( error );
-
217 error = HYPRE_StructMatrixInitialize( _A );
+
217 error = HYPRE_StructMatrixInitialize( _A );
218 checkHypreError( error );
219 }
@@ -333,10 +333,10 @@
274 std::vector<HYPRE_Int> indices( _stencil_size );
275 std::iota( indices.begin(), indices.end(), 0 );
276 auto error = HYPRE_StructMatrixSetBoxValues(
-
277 _A, _lower.data(), _upper.data(), indices.size(), indices.data(),
+
277 _A, _lower.data(), _upper.data(), indices.size(), indices.data(),
278 a_values.data() );
279 checkHypreError( error );
-
280 error = HYPRE_StructMatrixAssemble( _A );
+
280 error = HYPRE_StructMatrixAssemble( _A );
281 checkHypreError( error );
282 }
@@ -344,21 +344,21 @@
288 void printMatrix( const char* prefix )
289 {
-
290 HYPRE_StructMatrixPrint( prefix, _A, 0 );
+
290 HYPRE_StructMatrixPrint( prefix, _A, 0 );
291 }
292
297 void printLHS( const char* prefix )
298 {
-
299 HYPRE_StructVectorPrint( prefix, _x, 0 );
+
299 HYPRE_StructVectorPrint( prefix, _x, 0 );
300 }
301
306 void printRHS( const char* prefix )
307 {
-
308 HYPRE_StructVectorPrint( prefix, _b, 0 );
+
308 HYPRE_StructVectorPrint( prefix, _b, 0 );
309 }
310
@@ -400,7 +400,7 @@
346 throw std::logic_error( "Cannot call setup() on preconditioners" );
347
348 // FIXME: appears to be a memory issue in the call to this function
-
349 this->setupImpl( _A, _b, _x );
+
349 this->setupImpl();
350 }
351
@@ -452,17 +452,17 @@
401
402 // Insert b values into the HYPRE vector.
403 auto error = HYPRE_StructVectorSetBoxValues(
-
404 _b, _lower.data(), _upper.data(), vector_values.data() );
+
404 _b, _lower.data(), _upper.data(), vector_values.data() );
405 checkHypreError( error );
-
406 error = HYPRE_StructVectorAssemble( _b );
+
406 error = HYPRE_StructVectorAssemble( _b );
407 checkHypreError( error );
408
409 // Solve the problem
-
410 this->solveImpl( _A, _b, _x );
+
410 this->solveImpl();
411
412 // Extract the solution from the LHS
413 error = HYPRE_StructVectorGetBoxValues(
-
414 _x, _lower.data(), _upper.data(), vector_values.data() );
+
414 _x, _lower.data(), _upper.data(), vector_values.data() );
415 checkHypreError( error );
416
417 // Copy the HYPRE solution to the LHS.
@@ -493,1430 +493,1436 @@
446
448 virtual void setPrintLevelImpl( const int print_level ) = 0;
449
-
451 virtual void setupImpl( HYPRE_StructMatrix A, HYPRE_StructVector b,
-
452 HYPRE_StructVector x ) = 0;
-
453
-
455 virtual void solveImpl( HYPRE_StructMatrix A, HYPRE_StructVector b,
-
456 HYPRE_StructVector x ) = 0;
-
457
-
459 virtual int getNumIterImpl() = 0;
-
460
-
462 virtual double getFinalRelativeResidualNormImpl() = 0;
-
463
-
465 virtual void setPreconditionerImpl(
-
466 const HypreStructuredSolver<Scalar, EntityType, MemorySpace>&
-
467 preconditioner ) = 0;
-
468
-
-
470 void checkHypreError( const int error ) const
-
471 {
-
472 if ( error > 0 )
-
473 {
-
474 char error_msg[256];
-
475 HYPRE_DescribeError( error, error_msg );
-
476 std::stringstream out;
-
477 out << "HYPRE structured solver error: ";
-
478 out << error << " " << error_msg;
-
479 HYPRE_ClearError( error );
-
480 throw std::runtime_error( out.str() );
-
481 }
-
482 }
-
-
483
-
484 private:
-
485 MPI_Comm _comm;
-
486 bool _is_preconditioner;
-
487 HYPRE_StructGrid _grid;
-
488 std::vector<HYPRE_Int> _lower;
-
489 std::vector<HYPRE_Int> _upper;
-
490 HYPRE_StructStencil _stencil;
-
491 unsigned _stencil_size;
-
492 HYPRE_StructMatrix _A;
-
493 HYPRE_StructVector _b;
-
494 HYPRE_StructVector _x;
-
495 std::shared_ptr<HypreStructuredSolver<Scalar, EntityType, MemorySpace>>
-
496 _preconditioner;
-
497};
- -
498
-
499//---------------------------------------------------------------------------//
-
501template <class Scalar, class EntityType, class MemorySpace>
-
- -
503 : public HypreStructuredSolver<Scalar, EntityType, MemorySpace>
-
504{
-
505 public:
- -
509 template <class ArrayLayout_t>
-
-
510 HypreStructPCG( const ArrayLayout_t& layout,
-
511 const bool is_preconditioner = false )
-
512 : Base( layout, is_preconditioner )
-
513 {
-
514 if ( is_preconditioner )
-
515 throw std::logic_error(
-
516 "HYPRE PCG cannot be used as a preconditioner" );
-
517
-
518 auto error = HYPRE_StructPCGCreate(
-
519 layout.localGrid()->globalGrid().comm(), &_solver );
-
520 this->checkHypreError( error );
-
521
-
522 HYPRE_StructPCGSetTwoNorm( _solver, 1 );
-
523 }
-
+
451 virtual void setupImpl() = 0;
+
452
+
454 virtual void solveImpl() = 0;
+
455
+
457 virtual int getNumIterImpl() = 0;
+
458
+ +
461
+ + +
465 preconditioner ) = 0;
+
466
+
+
468 void checkHypreError( const int error ) const
+
469 {
+
470 if ( error > 0 )
+
471 {
+
472 char error_msg[256];
+
473 HYPRE_DescribeError( error, error_msg );
+
474 std::stringstream out;
+
475 out << "HYPRE structured solver error: ";
+
476 out << error << " " << error_msg;
+
477 HYPRE_ClearError( error );
+
478 throw std::runtime_error( out.str() );
+
479 }
+
480 }
+
+
481
+
482 protected:
+
484 HYPRE_StructMatrix _A;
+
486 HYPRE_StructVector _b;
+
488 HYPRE_StructVector _x;
+
489
+
490 private:
+
491 MPI_Comm _comm;
+
492 bool _is_preconditioner;
+
493 HYPRE_StructGrid _grid;
+
494 std::vector<HYPRE_Int> _lower;
+
495 std::vector<HYPRE_Int> _upper;
+
496 HYPRE_StructStencil _stencil;
+
497 unsigned _stencil_size;
+
498 std::shared_ptr<HypreStructuredSolver<Scalar, EntityType, MemorySpace>>
+
499 _preconditioner;
+
500};
+
+
501
+
502//---------------------------------------------------------------------------//
+
504template <class Scalar, class EntityType, class MemorySpace>
+
+ +
506 : public HypreStructuredSolver<Scalar, EntityType, MemorySpace>
+
507{
+
508 public:
+ +
512 template <class ArrayLayout_t>
+
+
513 HypreStructPCG( const ArrayLayout_t& layout,
+
514 const bool is_preconditioner = false )
+
515 : base_type( layout, is_preconditioner )
+
516 {
+
517 if ( is_preconditioner )
+
518 throw std::logic_error(
+
519 "HYPRE PCG cannot be used as a preconditioner" );
+
520
+
521 auto error = HYPRE_StructPCGCreate(
+
522 layout.localGrid()->globalGrid().comm(), &_solver );
+
523 this->checkHypreError( error );
524
-
525 ~HypreStructPCG() { HYPRE_StructPCGDestroy( _solver ); }
-
526
-
527 // PCG SETTINGS
-
528
-
-
530 void setAbsoluteTol( const double tol )
-
531 {
-
532 auto error = HYPRE_StructPCGSetAbsoluteTol( _solver, tol );
-
533 this->checkHypreError( error );
-
534 }
-
-
535
-
-
538 void setRelChange( const int rel_change )
-
539 {
-
540 auto error = HYPRE_StructPCGSetRelChange( _solver, rel_change );
-
541 this->checkHypreError( error );
-
542 }
-
-
543
-
-
545 void setLogging( const int logging )
-
546 {
-
547 auto error = HYPRE_StructPCGSetLogging( _solver, logging );
-
548 this->checkHypreError( error );
-
549 }
-
-
550
-
551 HYPRE_StructSolver getHypreSolver() const override { return _solver; }
-
-
552 HYPRE_PtrToStructSolverFcn getHypreSetupFunction() const override
-
553 {
-
554 return HYPRE_StructPCGSetup;
-
555 }
-
-
-
556 HYPRE_PtrToStructSolverFcn getHypreSolveFunction() const override
-
557 {
-
558 return HYPRE_StructPCGSolve;
-
559 }
-
-
560
-
561 protected:
-
-
562 void setToleranceImpl( const double tol ) override
-
563 {
-
564 auto error = HYPRE_StructPCGSetTol( _solver, tol );
-
565 this->checkHypreError( error );
-
566 }
-
-
567
-
-
568 void setMaxIterImpl( const int max_iter ) override
-
569 {
-
570 auto error = HYPRE_StructPCGSetMaxIter( _solver, max_iter );
-
571 this->checkHypreError( error );
-
572 }
-
-
573
-
-
574 void setPrintLevelImpl( const int print_level ) override
-
575 {
-
576 auto error = HYPRE_StructPCGSetPrintLevel( _solver, print_level );
-
577 this->checkHypreError( error );
-
578 }
-
-
579
-
-
580 void setupImpl( HYPRE_StructMatrix A, HYPRE_StructVector b,
-
581 HYPRE_StructVector x ) override
-
582 {
-
583 auto error = HYPRE_StructPCGSetup( _solver, A, b, x );
-
584 this->checkHypreError( error );
-
585 }
-
-
586
-
-
587 void solveImpl( HYPRE_StructMatrix A, HYPRE_StructVector b,
-
588 HYPRE_StructVector x ) override
-
589 {
-
590 auto error = HYPRE_StructPCGSolve( _solver, A, b, x );
-
591 this->checkHypreError( error );
-
592 }
-
-
593
-
-
594 int getNumIterImpl() override
-
595 {
-
596 HYPRE_Int num_iter;
-
597 auto error = HYPRE_StructPCGGetNumIterations( _solver, &num_iter );
-
598 this->checkHypreError( error );
-
599 return num_iter;
-
600 }
-
-
601
-
- -
603 {
-
604 HYPRE_Real norm;
-
605 auto error =
-
606 HYPRE_StructPCGGetFinalRelativeResidualNorm( _solver, &norm );
-
607 this->checkHypreError( error );
-
608 return norm;
-
609 }
-
-
610
-
- - -
613 preconditioner ) override
-
614 {
-
615 auto error = HYPRE_StructPCGSetPrecond(
-
616 _solver, preconditioner.getHypreSolveFunction(),
-
617 preconditioner.getHypreSetupFunction(),
-
618 preconditioner.getHypreSolver() );
-
619 this->checkHypreError( error );
-
620 }
-
-
621
-
622 private:
-
623 HYPRE_StructSolver _solver;
-
624};
-
-
625
-
626//---------------------------------------------------------------------------//
-
628template <class Scalar, class EntityType, class MemorySpace>
-
- -
630 : public HypreStructuredSolver<Scalar, EntityType, MemorySpace>
-
631{
-
632 public:
- -
636 template <class ArrayLayout_t>
-
-
637 HypreStructGMRES( const ArrayLayout_t& layout,
-
638 const bool is_preconditioner = false )
-
639 : Base( layout, is_preconditioner )
-
640 {
-
641 if ( is_preconditioner )
-
642 throw std::logic_error(
-
643 "HYPRE GMRES cannot be used as a preconditioner" );
-
644
-
645 auto error = HYPRE_StructGMRESCreate(
-
646 layout.localGrid()->globalGrid().comm(), &_solver );
-
647 this->checkHypreError( error );
-
648 }
-
-
649
-
650 ~HypreStructGMRES() { HYPRE_StructGMRESDestroy( _solver ); }
-
651
-
652 // GMRES SETTINGS
-
653
-
-
655 void setAbsoluteTol( const double tol )
-
656 {
-
657 auto error = HYPRE_StructGMRESSetAbsoluteTol( _solver, tol );
-
658 this->checkHypreError( error );
-
659 }
-
-
660
-
-
662 void setKDim( const int k_dim )
-
663 {
-
664 auto error = HYPRE_StructGMRESSetKDim( _solver, k_dim );
-
665 this->checkHypreError( error );
-
666 }
-
-
667
-
-
669 void setLogging( const int logging )
-
670 {
-
671 auto error = HYPRE_StructGMRESSetLogging( _solver, logging );
-
672 this->checkHypreError( error );
-
673 }
-
-
674
-
675 HYPRE_StructSolver getHypreSolver() const override { return _solver; }
-
-
676 HYPRE_PtrToStructSolverFcn getHypreSetupFunction() const override
-
677 {
-
678 return HYPRE_StructGMRESSetup;
-
679 }
+
525 HYPRE_StructPCGSetTwoNorm( _solver, 1 );
+
526 }
+
+
527
+
528 ~HypreStructPCG() { HYPRE_StructPCGDestroy( _solver ); }
+
529
+
530 // PCG SETTINGS
+
531
+
+
533 void setAbsoluteTol( const double tol )
+
534 {
+
535 auto error = HYPRE_StructPCGSetAbsoluteTol( _solver, tol );
+
536 this->checkHypreError( error );
+
537 }
+
+
538
+
+
541 void setRelChange( const int rel_change )
+
542 {
+
543 auto error = HYPRE_StructPCGSetRelChange( _solver, rel_change );
+
544 this->checkHypreError( error );
+
545 }
+
+
546
+
+
548 void setLogging( const int logging )
+
549 {
+
550 auto error = HYPRE_StructPCGSetLogging( _solver, logging );
+
551 this->checkHypreError( error );
+
552 }
+
+
553
+
554 HYPRE_StructSolver getHypreSolver() const override { return _solver; }
+
+
555 HYPRE_PtrToStructSolverFcn getHypreSetupFunction() const override
+
556 {
+
557 return HYPRE_StructPCGSetup;
+
558 }
+
+
+
559 HYPRE_PtrToStructSolverFcn getHypreSolveFunction() const override
+
560 {
+
561 return HYPRE_StructPCGSolve;
+
562 }
+
+
563
+
564 protected:
+
+
565 void setToleranceImpl( const double tol ) override
+
566 {
+
567 auto error = HYPRE_StructPCGSetTol( _solver, tol );
+
568 this->checkHypreError( error );
+
569 }
+
+
570
+
+
571 void setMaxIterImpl( const int max_iter ) override
+
572 {
+
573 auto error = HYPRE_StructPCGSetMaxIter( _solver, max_iter );
+
574 this->checkHypreError( error );
+
575 }
+
+
576
+
+
577 void setPrintLevelImpl( const int print_level ) override
+
578 {
+
579 auto error = HYPRE_StructPCGSetPrintLevel( _solver, print_level );
+
580 this->checkHypreError( error );
+
581 }
+
+
582
+
+
583 void setupImpl() override
+
584 {
+
585 auto error = HYPRE_StructPCGSetup( _solver, _A, _b, _x );
+
586 this->checkHypreError( error );
+
587 }
+
+
588
+
+
589 void solveImpl() override
+
590 {
+
591 auto error = HYPRE_StructPCGSolve( _solver, _A, _b, _x );
+
592 this->checkHypreError( error );
+
593 }
+
+
594
+
+
595 int getNumIterImpl() override
+
596 {
+
597 HYPRE_Int num_iter;
+
598 auto error = HYPRE_StructPCGGetNumIterations( _solver, &num_iter );
+
599 this->checkHypreError( error );
+
600 return num_iter;
+
601 }
+
+
602
+
+ +
604 {
+
605 HYPRE_Real norm;
+
606 auto error =
+
607 HYPRE_StructPCGGetFinalRelativeResidualNorm( _solver, &norm );
+
608 this->checkHypreError( error );
+
609 return norm;
+
610 }
+
+
611
+
+ + +
614 preconditioner ) override
+
615 {
+
616 auto error = HYPRE_StructPCGSetPrecond(
+
617 _solver, preconditioner.getHypreSolveFunction(),
+
618 preconditioner.getHypreSetupFunction(),
+
619 preconditioner.getHypreSolver() );
+
620 this->checkHypreError( error );
+
621 }
+
+
622
+
623 private:
+
624 HYPRE_StructSolver _solver;
+
625 using base_type::_A;
+
626 using base_type::_b;
+
627 using base_type::_x;
+
628};
+
+
629
+
630//---------------------------------------------------------------------------//
+
632template <class Scalar, class EntityType, class MemorySpace>
+
+ +
634 : public HypreStructuredSolver<Scalar, EntityType, MemorySpace>
+
635{
+
636 public:
+ +
640 template <class ArrayLayout_t>
+
+
641 HypreStructGMRES( const ArrayLayout_t& layout,
+
642 const bool is_preconditioner = false )
+
643 : base_type( layout, is_preconditioner )
+
644 {
+
645 if ( is_preconditioner )
+
646 throw std::logic_error(
+
647 "HYPRE GMRES cannot be used as a preconditioner" );
+
648
+
649 auto error = HYPRE_StructGMRESCreate(
+
650 layout.localGrid()->globalGrid().comm(), &_solver );
+
651 this->checkHypreError( error );
+
652 }
+
653
+
654 ~HypreStructGMRES() { HYPRE_StructGMRESDestroy( _solver ); }
+
655
+
656 // GMRES SETTINGS
+
657
+
+
659 void setAbsoluteTol( const double tol )
+
660 {
+
661 auto error = HYPRE_StructGMRESSetAbsoluteTol( _solver, tol );
+
662 this->checkHypreError( error );
+
663 }
+
+
664
+
+
666 void setKDim( const int k_dim )
+
667 {
+
668 auto error = HYPRE_StructGMRESSetKDim( _solver, k_dim );
+
669 this->checkHypreError( error );
+
670 }
+
+
671
+
+
673 void setLogging( const int logging )
+
674 {
+
675 auto error = HYPRE_StructGMRESSetLogging( _solver, logging );
+
676 this->checkHypreError( error );
+
677 }
+
+
678
+
679 HYPRE_StructSolver getHypreSolver() const override { return _solver; }
-
680 HYPRE_PtrToStructSolverFcn getHypreSolveFunction() const override
+
680 HYPRE_PtrToStructSolverFcn getHypreSetupFunction() const override
681 {
-
682 return HYPRE_StructGMRESSolve;
+
682 return HYPRE_StructGMRESSetup;
683 }
-
684
-
685 protected:
-
-
686 void setToleranceImpl( const double tol ) override
-
687 {
-
688 auto error = HYPRE_StructGMRESSetTol( _solver, tol );
-
689 this->checkHypreError( error );
-
690 }
-
-
691
-
-
692 void setMaxIterImpl( const int max_iter ) override
-
693 {
-
694 auto error = HYPRE_StructGMRESSetMaxIter( _solver, max_iter );
-
695 this->checkHypreError( error );
-
696 }
-
-
697
-
-
698 void setPrintLevelImpl( const int print_level ) override
-
699 {
-
700 auto error = HYPRE_StructGMRESSetPrintLevel( _solver, print_level );
-
701 this->checkHypreError( error );
-
702 }
-
-
703
-
-
704 void setupImpl( HYPRE_StructMatrix A, HYPRE_StructVector b,
-
705 HYPRE_StructVector x ) override
-
706 {
-
707 auto error = HYPRE_StructGMRESSetup( _solver, A, b, x );
-
708 this->checkHypreError( error );
-
709 }
-
-
710
-
-
711 void solveImpl( HYPRE_StructMatrix A, HYPRE_StructVector b,
-
712 HYPRE_StructVector x ) override
-
713 {
-
714 auto error = HYPRE_StructGMRESSolve( _solver, A, b, x );
-
715 this->checkHypreError( error );
-
716 }
-
-
717
-
-
718 int getNumIterImpl() override
-
719 {
-
720 HYPRE_Int num_iter;
-
721 auto error = HYPRE_StructGMRESGetNumIterations( _solver, &num_iter );
-
722 this->checkHypreError( error );
-
723 return num_iter;
-
724 }
-
-
725
-
- -
727 {
-
728 HYPRE_Real norm;
-
729 auto error =
-
730 HYPRE_StructGMRESGetFinalRelativeResidualNorm( _solver, &norm );
-
731 this->checkHypreError( error );
-
732 return norm;
-
733 }
-
-
734
-
- - -
737 preconditioner ) override
-
738 {
-
739 auto error = HYPRE_StructGMRESSetPrecond(
-
740 _solver, preconditioner.getHypreSolveFunction(),
-
741 preconditioner.getHypreSetupFunction(),
-
742 preconditioner.getHypreSolver() );
-
743 this->checkHypreError( error );
-
744 }
-
-
745
-
746 private:
-
747 HYPRE_StructSolver _solver;
-
748};
-
-
749
-
750//---------------------------------------------------------------------------//
-
752template <class Scalar, class EntityType, class MemorySpace>
-
- -
754 : public HypreStructuredSolver<Scalar, EntityType, MemorySpace>
-
755{
-
756 public:
- -
760 template <class ArrayLayout_t>
-
-
761 HypreStructBiCGSTAB( const ArrayLayout_t& layout,
-
762 const bool is_preconditioner = false )
-
763 : Base( layout, is_preconditioner )
-
764 {
-
765 if ( is_preconditioner )
-
766 throw std::logic_error(
-
767 "HYPRE BiCGSTAB cannot be used as a preconditioner" );
-
768
-
769 auto error = HYPRE_StructBiCGSTABCreate(
-
770 layout.localGrid()->globalGrid().comm(), &_solver );
-
771 this->checkHypreError( error );
-
772 }
-
+
+
684 HYPRE_PtrToStructSolverFcn getHypreSolveFunction() const override
+
685 {
+
686 return HYPRE_StructGMRESSolve;
+
687 }
+
+
688
+
689 protected:
+
+
690 void setToleranceImpl( const double tol ) override
+
691 {
+
692 auto error = HYPRE_StructGMRESSetTol( _solver, tol );
+
693 this->checkHypreError( error );
+
694 }
+
+
695
+
+
696 void setMaxIterImpl( const int max_iter ) override
+
697 {
+
698 auto error = HYPRE_StructGMRESSetMaxIter( _solver, max_iter );
+
699 this->checkHypreError( error );
+
700 }
+
+
701
+
+
702 void setPrintLevelImpl( const int print_level ) override
+
703 {
+
704 auto error = HYPRE_StructGMRESSetPrintLevel( _solver, print_level );
+
705 this->checkHypreError( error );
+
706 }
+
+
707
+
+
708 void setupImpl() override
+
709 {
+
710 auto error = HYPRE_StructGMRESSetup( _solver, _A, _b, _x );
+
711 this->checkHypreError( error );
+
712 }
+
+
713
+
+
714 void solveImpl() override
+
715 {
+
716 auto error = HYPRE_StructGMRESSolve( _solver, _A, _b, _x );
+
717 this->checkHypreError( error );
+
718 }
+
+
719
+
+
720 int getNumIterImpl() override
+
721 {
+
722 HYPRE_Int num_iter;
+
723 auto error = HYPRE_StructGMRESGetNumIterations( _solver, &num_iter );
+
724 this->checkHypreError( error );
+
725 return num_iter;
+
726 }
+
+
727
+
+ +
729 {
+
730 HYPRE_Real norm;
+
731 auto error =
+
732 HYPRE_StructGMRESGetFinalRelativeResidualNorm( _solver, &norm );
+
733 this->checkHypreError( error );
+
734 return norm;
+
735 }
+
+
736
+
+ + +
739 preconditioner ) override
+
740 {
+
741 auto error = HYPRE_StructGMRESSetPrecond(
+
742 _solver, preconditioner.getHypreSolveFunction(),
+
743 preconditioner.getHypreSetupFunction(),
+
744 preconditioner.getHypreSolver() );
+
745 this->checkHypreError( error );
+
746 }
+
+
747
+
748 private:
+
749 HYPRE_StructSolver _solver;
+
750 using base_type::_A;
+
751 using base_type::_b;
+
752 using base_type::_x;
+
753};
+
+
754
+
755//---------------------------------------------------------------------------//
+
757template <class Scalar, class EntityType, class MemorySpace>
+
+ +
759 : public HypreStructuredSolver<Scalar, EntityType, MemorySpace>
+
760{
+
761 public:
+ +
765 template <class ArrayLayout_t>
+
+
766 HypreStructBiCGSTAB( const ArrayLayout_t& layout,
+
767 const bool is_preconditioner = false )
+
768 : base_type( layout, is_preconditioner )
+
769 {
+
770 if ( is_preconditioner )
+
771 throw std::logic_error(
+
772 "HYPRE BiCGSTAB cannot be used as a preconditioner" );
773
-
774 ~HypreStructBiCGSTAB() { HYPRE_StructBiCGSTABDestroy( _solver ); }
-
775
-
776 // BiCGSTAB SETTINGS
-
777
-
-
779 void setAbsoluteTol( const double tol )
-
780 {
-
781 auto error = HYPRE_StructBiCGSTABSetAbsoluteTol( _solver, tol );
-
782 this->checkHypreError( error );
-
783 }
-
-
784
-
-
786 void setLogging( const int logging )
-
787 {
-
788 auto error = HYPRE_StructBiCGSTABSetLogging( _solver, logging );
-
789 this->checkHypreError( error );
-
790 }
-
-
791
-
792 HYPRE_StructSolver getHypreSolver() const override { return _solver; }
-
-
793 HYPRE_PtrToStructSolverFcn getHypreSetupFunction() const override
-
794 {
-
795 return HYPRE_StructBiCGSTABSetup;
-
796 }
-
-
-
797 HYPRE_PtrToStructSolverFcn getHypreSolveFunction() const override
-
798 {
-
799 return HYPRE_StructBiCGSTABSolve;
-
800 }
-
-
801
-
802 protected:
-
-
803 void setToleranceImpl( const double tol ) override
-
804 {
-
805 auto error = HYPRE_StructBiCGSTABSetTol( _solver, tol );
-
806 this->checkHypreError( error );
-
807 }
-
-
808
-
-
809 void setMaxIterImpl( const int max_iter ) override
-
810 {
-
811 auto error = HYPRE_StructBiCGSTABSetMaxIter( _solver, max_iter );
-
812 this->checkHypreError( error );
-
813 }
-
-
814
-
-
815 void setPrintLevelImpl( const int print_level ) override
-
816 {
-
817 auto error = HYPRE_StructBiCGSTABSetPrintLevel( _solver, print_level );
-
818 this->checkHypreError( error );
-
819 }
-
-
820
-
-
821 void setupImpl( HYPRE_StructMatrix A, HYPRE_StructVector b,
-
822 HYPRE_StructVector x ) override
-
823 {
-
824 auto error = HYPRE_StructBiCGSTABSetup( _solver, A, b, x );
-
825 this->checkHypreError( error );
-
826 }
-
-
827
-
-
828 void solveImpl( HYPRE_StructMatrix A, HYPRE_StructVector b,
-
829 HYPRE_StructVector x ) override
-
830 {
-
831 auto error = HYPRE_StructBiCGSTABSolve( _solver, A, b, x );
-
832 this->checkHypreError( error );
-
833 }
-
-
834
-
-
835 int getNumIterImpl() override
-
836 {
-
837 HYPRE_Int num_iter;
-
838 auto error = HYPRE_StructBiCGSTABGetNumIterations( _solver, &num_iter );
-
839 this->checkHypreError( error );
-
840 return num_iter;
-
841 }
-
-
842
-
- -
844 {
-
845 HYPRE_Real norm;
-
846 auto error =
-
847 HYPRE_StructBiCGSTABGetFinalRelativeResidualNorm( _solver, &norm );
-
848 this->checkHypreError( error );
-
849 return norm;
-
850 }
-
-
851
-
- - -
854 preconditioner ) override
-
855 {
-
856 auto error = HYPRE_StructBiCGSTABSetPrecond(
-
857 _solver, preconditioner.getHypreSolveFunction(),
-
858 preconditioner.getHypreSetupFunction(),
-
859 preconditioner.getHypreSolver() );
-
860 this->checkHypreError( error );
-
861 }
-
-
862
-
863 private:
-
864 HYPRE_StructSolver _solver;
-
865};
-
-
866
-
867//---------------------------------------------------------------------------//
-
869template <class Scalar, class EntityType, class MemorySpace>
-
- -
871 : public HypreStructuredSolver<Scalar, EntityType, MemorySpace>
-
872{
-
873 public:
- -
877 template <class ArrayLayout_t>
-
-
878 HypreStructPFMG( const ArrayLayout_t& layout,
-
879 const bool is_preconditioner = false )
-
880 : Base( layout, is_preconditioner )
-
881 {
-
882 auto error = HYPRE_StructPFMGCreate(
-
883 layout.localGrid()->globalGrid().comm(), &_solver );
-
884 this->checkHypreError( error );
-
885
-
886 if ( is_preconditioner )
-
887 {
-
888 error = HYPRE_StructPFMGSetZeroGuess( _solver );
-
889 this->checkHypreError( error );
-
890 }
-
891 }
-
-
892
-
893 ~HypreStructPFMG() { HYPRE_StructPFMGDestroy( _solver ); }
-
894
-
895 // PFMG SETTINGS
-
896
-
-
898 void setMaxLevels( const int max_levels )
-
899 {
-
900 auto error = HYPRE_StructPFMGSetMaxLevels( _solver, max_levels );
-
901 this->checkHypreError( error );
-
902 }
-
-
903
-
-
906 void setRelChange( const int rel_change )
-
907 {
-
908 auto error = HYPRE_StructPFMGSetRelChange( _solver, rel_change );
-
909 this->checkHypreError( error );
-
910 }
-
-
911
-
-
921 void setRelaxType( const int relax_type )
-
922 {
-
923 auto error = HYPRE_StructPFMGSetRelaxType( _solver, relax_type );
-
924 this->checkHypreError( error );
-
925 }
-
-
926
-
-
928 void setJacobiWeight( const double weight )
-
929 {
-
930 auto error = HYPRE_StructPFMGSetJacobiWeight( _solver, weight );
-
931 this->checkHypreError( error );
-
932 }
-
-
933
-
-
944 void setRAPType( const int rap_type )
-
945 {
-
946 auto error = HYPRE_StructPFMGSetRAPType( _solver, rap_type );
-
947 this->checkHypreError( error );
-
948 }
-
-
949
-
-
951 void setNumPreRelax( const int num_pre_relax )
-
952 {
-
953 auto error = HYPRE_StructPFMGSetNumPreRelax( _solver, num_pre_relax );
-
954 this->checkHypreError( error );
-
955 }
-
-
956
-
-
958 void setNumPostRelax( const int num_post_relax )
-
959 {
-
960 auto error = HYPRE_StructPFMGSetNumPostRelax( _solver, num_post_relax );
-
961 this->checkHypreError( error );
-
962 }
-
-
963
-
-
967 void setSkipRelax( const int skip_relax )
-
968 {
-
969 auto error = HYPRE_StructPFMGSetSkipRelax( _solver, skip_relax );
-
970 this->checkHypreError( error );
-
971 }
-
-
972
-
-
974 void setLogging( const int logging )
-
975 {
-
976 auto error = HYPRE_StructPFMGSetLogging( _solver, logging );
-
977 this->checkHypreError( error );
-
978 }
-
-
979
-
980 HYPRE_StructSolver getHypreSolver() const override { return _solver; }
-
-
981 HYPRE_PtrToStructSolverFcn getHypreSetupFunction() const override
-
982 {
-
983 return HYPRE_StructPFMGSetup;
+
774 auto error = HYPRE_StructBiCGSTABCreate(
+
775 layout.localGrid()->globalGrid().comm(), &_solver );
+
776 this->checkHypreError( error );
+
777 }
+
+
778
+
779 ~HypreStructBiCGSTAB() { HYPRE_StructBiCGSTABDestroy( _solver ); }
+
780
+
781 // BiCGSTAB SETTINGS
+
782
+
+
784 void setAbsoluteTol( const double tol )
+
785 {
+
786 auto error = HYPRE_StructBiCGSTABSetAbsoluteTol( _solver, tol );
+
787 this->checkHypreError( error );
+
788 }
+
+
789
+
+
791 void setLogging( const int logging )
+
792 {
+
793 auto error = HYPRE_StructBiCGSTABSetLogging( _solver, logging );
+
794 this->checkHypreError( error );
+
795 }
+
+
796
+
797 HYPRE_StructSolver getHypreSolver() const override { return _solver; }
+
+
798 HYPRE_PtrToStructSolverFcn getHypreSetupFunction() const override
+
799 {
+
800 return HYPRE_StructBiCGSTABSetup;
+
801 }
+
+
+
802 HYPRE_PtrToStructSolverFcn getHypreSolveFunction() const override
+
803 {
+
804 return HYPRE_StructBiCGSTABSolve;
+
805 }
+
+
806
+
807 protected:
+
+
808 void setToleranceImpl( const double tol ) override
+
809 {
+
810 auto error = HYPRE_StructBiCGSTABSetTol( _solver, tol );
+
811 this->checkHypreError( error );
+
812 }
+
+
813
+
+
814 void setMaxIterImpl( const int max_iter ) override
+
815 {
+
816 auto error = HYPRE_StructBiCGSTABSetMaxIter( _solver, max_iter );
+
817 this->checkHypreError( error );
+
818 }
+
+
819
+
+
820 void setPrintLevelImpl( const int print_level ) override
+
821 {
+
822 auto error = HYPRE_StructBiCGSTABSetPrintLevel( _solver, print_level );
+
823 this->checkHypreError( error );
+
824 }
+
+
825
+
+
826 void setupImpl() override
+
827 {
+
828 auto error = HYPRE_StructBiCGSTABSetup( _solver, _A, _b, _x );
+
829 this->checkHypreError( error );
+
830 }
+
+
831
+
+
832 void solveImpl() override
+
833 {
+
834 auto error = HYPRE_StructBiCGSTABSolve( _solver, _A, _b, _x );
+
835 this->checkHypreError( error );
+
836 }
+
+
837
+
+
838 int getNumIterImpl() override
+
839 {
+
840 HYPRE_Int num_iter;
+
841 auto error = HYPRE_StructBiCGSTABGetNumIterations( _solver, &num_iter );
+
842 this->checkHypreError( error );
+
843 return num_iter;
+
844 }
+
+
845
+
+ +
847 {
+
848 HYPRE_Real norm;
+
849 auto error =
+
850 HYPRE_StructBiCGSTABGetFinalRelativeResidualNorm( _solver, &norm );
+
851 this->checkHypreError( error );
+
852 return norm;
+
853 }
+
+
854
+
+ + +
857 preconditioner ) override
+
858 {
+
859 auto error = HYPRE_StructBiCGSTABSetPrecond(
+
860 _solver, preconditioner.getHypreSolveFunction(),
+
861 preconditioner.getHypreSetupFunction(),
+
862 preconditioner.getHypreSolver() );
+
863 this->checkHypreError( error );
+
864 }
+
+
865
+
866 private:
+
867 HYPRE_StructSolver _solver;
+
868 using base_type::_A;
+
869 using base_type::_b;
+
870 using base_type::_x;
+
871};
+
+
872
+
873//---------------------------------------------------------------------------//
+
875template <class Scalar, class EntityType, class MemorySpace>
+
+ +
877 : public HypreStructuredSolver<Scalar, EntityType, MemorySpace>
+
878{
+
879 public:
+ +
883 template <class ArrayLayout_t>
+
+
884 HypreStructPFMG( const ArrayLayout_t& layout,
+
885 const bool is_preconditioner = false )
+
886 : base_type( layout, is_preconditioner )
+
887 {
+
888 auto error = HYPRE_StructPFMGCreate(
+
889 layout.localGrid()->globalGrid().comm(), &_solver );
+
890 this->checkHypreError( error );
+
891
+
892 if ( is_preconditioner )
+
893 {
+
894 error = HYPRE_StructPFMGSetZeroGuess( _solver );
+
895 this->checkHypreError( error );
+
896 }
+
897 }
+
+
898
+
899 ~HypreStructPFMG() { HYPRE_StructPFMGDestroy( _solver ); }
+
900
+
901 // PFMG SETTINGS
+
902
+
+
904 void setMaxLevels( const int max_levels )
+
905 {
+
906 auto error = HYPRE_StructPFMGSetMaxLevels( _solver, max_levels );
+
907 this->checkHypreError( error );
+
908 }
+
+
909
+
+
912 void setRelChange( const int rel_change )
+
913 {
+
914 auto error = HYPRE_StructPFMGSetRelChange( _solver, rel_change );
+
915 this->checkHypreError( error );
+
916 }
+
+
917
+
+
927 void setRelaxType( const int relax_type )
+
928 {
+
929 auto error = HYPRE_StructPFMGSetRelaxType( _solver, relax_type );
+
930 this->checkHypreError( error );
+
931 }
+
+
932
+
+
934 void setJacobiWeight( const double weight )
+
935 {
+
936 auto error = HYPRE_StructPFMGSetJacobiWeight( _solver, weight );
+
937 this->checkHypreError( error );
+
938 }
+
+
939
+
+
950 void setRAPType( const int rap_type )
+
951 {
+
952 auto error = HYPRE_StructPFMGSetRAPType( _solver, rap_type );
+
953 this->checkHypreError( error );
+
954 }
+
+
955
+
+
957 void setNumPreRelax( const int num_pre_relax )
+
958 {
+
959 auto error = HYPRE_StructPFMGSetNumPreRelax( _solver, num_pre_relax );
+
960 this->checkHypreError( error );
+
961 }
+
+
962
+
+
964 void setNumPostRelax( const int num_post_relax )
+
965 {
+
966 auto error = HYPRE_StructPFMGSetNumPostRelax( _solver, num_post_relax );
+
967 this->checkHypreError( error );
+
968 }
+
+
969
+
+
973 void setSkipRelax( const int skip_relax )
+
974 {
+
975 auto error = HYPRE_StructPFMGSetSkipRelax( _solver, skip_relax );
+
976 this->checkHypreError( error );
+
977 }
+
+
978
+
+
980 void setLogging( const int logging )
+
981 {
+
982 auto error = HYPRE_StructPFMGSetLogging( _solver, logging );
+
983 this->checkHypreError( error );
984 }
-
-
985 HYPRE_PtrToStructSolverFcn getHypreSolveFunction() const override
-
986 {
-
987 return HYPRE_StructPFMGSolve;
-
988 }
+
985
+
986 HYPRE_StructSolver getHypreSolver() const override { return _solver; }
+
+
987 HYPRE_PtrToStructSolverFcn getHypreSetupFunction() const override
+
988 {
+
989 return HYPRE_StructPFMGSetup;
+
990 }
-
989
-
990 protected:
-
991 void setToleranceImpl( const double tol ) override
+
991 HYPRE_PtrToStructSolverFcn getHypreSolveFunction() const override
992 {
-
993 auto error = HYPRE_StructPFMGSetTol( _solver, tol );
-
994 this->checkHypreError( error );
-
995 }
+
993 return HYPRE_StructPFMGSolve;
+
994 }
-
996
+
995
+
996 protected:
-
997 void setMaxIterImpl( const int max_iter ) override
+
997 void setToleranceImpl( const double tol ) override
998 {
-
999 auto error = HYPRE_StructPFMGSetMaxIter( _solver, max_iter );
+
999 auto error = HYPRE_StructPFMGSetTol( _solver, tol );
1000 this->checkHypreError( error );
1001 }
1002
-
1003 void setPrintLevelImpl( const int print_level ) override
+
1003 void setMaxIterImpl( const int max_iter ) override
1004 {
-
1005 auto error = HYPRE_StructPFMGSetPrintLevel( _solver, print_level );
+
1005 auto error = HYPRE_StructPFMGSetMaxIter( _solver, max_iter );
1006 this->checkHypreError( error );
1007 }
1008
-
1009 void setupImpl( HYPRE_StructMatrix A, HYPRE_StructVector b,
-
1010 HYPRE_StructVector x ) override
-
1011 {
-
1012 auto error = HYPRE_StructPFMGSetup( _solver, A, b, x );
-
1013 this->checkHypreError( error );
-
1014 }
-
-
1015
-
-
1016 void solveImpl( HYPRE_StructMatrix A, HYPRE_StructVector b,
-
1017 HYPRE_StructVector x ) override
-
1018 {
-
1019 auto error = HYPRE_StructPFMGSolve( _solver, A, b, x );
-
1020 this->checkHypreError( error );
-
1021 }
-
-
1022
-
-
1023 int getNumIterImpl() override
-
1024 {
-
1025 HYPRE_Int num_iter;
-
1026 auto error = HYPRE_StructPFMGGetNumIterations( _solver, &num_iter );
-
1027 this->checkHypreError( error );
-
1028 return num_iter;
-
1029 }
-
-
1030
-
- -
1032 {
-
1033 HYPRE_Real norm;
-
1034 auto error =
-
1035 HYPRE_StructPFMGGetFinalRelativeResidualNorm( _solver, &norm );
-
1036 this->checkHypreError( error );
-
1037 return norm;
-
1038 }
-
-
1039
-
- - -
1042 {
-
1043 throw std::logic_error(
-
1044 "HYPRE PFMG solver does not support preconditioning." );
-
1045 }
-
-
1046
-
1047 private:
-
1048 HYPRE_StructSolver _solver;
-
1049};
+
1009 void setPrintLevelImpl( const int print_level ) override
+
1010 {
+
1011 auto error = HYPRE_StructPFMGSetPrintLevel( _solver, print_level );
+
1012 this->checkHypreError( error );
+
1013 }
+
+
1014
+
+
1015 void setupImpl() override
+
1016 {
+
1017 auto error = HYPRE_StructPFMGSetup( _solver, _A, _b, _x );
+
1018 this->checkHypreError( error );
+
1019 }
+
+
1020
+
+
1021 void solveImpl() override
+
1022 {
+
1023 auto error = HYPRE_StructPFMGSolve( _solver, _A, _b, _x );
+
1024 this->checkHypreError( error );
+
1025 }
+
+
1026
+
+
1027 int getNumIterImpl() override
+
1028 {
+
1029 HYPRE_Int num_iter;
+
1030 auto error = HYPRE_StructPFMGGetNumIterations( _solver, &num_iter );
+
1031 this->checkHypreError( error );
+
1032 return num_iter;
+
1033 }
+
+
1034
+
+ +
1036 {
+
1037 HYPRE_Real norm;
+
1038 auto error =
+
1039 HYPRE_StructPFMGGetFinalRelativeResidualNorm( _solver, &norm );
+
1040 this->checkHypreError( error );
+
1041 return norm;
+
1042 }
+
+
1043
+
+ + +
1046 {
+
1047 throw std::logic_error(
+
1048 "HYPRE PFMG solver does not support preconditioning." );
+
1049 }
1050
-
1051//---------------------------------------------------------------------------//
-
1053template <class Scalar, class EntityType, class MemorySpace>
-
- -
1055 : public HypreStructuredSolver<Scalar, EntityType, MemorySpace>
-
1056{
-
1057 public:
- -
1061 template <class ArrayLayout_t>
-
-
1062 HypreStructSMG( const ArrayLayout_t& layout,
-
1063 const bool is_preconditioner = false )
-
1064 : Base( layout, is_preconditioner )
-
1065 {
-
1066 auto error = HYPRE_StructSMGCreate(
-
1067 layout.localGrid()->globalGrid().comm(), &_solver );
-
1068 this->checkHypreError( error );
-
1069
-
1070 if ( is_preconditioner )
-
1071 {
-
1072 error = HYPRE_StructSMGSetZeroGuess( _solver );
-
1073 this->checkHypreError( error );
-
1074 }
-
1075 }
-
+
1051 private:
+
1052 HYPRE_StructSolver _solver;
+
1053 using base_type::_A;
+
1054 using base_type::_b;
+
1055 using base_type::_x;
+
1056};
+
+
1057
+
1058//---------------------------------------------------------------------------//
+
1060template <class Scalar, class EntityType, class MemorySpace>
+
+ +
1062 : public HypreStructuredSolver<Scalar, EntityType, MemorySpace>
+
1063{
+
1064 public:
+ +
1068 template <class ArrayLayout_t>
+
+
1069 HypreStructSMG( const ArrayLayout_t& layout,
+
1070 const bool is_preconditioner = false )
+
1071 : base_type( layout, is_preconditioner )
+
1072 {
+
1073 auto error = HYPRE_StructSMGCreate(
+
1074 layout.localGrid()->globalGrid().comm(), &_solver );
+
1075 this->checkHypreError( error );
1076
-
1077 ~HypreStructSMG() { HYPRE_StructSMGDestroy( _solver ); }
-
1078
-
1079 // SMG Settings
-
1080
-
-
1083 void setRelChange( const int rel_change )
-
1084 {
-
1085 auto error = HYPRE_StructSMGSetRelChange( _solver, rel_change );
-
1086 this->checkHypreError( error );
-
1087 }
-
-
1088
+
1077 if ( is_preconditioner )
+
1078 {
+
1079 error = HYPRE_StructSMGSetZeroGuess( _solver );
+
1080 this->checkHypreError( error );
+
1081 }
+
1082 }
+
+
1083
+
1084 ~HypreStructSMG() { HYPRE_StructSMGDestroy( _solver ); }
+
1085
+
1086 // SMG Settings
+
1087
-
1090 void setNumPreRelax( const int num_pre_relax )
+
1090 void setRelChange( const int rel_change )
1091 {
-
1092 auto error = HYPRE_StructSMGSetNumPreRelax( _solver, num_pre_relax );
+
1092 auto error = HYPRE_StructSMGSetRelChange( _solver, rel_change );
1093 this->checkHypreError( error );
1094 }
1095
-
1097 void setNumPostRelax( const int num_post_relax )
+
1097 void setNumPreRelax( const int num_pre_relax )
1098 {
-
1099 auto error = HYPRE_StructSMGSetNumPostRelax( _solver, num_post_relax );
+
1099 auto error = HYPRE_StructSMGSetNumPreRelax( _solver, num_pre_relax );
1100 this->checkHypreError( error );
1101 }
1102
-
1104 void setLogging( const int logging )
+
1104 void setNumPostRelax( const int num_post_relax )
1105 {
-
1106 auto error = HYPRE_StructSMGSetLogging( _solver, logging );
+
1106 auto error = HYPRE_StructSMGSetNumPostRelax( _solver, num_post_relax );
1107 this->checkHypreError( error );
1108 }
1109
-
1110 HYPRE_StructSolver getHypreSolver() const override { return _solver; }
-
1111 HYPRE_PtrToStructSolverFcn getHypreSetupFunction() const override
-
1112 {
-
1113 return HYPRE_StructSMGSetup;
-
1114 }
-
-
-
1115 HYPRE_PtrToStructSolverFcn getHypreSolveFunction() const override
-
1116 {
-
1117 return HYPRE_StructSMGSolve;
-
1118 }
-
-
1119
-
1120 protected:
-
-
1121 void setToleranceImpl( const double tol ) override
-
1122 {
-
1123 auto error = HYPRE_StructSMGSetTol( _solver, tol );
-
1124 this->checkHypreError( error );
+
1111 void setLogging( const int logging )
+
1112 {
+
1113 auto error = HYPRE_StructSMGSetLogging( _solver, logging );
+
1114 this->checkHypreError( error );
+
1115 }
+
+
1116
+
1117 HYPRE_StructSolver getHypreSolver() const override { return _solver; }
+
+
1118 HYPRE_PtrToStructSolverFcn getHypreSetupFunction() const override
+
1119 {
+
1120 return HYPRE_StructSMGSetup;
+
1121 }
+
+
+
1122 HYPRE_PtrToStructSolverFcn getHypreSolveFunction() const override
+
1123 {
+
1124 return HYPRE_StructSMGSolve;
1125 }
1126
-
-
1127 void setMaxIterImpl( const int max_iter ) override
-
1128 {
-
1129 auto error = HYPRE_StructSMGSetMaxIter( _solver, max_iter );
-
1130 this->checkHypreError( error );
-
1131 }
-
-
1132
-
-
1133 void setPrintLevelImpl( const int print_level ) override
-
1134 {
-
1135 auto error = HYPRE_StructSMGSetPrintLevel( _solver, print_level );
-
1136 this->checkHypreError( error );
-
1137 }
-
-
1138
-
-
1139 void setupImpl( HYPRE_StructMatrix A, HYPRE_StructVector b,
-
1140 HYPRE_StructVector x ) override
+
1127 protected:
+
+
1128 void setToleranceImpl( const double tol ) override
+
1129 {
+
1130 auto error = HYPRE_StructSMGSetTol( _solver, tol );
+
1131 this->checkHypreError( error );
+
1132 }
+
+
1133
+
+
1134 void setMaxIterImpl( const int max_iter ) override
+
1135 {
+
1136 auto error = HYPRE_StructSMGSetMaxIter( _solver, max_iter );
+
1137 this->checkHypreError( error );
+
1138 }
+
+
1139
+
+
1140 void setPrintLevelImpl( const int print_level ) override
1141 {
-
1142 auto error = HYPRE_StructSMGSetup( _solver, A, b, x );
+
1142 auto error = HYPRE_StructSMGSetPrintLevel( _solver, print_level );
1143 this->checkHypreError( error );
1144 }
1145
-
1146 void solveImpl( HYPRE_StructMatrix A, HYPRE_StructVector b,
-
1147 HYPRE_StructVector x ) override
-
1148 {
-
1149 auto error = HYPRE_StructSMGSolve( _solver, A, b, x );
-
1150 this->checkHypreError( error );
-
1151 }
-
-
1152
-
-
1153 int getNumIterImpl() override
-
1154 {
-
1155 HYPRE_Int num_iter;
-
1156 auto error = HYPRE_StructSMGGetNumIterations( _solver, &num_iter );
-
1157 this->checkHypreError( error );
-
1158 return num_iter;
-
1159 }
-
-
1160
-
- -
1162 {
-
1163 HYPRE_Real norm;
-
1164 auto error =
-
1165 HYPRE_StructSMGGetFinalRelativeResidualNorm( _solver, &norm );
-
1166 this->checkHypreError( error );
-
1167 return norm;
-
1168 }
-
-
1169
-
- - -
1172 {
-
1173 throw std::logic_error(
-
1174 "HYPRE SMG solver does not support preconditioning." );
-
1175 }
-
-
1176
-
1177 private:
-
1178 HYPRE_StructSolver _solver;
-
1179};
-
-
1180
-
1181//---------------------------------------------------------------------------//
-
1183template <class Scalar, class EntityType, class MemorySpace>
-
- -
1185 : public HypreStructuredSolver<Scalar, EntityType, MemorySpace>
-
1186{
-
1187 public:
- -
1191 template <class ArrayLayout_t>
-
-
1192 HypreStructJacobi( const ArrayLayout_t& layout,
-
1193 const bool is_preconditioner = false )
-
1194 : Base( layout, is_preconditioner )
-
1195 {
-
1196 auto error = HYPRE_StructJacobiCreate(
-
1197 layout.localGrid()->globalGrid().comm(), &_solver );
-
1198 this->checkHypreError( error );
-
1199
-
1200 if ( is_preconditioner )
-
1201 {
-
1202 error = HYPRE_StructJacobiSetZeroGuess( _solver );
-
1203 this->checkHypreError( error );
-
1204 }
-
1205 }
-
-
1206
-
1207 ~HypreStructJacobi() { HYPRE_StructJacobiDestroy( _solver ); }
-
1208
-
1209 HYPRE_StructSolver getHypreSolver() const override { return _solver; }
-
-
1210 HYPRE_PtrToStructSolverFcn getHypreSetupFunction() const override
-
1211 {
-
1212 return HYPRE_StructJacobiSetup;
+
1146 void setupImpl() override
+
1147 {
+
1148 auto error = HYPRE_StructSMGSetup( _solver, _A, _b, _x );
+
1149 this->checkHypreError( error );
+
1150 }
+
+
1151
+
+
1152 void solveImpl() override
+
1153 {
+
1154 auto error = HYPRE_StructSMGSolve( _solver, _A, _b, _x );
+
1155 this->checkHypreError( error );
+
1156 }
+
+
1157
+
+
1158 int getNumIterImpl() override
+
1159 {
+
1160 HYPRE_Int num_iter;
+
1161 auto error = HYPRE_StructSMGGetNumIterations( _solver, &num_iter );
+
1162 this->checkHypreError( error );
+
1163 return num_iter;
+
1164 }
+
+
1165
+
+ +
1167 {
+
1168 HYPRE_Real norm;
+
1169 auto error =
+
1170 HYPRE_StructSMGGetFinalRelativeResidualNorm( _solver, &norm );
+
1171 this->checkHypreError( error );
+
1172 return norm;
+
1173 }
+
+
1174
+
+ + +
1177 {
+
1178 throw std::logic_error(
+
1179 "HYPRE SMG solver does not support preconditioning." );
+
1180 }
+
+
1181
+
1182 private:
+
1183 HYPRE_StructSolver _solver;
+
1184 using base_type::_A;
+
1185 using base_type::_b;
+
1186 using base_type::_x;
+
1187};
+
+
1188
+
1189//---------------------------------------------------------------------------//
+
1191template <class Scalar, class EntityType, class MemorySpace>
+
+ +
1193 : public HypreStructuredSolver<Scalar, EntityType, MemorySpace>
+
1194{
+
1195 public:
+ +
1199 template <class ArrayLayout_t>
+
+
1200 HypreStructJacobi( const ArrayLayout_t& layout,
+
1201 const bool is_preconditioner = false )
+
1202 : base_type( layout, is_preconditioner )
+
1203 {
+
1204 auto error = HYPRE_StructJacobiCreate(
+
1205 layout.localGrid()->globalGrid().comm(), &_solver );
+
1206 this->checkHypreError( error );
+
1207
+
1208 if ( is_preconditioner )
+
1209 {
+
1210 error = HYPRE_StructJacobiSetZeroGuess( _solver );
+
1211 this->checkHypreError( error );
+
1212 }
1213 }
-
-
1214 HYPRE_PtrToStructSolverFcn getHypreSolveFunction() const override
-
1215 {
-
1216 return HYPRE_StructJacobiSolve;
-
1217 }
-
-
1218
-
1219 protected:
-
-
1220 void setToleranceImpl( const double tol ) override
-
1221 {
-
1222 auto error = HYPRE_StructJacobiSetTol( _solver, tol );
-
1223 this->checkHypreError( error );
-
1224 }
-
-
1225
-
-
1226 void setMaxIterImpl( const int max_iter ) override
-
1227 {
-
1228 auto error = HYPRE_StructJacobiSetMaxIter( _solver, max_iter );
-
1229 this->checkHypreError( error );
-
1230 }
-
-
1231
-
-
1232 void setPrintLevelImpl( const int ) override
-
1233 {
-
1234 // The Jacobi solver does not support a print level.
-
1235 }
-
-
1236
-
-
1237 void setupImpl( HYPRE_StructMatrix A, HYPRE_StructVector b,
-
1238 HYPRE_StructVector x ) override
-
1239 {
-
1240 auto error = HYPRE_StructJacobiSetup( _solver, A, b, x );
-
1241 this->checkHypreError( error );
-
1242 }
-
-
1243
-
-
1244 void solveImpl( HYPRE_StructMatrix A, HYPRE_StructVector b,
-
1245 HYPRE_StructVector x ) override
+
1214
+
1215 ~HypreStructJacobi() { HYPRE_StructJacobiDestroy( _solver ); }
+
1216
+
1217 HYPRE_StructSolver getHypreSolver() const override { return _solver; }
+
+
1218 HYPRE_PtrToStructSolverFcn getHypreSetupFunction() const override
+
1219 {
+
1220 return HYPRE_StructJacobiSetup;
+
1221 }
+
+
+
1222 HYPRE_PtrToStructSolverFcn getHypreSolveFunction() const override
+
1223 {
+
1224 return HYPRE_StructJacobiSolve;
+
1225 }
+
+
1226
+
1227 protected:
+
+
1228 void setToleranceImpl( const double tol ) override
+
1229 {
+
1230 auto error = HYPRE_StructJacobiSetTol( _solver, tol );
+
1231 this->checkHypreError( error );
+
1232 }
+
+
1233
+
+
1234 void setMaxIterImpl( const int max_iter ) override
+
1235 {
+
1236 auto error = HYPRE_StructJacobiSetMaxIter( _solver, max_iter );
+
1237 this->checkHypreError( error );
+
1238 }
+
+
1239
+
+
1240 void setPrintLevelImpl( const int ) override
+
1241 {
+
1242 // The Jacobi solver does not support a print level.
+
1243 }
+
+
1244
+
+
1245 void setupImpl() override
1246 {
-
1247 auto error = HYPRE_StructJacobiSolve( _solver, A, b, x );
+
1247 auto error = HYPRE_StructJacobiSetup( _solver, _A, _b, _x );
1248 this->checkHypreError( error );
1249 }
1250
-
1251 int getNumIterImpl() override
+
1251 void solveImpl() override
1252 {
-
1253 HYPRE_Int num_iter;
-
1254 auto error = HYPRE_StructJacobiGetNumIterations( _solver, &num_iter );
-
1255 this->checkHypreError( error );
-
1256 return num_iter;
-
1257 }
-
-
1258
-
- -
1260 {
-
1261 HYPRE_Real norm;
-
1262 auto error =
-
1263 HYPRE_StructJacobiGetFinalRelativeResidualNorm( _solver, &norm );
-
1264 this->checkHypreError( error );
-
1265 return norm;
-
1266 }
-
-
1267
-
- - -
1270 {
-
1271 throw std::logic_error(
-
1272 "HYPRE Jacobi solver does not support preconditioning." );
-
1273 }
-
-
1274
-
1275 private:
-
1276 HYPRE_StructSolver _solver;
-
1277};
-
-
1278
-
1279//---------------------------------------------------------------------------//
-
1281template <class Scalar, class EntityType, class MemorySpace>
-
- -
1283 : public HypreStructuredSolver<Scalar, EntityType, MemorySpace>
-
1284{
-
1285 public:
- -
1289 template <class ArrayLayout_t>
-
-
1290 HypreStructDiagonal( const ArrayLayout_t& layout,
-
1291 const bool is_preconditioner = false )
-
1292 : Base( layout, is_preconditioner )
-
1293 {
-
1294 if ( !is_preconditioner )
-
1295 throw std::logic_error(
-
1296 "Diagonal preconditioner cannot be used as a solver" );
-
1297 }
-
-
1298
-
1299 HYPRE_StructSolver getHypreSolver() const override { return nullptr; }
-
-
1300 HYPRE_PtrToStructSolverFcn getHypreSetupFunction() const override
-
1301 {
-
1302 return HYPRE_StructDiagScaleSetup;
-
1303 }
-
-
-
1304 HYPRE_PtrToStructSolverFcn getHypreSolveFunction() const override
-
1305 {
-
1306 return HYPRE_StructDiagScale;
-
1307 }
-
-
1308
-
1309 protected:
-
-
1310 void setToleranceImpl( const double ) override
-
1311 {
-
1312 throw std::logic_error(
-
1313 "Diagonal preconditioner cannot be used as a solver" );
-
1314 }
-
-
1315
-
-
1316 void setMaxIterImpl( const int ) override
-
1317 {
-
1318 throw std::logic_error(
-
1319 "Diagonal preconditioner cannot be used as a solver" );
-
1320 }
-
-
1321
-
-
1322 void setPrintLevelImpl( const int ) override
-
1323 {
-
1324 throw std::logic_error(
-
1325 "Diagonal preconditioner cannot be used as a solver" );
-
1326 }
-
-
1327
-
-
1328 void setupImpl( HYPRE_StructMatrix, HYPRE_StructVector,
-
1329 HYPRE_StructVector ) override
-
1330 {
-
1331 throw std::logic_error(
-
1332 "Diagonal preconditioner cannot be used as a solver" );
-
1333 }
-
-
1334
-
-
1335 void solveImpl( HYPRE_StructMatrix, HYPRE_StructVector,
-
1336 HYPRE_StructVector ) override
-
1337 {
-
1338 throw std::logic_error(
-
1339 "Diagonal preconditioner cannot be used as a solver" );
-
1340 }
-
-
1341
-
-
1342 int getNumIterImpl() override
-
1343 {
-
1344 throw std::logic_error(
-
1345 "Diagonal preconditioner cannot be used as a solver" );
-
1346 }
-
-
1347
-
- -
1349 {
-
1350 throw std::logic_error(
-
1351 "Diagonal preconditioner cannot be used as a solver" );
-
1352 }
-
-
1353
-
- - +
1253 auto error = HYPRE_StructJacobiSolve( _solver, _A, _b, _x );
+
1254 this->checkHypreError( error );
+
1255 }
+
+
1256
+
+
1257 int getNumIterImpl() override
+
1258 {
+
1259 HYPRE_Int num_iter;
+
1260 auto error = HYPRE_StructJacobiGetNumIterations( _solver, &num_iter );
+
1261 this->checkHypreError( error );
+
1262 return num_iter;
+
1263 }
+
+
1264
+
+ +
1266 {
+
1267 HYPRE_Real norm;
+
1268 auto error =
+
1269 HYPRE_StructJacobiGetFinalRelativeResidualNorm( _solver, &norm );
+
1270 this->checkHypreError( error );
+
1271 return norm;
+
1272 }
+
+
1273
+
+ + +
1276 {
+
1277 throw std::logic_error(
+
1278 "HYPRE Jacobi solver does not support preconditioning." );
+
1279 }
+
+
1280
+
1281 private:
+
1282 HYPRE_StructSolver _solver;
+
1283 using base_type::_A;
+
1284 using base_type::_b;
+
1285 using base_type::_x;
+
1286};
+
+
1287
+
1288//---------------------------------------------------------------------------//
+
1290template <class Scalar, class EntityType, class MemorySpace>
+
+ +
1292 : public HypreStructuredSolver<Scalar, EntityType, MemorySpace>
+
1293{
+
1294 public:
+ +
1298 template <class ArrayLayout_t>
+
+
1299 HypreStructDiagonal( const ArrayLayout_t& layout,
+
1300 const bool is_preconditioner = false )
+
1301 : base_type( layout, is_preconditioner )
+
1302 {
+
1303 if ( !is_preconditioner )
+
1304 throw std::logic_error(
+
1305 "Diagonal preconditioner cannot be used as a solver" );
+
1306 }
+
+
1307
+
1308 HYPRE_StructSolver getHypreSolver() const override { return nullptr; }
+
+
1309 HYPRE_PtrToStructSolverFcn getHypreSetupFunction() const override
+
1310 {
+
1311 return HYPRE_StructDiagScaleSetup;
+
1312 }
+
+
+
1313 HYPRE_PtrToStructSolverFcn getHypreSolveFunction() const override
+
1314 {
+
1315 return HYPRE_StructDiagScale;
+
1316 }
+
+
1317
+
1318 protected:
+
+
1319 void setToleranceImpl( const double ) override
+
1320 {
+
1321 throw std::logic_error(
+
1322 "Diagonal preconditioner cannot be used as a solver" );
+
1323 }
+
+
1324
+
+
1325 void setMaxIterImpl( const int ) override
+
1326 {
+
1327 throw std::logic_error(
+
1328 "Diagonal preconditioner cannot be used as a solver" );
+
1329 }
+
+
1330
+
+
1331 void setPrintLevelImpl( const int ) override
+
1332 {
+
1333 throw std::logic_error(
+
1334 "Diagonal preconditioner cannot be used as a solver" );
+
1335 }
+
+
1336
+
+
1337 void setupImpl() override
+
1338 {
+
1339 throw std::logic_error(
+
1340 "Diagonal preconditioner cannot be used as a solver" );
+
1341 }
+
+
1342
+
+
1343 void solveImpl() override
+
1344 {
+
1345 throw std::logic_error(
+
1346 "Diagonal preconditioner cannot be used as a solver" );
+
1347 }
+
+
1348
+
+
1349 int getNumIterImpl() override
+
1350 {
+
1351 throw std::logic_error(
+
1352 "Diagonal preconditioner cannot be used as a solver" );
+
1353 }
+
+
1354
+
+
1356 {
1357 throw std::logic_error(
-
1358 "Diagonal preconditioner does not support preconditioning." );
+
1358 "Diagonal preconditioner cannot be used as a solver" );
1359 }
-
1360};
-
-
1361
-
1362//---------------------------------------------------------------------------//
-
1363// Builders
-
1364//---------------------------------------------------------------------------//
-
1367template <class Scalar, class MemorySpace, class ArrayLayout_t>
-
1368std::shared_ptr<
-
1369 HypreStructPCG<Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>
-
-
1370createHypreStructPCG( const ArrayLayout_t& layout,
-
1371 const bool is_preconditioner = false )
-
1372{
- -
1374 "Must use an array layout" );
-
1375 return std::make_shared<HypreStructPCG<
-
1376 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>(
-
1377 layout, is_preconditioner );
-
1378}
-
-
1379
-
1382template <class Scalar, class MemorySpace, class ArrayLayout_t>
-
1383std::shared_ptr<
-
1384 HypreStructGMRES<Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>
-
-
1385createHypreStructGMRES( const ArrayLayout_t& layout,
-
1386 const bool is_preconditioner = false )
-
1387{
- -
1389 "Must use an array layout" );
-
1390 return std::make_shared<HypreStructGMRES<
-
1391 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>(
-
1392 layout, is_preconditioner );
-
1393}
-
-
1394
-
1397template <class Scalar, class MemorySpace, class ArrayLayout_t>
-
1398std::shared_ptr<HypreStructBiCGSTAB<Scalar, typename ArrayLayout_t::entity_type,
-
1399 MemorySpace>>
-
-
1400createHypreStructBiCGSTAB( const ArrayLayout_t& layout,
-
1401 const bool is_preconditioner = false )
-
1402{
- -
1404 "Must use an array layout" );
-
1405 return std::make_shared<HypreStructBiCGSTAB<
-
1406 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>(
-
1407 layout, is_preconditioner );
-
1408}
-
-
1409
-
1412template <class Scalar, class MemorySpace, class ArrayLayout_t>
-
1413std::shared_ptr<
-
1414 HypreStructPFMG<Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>
-
-
1415createHypreStructPFMG( const ArrayLayout_t& layout,
-
1416 const bool is_preconditioner = false )
-
1417{
- -
1419 "Must use an array layout" );
-
1420 return std::make_shared<HypreStructPFMG<
-
1421 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>(
-
1422 layout, is_preconditioner );
-
1423}
-
-
1424
-
1427template <class Scalar, class MemorySpace, class ArrayLayout_t>
-
1428std::shared_ptr<
-
1429 HypreStructSMG<Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>
-
-
1430createHypreStructSMG( const ArrayLayout_t& layout,
-
1431 const bool is_preconditioner = false )
-
1432{
- -
1434 "Must use an array layout" );
-
1435 return std::make_shared<HypreStructSMG<
-
1436 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>(
-
1437 layout, is_preconditioner );
-
1438}
-
-
1439
-
1442template <class Scalar, class MemorySpace, class ArrayLayout_t>
-
1443std::shared_ptr<
-
1444 HypreStructJacobi<Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>
-
-
1445createHypreStructJacobi( const ArrayLayout_t& layout,
-
1446 const bool is_preconditioner = false )
-
1447{
- -
1449 "Must use an array layout" );
-
1450 return std::make_shared<HypreStructJacobi<
-
1451 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>(
-
1452 layout, is_preconditioner );
-
1453}
-
-
1454
-
1457template <class Scalar, class MemorySpace, class ArrayLayout_t>
-
1458std::shared_ptr<HypreStructDiagonal<Scalar, typename ArrayLayout_t::entity_type,
-
1459 MemorySpace>>
-
-
1460createHypreStructDiagonal( const ArrayLayout_t& layout,
-
1461 const bool is_preconditioner = false )
-
1462{
- -
1464 "Must use an array layout" );
-
1465 return std::make_shared<HypreStructDiagonal<
-
1466 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>(
-
1467 layout, is_preconditioner );
-
1468}
-
-
1469
-
1470//---------------------------------------------------------------------------//
-
1471// Factory
-
1472//---------------------------------------------------------------------------//
-
1481template <class Scalar, class MemorySpace, class ArrayLayout_t>
-
1482std::shared_ptr<HypreStructuredSolver<
-
1483 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>
-
-
1484createHypreStructuredSolver( const std::string& solver_type,
-
1485 const ArrayLayout_t& layout,
-
1486 const bool is_preconditioner = false )
-
1487{
- -
1489 "Must use an array layout" );
-
1490
-
1491 if ( "PCG" == solver_type )
-
1492 return createHypreStructPCG<Scalar, MemorySpace>( layout,
-
1493 is_preconditioner );
-
1494 else if ( "GMRES" == solver_type )
-
1495 return createHypreStructGMRES<Scalar, MemorySpace>( layout,
-
1496 is_preconditioner );
-
1497 else if ( "BiCGSTAB" == solver_type )
-
1498 return createHypreStructBiCGSTAB<Scalar, MemorySpace>(
-
1499 layout, is_preconditioner );
-
1500 else if ( "PFMG" == solver_type )
-
1501 return createHypreStructPFMG<Scalar, MemorySpace>( layout,
-
1502 is_preconditioner );
-
1503 else if ( "SMG" == solver_type )
-
1504 return createHypreStructSMG<Scalar, MemorySpace>( layout,
-
1505 is_preconditioner );
-
1506 else if ( "Jacobi" == solver_type )
-
1507 return createHypreStructJacobi<Scalar, MemorySpace>(
-
1508 layout, is_preconditioner );
-
1509 else if ( "Diagonal" == solver_type )
-
1510 return createHypreStructDiagonal<Scalar, MemorySpace>(
-
1511 layout, is_preconditioner );
-
1512 else
-
1513 throw std::runtime_error( "Invalid solver type" );
-
1514}
-
-
1515
-
1516//---------------------------------------------------------------------------//
-
1517
-
1518} // namespace Grid
-
1519} // namespace Cabana
-
1520
-
1521namespace Cajita
-
1522{
-
1524template <class Scalar, class EntityType, class MemorySpace>
-
1525using HypreStructuredSolver CAJITA_DEPRECATED =
- +
1360
+
+ + +
1363 {
+
1364 throw std::logic_error(
+
1365 "Diagonal preconditioner does not support preconditioning." );
+
1366 }
+
+
1367};
+
+
1368
+
1369//---------------------------------------------------------------------------//
+
1370// Builders
+
1371//---------------------------------------------------------------------------//
+
1374template <class Scalar, class MemorySpace, class ArrayLayout_t>
+
1375std::shared_ptr<
+
1376 HypreStructPCG<Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>
+
+
1377createHypreStructPCG( const ArrayLayout_t& layout,
+
1378 const bool is_preconditioner = false )
+
1379{
+ +
1381 "Must use an array layout" );
+
1382 return std::make_shared<HypreStructPCG<
+
1383 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>(
+
1384 layout, is_preconditioner );
+
1385}
+
+
1386
+
1389template <class Scalar, class MemorySpace, class ArrayLayout_t>
+
1390std::shared_ptr<
+
1391 HypreStructGMRES<Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>
+
+
1392createHypreStructGMRES( const ArrayLayout_t& layout,
+
1393 const bool is_preconditioner = false )
+
1394{
+ +
1396 "Must use an array layout" );
+
1397 return std::make_shared<HypreStructGMRES<
+
1398 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>(
+
1399 layout, is_preconditioner );
+
1400}
+
+
1401
+
1404template <class Scalar, class MemorySpace, class ArrayLayout_t>
+
1405std::shared_ptr<HypreStructBiCGSTAB<Scalar, typename ArrayLayout_t::entity_type,
+
1406 MemorySpace>>
+
+
1407createHypreStructBiCGSTAB( const ArrayLayout_t& layout,
+
1408 const bool is_preconditioner = false )
+
1409{
+ +
1411 "Must use an array layout" );
+
1412 return std::make_shared<HypreStructBiCGSTAB<
+
1413 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>(
+
1414 layout, is_preconditioner );
+
1415}
+
+
1416
+
1419template <class Scalar, class MemorySpace, class ArrayLayout_t>
+
1420std::shared_ptr<
+
1421 HypreStructPFMG<Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>
+
+
1422createHypreStructPFMG( const ArrayLayout_t& layout,
+
1423 const bool is_preconditioner = false )
+
1424{
+ +
1426 "Must use an array layout" );
+
1427 return std::make_shared<HypreStructPFMG<
+
1428 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>(
+
1429 layout, is_preconditioner );
+
1430}
+
+
1431
+
1434template <class Scalar, class MemorySpace, class ArrayLayout_t>
+
1435std::shared_ptr<
+
1436 HypreStructSMG<Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>
+
+
1437createHypreStructSMG( const ArrayLayout_t& layout,
+
1438 const bool is_preconditioner = false )
+
1439{
+ +
1441 "Must use an array layout" );
+
1442 return std::make_shared<HypreStructSMG<
+
1443 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>(
+
1444 layout, is_preconditioner );
+
1445}
+
+
1446
+
1449template <class Scalar, class MemorySpace, class ArrayLayout_t>
+
1450std::shared_ptr<
+
1451 HypreStructJacobi<Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>
+
+
1452createHypreStructJacobi( const ArrayLayout_t& layout,
+
1453 const bool is_preconditioner = false )
+
1454{
+ +
1456 "Must use an array layout" );
+
1457 return std::make_shared<HypreStructJacobi<
+
1458 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>(
+
1459 layout, is_preconditioner );
+
1460}
+
+
1461
+
1464template <class Scalar, class MemorySpace, class ArrayLayout_t>
+
1465std::shared_ptr<HypreStructDiagonal<Scalar, typename ArrayLayout_t::entity_type,
+
1466 MemorySpace>>
+
+
1467createHypreStructDiagonal( const ArrayLayout_t& layout,
+
1468 const bool is_preconditioner = false )
+
1469{
+ +
1471 "Must use an array layout" );
+
1472 return std::make_shared<HypreStructDiagonal<
+
1473 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>(
+
1474 layout, is_preconditioner );
+
1475}
+
+
1476
+
1477//---------------------------------------------------------------------------//
+
1478// Factory
+
1479//---------------------------------------------------------------------------//
+
1488template <class Scalar, class MemorySpace, class ArrayLayout_t>
+
1489std::shared_ptr<HypreStructuredSolver<
+
1490 Scalar, typename ArrayLayout_t::entity_type, MemorySpace>>
+
+
1491createHypreStructuredSolver( const std::string& solver_type,
+
1492 const ArrayLayout_t& layout,
+
1493 const bool is_preconditioner = false )
+
1494{
+ +
1496 "Must use an array layout" );
+
1497
+
1498 if ( "PCG" == solver_type )
+
1499 return createHypreStructPCG<Scalar, MemorySpace>( layout,
+
1500 is_preconditioner );
+
1501 else if ( "GMRES" == solver_type )
+
1502 return createHypreStructGMRES<Scalar, MemorySpace>( layout,
+
1503 is_preconditioner );
+
1504 else if ( "BiCGSTAB" == solver_type )
+
1505 return createHypreStructBiCGSTAB<Scalar, MemorySpace>(
+
1506 layout, is_preconditioner );
+
1507 else if ( "PFMG" == solver_type )
+
1508 return createHypreStructPFMG<Scalar, MemorySpace>( layout,
+
1509 is_preconditioner );
+
1510 else if ( "SMG" == solver_type )
+
1511 return createHypreStructSMG<Scalar, MemorySpace>( layout,
+
1512 is_preconditioner );
+
1513 else if ( "Jacobi" == solver_type )
+
1514 return createHypreStructJacobi<Scalar, MemorySpace>(
+
1515 layout, is_preconditioner );
+
1516 else if ( "Diagonal" == solver_type )
+
1517 return createHypreStructDiagonal<Scalar, MemorySpace>(
+
1518 layout, is_preconditioner );
+
1519 else
+
1520 throw std::runtime_error( "Invalid solver type" );
+
1521}
+
+
1522
+
1523//---------------------------------------------------------------------------//
+
1524
+
1525} // namespace Grid
+
1526} // namespace Cabana
1527
-
1528template <class Scalar, class EntityType, class MemorySpace>
-
1529using HypreStructPCG CAJITA_DEPRECATED =
- -
1531
-
1532template <class Scalar, class EntityType, class MemorySpace>
-
1533using HypreStructGMRES CAJITA_DEPRECATED =
- -
1535
-
1536template <class Scalar, class EntityType, class MemorySpace>
-
1537using HypreStructBiCGSTAB CAJITA_DEPRECATED =
- -
1539
-
1540template <class Scalar, class EntityType, class MemorySpace>
-
1541using HypreStructPFMG CAJITA_DEPRECATED =
- -
1543
-
1544template <class Scalar, class EntityType, class MemorySpace>
-
1545using HypreStructSMG CAJITA_DEPRECATED =
- -
1547
-
1548template <class Scalar, class EntityType, class MemorySpace>
-
1549using HypreStructJacobi CAJITA_DEPRECATED =
- -
1551
-
1552template <class Scalar, class EntityType, class MemorySpace>
-
1553using HypreStructDiagonal CAJITA_DEPRECATED =
- -
1555
-
1556template <class... Args>
-
1557CAJITA_DEPRECATED auto createHypreStructPCG( Args&&... args )
-
1558{
-
1559 return Cabana::Grid::createHypreStructPCG( std::forward<Args>( args )... );
-
1560}
-
1561template <class... Args>
-
1562CAJITA_DEPRECATED auto createHypreStructGMRES( Args&&... args )
-
1563{
- -
1565 std::forward<Args>( args )... );
-
1566}
-
1567template <class... Args>
-
1568CAJITA_DEPRECATED auto createHypreStructBiCGSTAB( Args&&... args )
-
1569{
- -
1571 std::forward<Args>( args )... );
-
1572}
-
1573template <class... Args>
-
1574CAJITA_DEPRECATED auto createHypreStructPFMG( Args&&... args )
-
1575{
-
1576 return Cabana::Grid::createHypreStructPFMG( std::forward<Args>( args )... );
-
1577}
-
1578template <class... Args>
-
1579CAJITA_DEPRECATED auto createHypreStructSMG( Args&&... args )
-
1580{
-
1581 return Cabana::Grid::createHypreStructSMG( std::forward<Args>( args )... );
-
1582}
-
1583template <class... Args>
-
1584CAJITA_DEPRECATED auto createHypreStructJacobi( Args&&... args )
-
1585{
- -
1587 std::forward<Args>( args )... );
-
1588}
-
1589template <class... Args>
-
1590CAJITA_DEPRECATED auto createHypreStructDiagonal( Args&&... args )
-
1591{
- -
1593 std::forward<Args>( args )... );
-
1594}
-
1595
-
1596template <class Scalar, class MemorySpace, class... Args>
-
1597CAJITA_DEPRECATED auto createHypreStructuredSolver( Args&&... args )
+
1528namespace Cajita
+
1529{
+
1531template <class Scalar, class EntityType, class MemorySpace>
+
1532using HypreStructuredSolver CAJITA_DEPRECATED =
+ +
1534
+
1535template <class Scalar, class EntityType, class MemorySpace>
+
1536using HypreStructPCG CAJITA_DEPRECATED =
+ +
1538
+
1539template <class Scalar, class EntityType, class MemorySpace>
+
1540using HypreStructGMRES CAJITA_DEPRECATED =
+ +
1542
+
1543template <class Scalar, class EntityType, class MemorySpace>
+
1544using HypreStructBiCGSTAB CAJITA_DEPRECATED =
+ +
1546
+
1547template <class Scalar, class EntityType, class MemorySpace>
+
1548using HypreStructPFMG CAJITA_DEPRECATED =
+ +
1550
+
1551template <class Scalar, class EntityType, class MemorySpace>
+
1552using HypreStructSMG CAJITA_DEPRECATED =
+ +
1554
+
1555template <class Scalar, class EntityType, class MemorySpace>
+
1556using HypreStructJacobi CAJITA_DEPRECATED =
+ +
1558
+
1559template <class Scalar, class EntityType, class MemorySpace>
+
1560using HypreStructDiagonal CAJITA_DEPRECATED =
+ +
1562
+
1563template <class... Args>
+
1564CAJITA_DEPRECATED auto createHypreStructPCG( Args&&... args )
+
1565{
+
1566 return Cabana::Grid::createHypreStructPCG( std::forward<Args>( args )... );
+
1567}
+
1568template <class... Args>
+
1569CAJITA_DEPRECATED auto createHypreStructGMRES( Args&&... args )
+
1570{
+ +
1572 std::forward<Args>( args )... );
+
1573}
+
1574template <class... Args>
+
1575CAJITA_DEPRECATED auto createHypreStructBiCGSTAB( Args&&... args )
+
1576{
+ +
1578 std::forward<Args>( args )... );
+
1579}
+
1580template <class... Args>
+
1581CAJITA_DEPRECATED auto createHypreStructPFMG( Args&&... args )
+
1582{
+
1583 return Cabana::Grid::createHypreStructPFMG( std::forward<Args>( args )... );
+
1584}
+
1585template <class... Args>
+
1586CAJITA_DEPRECATED auto createHypreStructSMG( Args&&... args )
+
1587{
+
1588 return Cabana::Grid::createHypreStructSMG( std::forward<Args>( args )... );
+
1589}
+
1590template <class... Args>
+
1591CAJITA_DEPRECATED auto createHypreStructJacobi( Args&&... args )
+
1592{
+ +
1594 std::forward<Args>( args )... );
+
1595}
+
1596template <class... Args>
+
1597CAJITA_DEPRECATED auto createHypreStructDiagonal( Args&&... args )
1598{
-
1599 return Cabana::Grid::createHypreStructuredSolver<Scalar, MemorySpace>(
+
1600 std::forward<Args>( args )... );
1601}
-
1603} // namespace Cajita
-
1604
-
1605#endif // end CABANA_GRID_HYPRESTRUCTUREDSOLVER_HPP
+
1602
+
1603template <class Scalar, class MemorySpace, class... Args>
+
1604CAJITA_DEPRECATED auto createHypreStructuredSolver( Args&&... args )
+
1605{
+
1606 return Cabana::Grid::createHypreStructuredSolver<Scalar, MemorySpace>(
+
1607 std::forward<Args>( args )... );
+
1608}
+
1610} // namespace Cajita
+
1611
+
1612#endif // end CABANA_GRID_HYPRESTRUCTUREDSOLVER_HPP
Grid field arrays.
-
std::shared_ptr< HypreStructGMRES< Scalar, typename ArrayLayout_t::entity_type, MemorySpace > > createHypreStructGMRES(const ArrayLayout_t &layout, const bool is_preconditioner=false)
Definition Cabana_Grid_HypreStructuredSolver.hpp:1385
-
std::shared_ptr< HypreStructJacobi< Scalar, typename ArrayLayout_t::entity_type, MemorySpace > > createHypreStructJacobi(const ArrayLayout_t &layout, const bool is_preconditioner=false)
Definition Cabana_Grid_HypreStructuredSolver.hpp:1445
-
std::shared_ptr< HypreStructBiCGSTAB< Scalar, typename ArrayLayout_t::entity_type, MemorySpace > > createHypreStructBiCGSTAB(const ArrayLayout_t &layout, const bool is_preconditioner=false)
Definition Cabana_Grid_HypreStructuredSolver.hpp:1400
-
std::shared_ptr< HypreStructDiagonal< Scalar, typename ArrayLayout_t::entity_type, MemorySpace > > createHypreStructDiagonal(const ArrayLayout_t &layout, const bool is_preconditioner=false)
Definition Cabana_Grid_HypreStructuredSolver.hpp:1460
-
std::shared_ptr< HypreStructPCG< Scalar, typename ArrayLayout_t::entity_type, MemorySpace > > createHypreStructPCG(const ArrayLayout_t &layout, const bool is_preconditioner=false)
Definition Cabana_Grid_HypreStructuredSolver.hpp:1370
-
std::shared_ptr< HypreStructPFMG< Scalar, typename ArrayLayout_t::entity_type, MemorySpace > > createHypreStructPFMG(const ArrayLayout_t &layout, const bool is_preconditioner=false)
Definition Cabana_Grid_HypreStructuredSolver.hpp:1415
-
std::shared_ptr< HypreStructSMG< Scalar, typename ArrayLayout_t::entity_type, MemorySpace > > createHypreStructSMG(const ArrayLayout_t &layout, const bool is_preconditioner=false)
Definition Cabana_Grid_HypreStructuredSolver.hpp:1430
-
std::shared_ptr< HypreStructuredSolver< Scalar, typename ArrayLayout_t::entity_type, MemorySpace > > createHypreStructuredSolver(const std::string &solver_type, const ArrayLayout_t &layout, const bool is_preconditioner=false)
Create a HYPRE structured solver.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1484
+
std::shared_ptr< HypreStructGMRES< Scalar, typename ArrayLayout_t::entity_type, MemorySpace > > createHypreStructGMRES(const ArrayLayout_t &layout, const bool is_preconditioner=false)
Definition Cabana_Grid_HypreStructuredSolver.hpp:1392
+
std::shared_ptr< HypreStructJacobi< Scalar, typename ArrayLayout_t::entity_type, MemorySpace > > createHypreStructJacobi(const ArrayLayout_t &layout, const bool is_preconditioner=false)
Definition Cabana_Grid_HypreStructuredSolver.hpp:1452
+
std::shared_ptr< HypreStructBiCGSTAB< Scalar, typename ArrayLayout_t::entity_type, MemorySpace > > createHypreStructBiCGSTAB(const ArrayLayout_t &layout, const bool is_preconditioner=false)
Definition Cabana_Grid_HypreStructuredSolver.hpp:1407
+
std::shared_ptr< HypreStructDiagonal< Scalar, typename ArrayLayout_t::entity_type, MemorySpace > > createHypreStructDiagonal(const ArrayLayout_t &layout, const bool is_preconditioner=false)
Definition Cabana_Grid_HypreStructuredSolver.hpp:1467
+
std::shared_ptr< HypreStructPCG< Scalar, typename ArrayLayout_t::entity_type, MemorySpace > > createHypreStructPCG(const ArrayLayout_t &layout, const bool is_preconditioner=false)
Definition Cabana_Grid_HypreStructuredSolver.hpp:1377
+
std::shared_ptr< HypreStructPFMG< Scalar, typename ArrayLayout_t::entity_type, MemorySpace > > createHypreStructPFMG(const ArrayLayout_t &layout, const bool is_preconditioner=false)
Definition Cabana_Grid_HypreStructuredSolver.hpp:1422
+
std::shared_ptr< HypreStructSMG< Scalar, typename ArrayLayout_t::entity_type, MemorySpace > > createHypreStructSMG(const ArrayLayout_t &layout, const bool is_preconditioner=false)
Definition Cabana_Grid_HypreStructuredSolver.hpp:1437
+
std::shared_ptr< HypreStructuredSolver< Scalar, typename ArrayLayout_t::entity_type, MemorySpace > > createHypreStructuredSolver(const std::string &solver_type, const ArrayLayout_t &layout, const bool is_preconditioner=false)
Create a HYPRE structured solver.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1491
HYPRE memory space handling.
Logical grid indexing.
KOKKOS_INLINE_FUNCTION auto createSubview(const ViewType &view, const IndexSpace< 1 > &index_space) -> decltype(Kokkos::subview(view, index_space.range(0)))
Given a view create a subview over the given index space.
Definition Cabana_Grid_IndexSpace.hpp:369
Grid type tags.
Cabana utilities.
-
BiCGSTAB solver.
Definition Cabana_Grid_HypreStructuredSolver.hpp:755
-
double getFinalRelativeResidualNormImpl() override
Get the relative residual norm achieved on the last solve.
Definition Cabana_Grid_HypreStructuredSolver.hpp:843
-
void setLogging(const int logging)
Set the amount of logging to do.
Definition Cabana_Grid_HypreStructuredSolver.hpp:786
-
void setAbsoluteTol(const double tol)
Set the absolute tolerance.
Definition Cabana_Grid_HypreStructuredSolver.hpp:779
-
HYPRE_StructSolver getHypreSolver() const override
Get the preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:792
-
int getNumIterImpl() override
Get the number of iterations taken on the last solve.
Definition Cabana_Grid_HypreStructuredSolver.hpp:835
-
HYPRE_PtrToStructSolverFcn getHypreSetupFunction() const override
Get the preconditioner setup function.
Definition Cabana_Grid_HypreStructuredSolver.hpp:793
-
void setupImpl(HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x) override
Setup implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:821
-
void solveImpl(HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x) override
Solver implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:828
-
void setMaxIterImpl(const int max_iter) override
Set maximum iteration implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:809
-
void setPreconditionerImpl(const HypreStructuredSolver< Scalar, EntityType, MemorySpace > &preconditioner) override
Set a preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:852
-
void setPrintLevelImpl(const int print_level) override
Set the output level.
Definition Cabana_Grid_HypreStructuredSolver.hpp:815
-
HYPRE_PtrToStructSolverFcn getHypreSolveFunction() const override
Get the preconditioner solve function.
Definition Cabana_Grid_HypreStructuredSolver.hpp:797
-
void setToleranceImpl(const double tol) override
Set convergence tolerance implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:803
-
HypreStructBiCGSTAB(const ArrayLayout_t &layout, const bool is_preconditioner=false)
Constructor.
Definition Cabana_Grid_HypreStructuredSolver.hpp:761
-
Diagonal preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1284
-
double getFinalRelativeResidualNormImpl() override
Get the relative residual norm achieved on the last solve.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1348
-
int getNumIterImpl() override
Get the number of iterations taken on the last solve.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1342
-
void setPrintLevelImpl(const int) override
Set the output level.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1322
-
HYPRE_PtrToStructSolverFcn getHypreSetupFunction() const override
Get the preconditioner setup function.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1300
-
HYPRE_StructSolver getHypreSolver() const override
Get the preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1299
-
void solveImpl(HYPRE_StructMatrix, HYPRE_StructVector, HYPRE_StructVector) override
Solver implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1335
-
void setToleranceImpl(const double) override
Set convergence tolerance implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1310
-
HypreStructDiagonal(const ArrayLayout_t &layout, const bool is_preconditioner=false)
Constructor.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1290
-
void setPreconditionerImpl(const HypreStructuredSolver< Scalar, EntityType, MemorySpace > &) override
Set a preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1354
-
void setMaxIterImpl(const int) override
Set maximum iteration implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1316
-
HYPRE_PtrToStructSolverFcn getHypreSolveFunction() const override
Get the preconditioner solve function.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1304
-
void setupImpl(HYPRE_StructMatrix, HYPRE_StructVector, HYPRE_StructVector) override
Setup implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1328
-
GMRES solver.
Definition Cabana_Grid_HypreStructuredSolver.hpp:631
-
void setToleranceImpl(const double tol) override
Set convergence tolerance implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:686
-
void solveImpl(HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x) override
Solver implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:711
-
HYPRE_PtrToStructSolverFcn getHypreSetupFunction() const override
Get the preconditioner setup function.
Definition Cabana_Grid_HypreStructuredSolver.hpp:676
-
HypreStructGMRES(const ArrayLayout_t &layout, const bool is_preconditioner=false)
Constructor.
Definition Cabana_Grid_HypreStructuredSolver.hpp:637
-
int getNumIterImpl() override
Get the number of iterations taken on the last solve.
Definition Cabana_Grid_HypreStructuredSolver.hpp:718
-
void setPreconditionerImpl(const HypreStructuredSolver< Scalar, EntityType, MemorySpace > &preconditioner) override
Set a preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:735
-
void setupImpl(HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x) override
Setup implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:704
-
void setMaxIterImpl(const int max_iter) override
Set maximum iteration implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:692
-
HYPRE_PtrToStructSolverFcn getHypreSolveFunction() const override
Get the preconditioner solve function.
Definition Cabana_Grid_HypreStructuredSolver.hpp:680
-
HYPRE_StructSolver getHypreSolver() const override
Get the preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:675
-
void setKDim(const int k_dim)
Set the max size of the Krylov space.
Definition Cabana_Grid_HypreStructuredSolver.hpp:662
-
double getFinalRelativeResidualNormImpl() override
Get the relative residual norm achieved on the last solve.
Definition Cabana_Grid_HypreStructuredSolver.hpp:726
-
void setLogging(const int logging)
Set the amount of logging to do.
Definition Cabana_Grid_HypreStructuredSolver.hpp:669
-
void setAbsoluteTol(const double tol)
Set the absolute tolerance.
Definition Cabana_Grid_HypreStructuredSolver.hpp:655
-
void setPrintLevelImpl(const int print_level) override
Set the output level.
Definition Cabana_Grid_HypreStructuredSolver.hpp:698
-
Jacobi solver.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1186
-
void setPreconditionerImpl(const HypreStructuredSolver< Scalar, EntityType, MemorySpace > &) override
Set a preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1268
-
void setToleranceImpl(const double tol) override
Set convergence tolerance implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1220
-
double getFinalRelativeResidualNormImpl() override
Get the relative residual norm achieved on the last solve.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1259
-
HYPRE_PtrToStructSolverFcn getHypreSolveFunction() const override
Get the preconditioner solve function.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1214
-
void solveImpl(HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x) override
Solver implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1244
-
void setMaxIterImpl(const int max_iter) override
Set maximum iteration implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1226
-
int getNumIterImpl() override
Get the number of iterations taken on the last solve.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1251
-
void setPrintLevelImpl(const int) override
Set the output level.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1232
-
void setupImpl(HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x) override
Setup implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1237
-
HYPRE_PtrToStructSolverFcn getHypreSetupFunction() const override
Get the preconditioner setup function.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1210
-
HYPRE_StructSolver getHypreSolver() const override
Get the preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1209
-
HypreStructJacobi(const ArrayLayout_t &layout, const bool is_preconditioner=false)
Constructor.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1192
-
PCG solver.
Definition Cabana_Grid_HypreStructuredSolver.hpp:504
-
void solveImpl(HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x) override
Solver implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:587
-
void setRelChange(const int rel_change)
Definition Cabana_Grid_HypreStructuredSolver.hpp:538
-
void setToleranceImpl(const double tol) override
Set convergence tolerance implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:562
-
HYPRE_StructSolver getHypreSolver() const override
Get the preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:551
-
HypreStructPCG(const ArrayLayout_t &layout, const bool is_preconditioner=false)
Constructor.
Definition Cabana_Grid_HypreStructuredSolver.hpp:510
-
HYPRE_PtrToStructSolverFcn getHypreSetupFunction() const override
Get the preconditioner setup function.
Definition Cabana_Grid_HypreStructuredSolver.hpp:552
-
int getNumIterImpl() override
Get the number of iterations taken on the last solve.
Definition Cabana_Grid_HypreStructuredSolver.hpp:594
-
void setAbsoluteTol(const double tol)
Set the absolute tolerance.
Definition Cabana_Grid_HypreStructuredSolver.hpp:530
-
void setupImpl(HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x) override
Setup implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:580
-
double getFinalRelativeResidualNormImpl() override
Get the relative residual norm achieved on the last solve.
Definition Cabana_Grid_HypreStructuredSolver.hpp:602
-
void setMaxIterImpl(const int max_iter) override
Set maximum iteration implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:568
-
HYPRE_PtrToStructSolverFcn getHypreSolveFunction() const override
Get the preconditioner solve function.
Definition Cabana_Grid_HypreStructuredSolver.hpp:556
-
void setPrintLevelImpl(const int print_level) override
Set the output level.
Definition Cabana_Grid_HypreStructuredSolver.hpp:574
-
void setLogging(const int logging)
Set the amount of logging to do.
Definition Cabana_Grid_HypreStructuredSolver.hpp:545
-
void setPreconditionerImpl(const HypreStructuredSolver< Scalar, EntityType, MemorySpace > &preconditioner) override
Set a preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:611
-
PFMG solver.
Definition Cabana_Grid_HypreStructuredSolver.hpp:872
-
HYPRE_PtrToStructSolverFcn getHypreSolveFunction() const override
Get the preconditioner solve function.
Definition Cabana_Grid_HypreStructuredSolver.hpp:985
-
void setRelaxType(const int relax_type)
Set relaxation type.
Definition Cabana_Grid_HypreStructuredSolver.hpp:921
-
void setPreconditionerImpl(const HypreStructuredSolver< Scalar, EntityType, MemorySpace > &) override
Set a preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1040
-
void setSkipRelax(const int skip_relax)
Definition Cabana_Grid_HypreStructuredSolver.hpp:967
-
void setPrintLevelImpl(const int print_level) override
Set the output level.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1003
-
double getFinalRelativeResidualNormImpl() override
Get the relative residual norm achieved on the last solve.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1031
-
void setLogging(const int logging)
Set the amount of logging to do.
Definition Cabana_Grid_HypreStructuredSolver.hpp:974
-
void setNumPreRelax(const int num_pre_relax)
Set number of relaxation sweeps before coarse-grid correction.
Definition Cabana_Grid_HypreStructuredSolver.hpp:951
-
void setJacobiWeight(const double weight)
Set the Jacobi weight.
Definition Cabana_Grid_HypreStructuredSolver.hpp:928
-
HYPRE_StructSolver getHypreSolver() const override
Get the preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:980
-
HypreStructPFMG(const ArrayLayout_t &layout, const bool is_preconditioner=false)
Constructor.
Definition Cabana_Grid_HypreStructuredSolver.hpp:878
-
HYPRE_PtrToStructSolverFcn getHypreSetupFunction() const override
Get the preconditioner setup function.
Definition Cabana_Grid_HypreStructuredSolver.hpp:981
-
int getNumIterImpl() override
Get the number of iterations taken on the last solve.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1023
-
void solveImpl(HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x) override
Solver implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1016
-
void setMaxIterImpl(const int max_iter) override
Set maximum iteration implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:997
-
void setToleranceImpl(const double tol) override
Set convergence tolerance implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:991
-
void setRelChange(const int rel_change)
Definition Cabana_Grid_HypreStructuredSolver.hpp:906
-
void setNumPostRelax(const int num_post_relax)
Set number of relaxation sweeps before coarse-grid correction.
Definition Cabana_Grid_HypreStructuredSolver.hpp:958
-
void setupImpl(HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x) override
Setup implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1009
-
void setMaxLevels(const int max_levels)
Set the maximum number of multigrid levels.
Definition Cabana_Grid_HypreStructuredSolver.hpp:898
-
void setRAPType(const int rap_type)
Set type of coarse-grid operator to use.
Definition Cabana_Grid_HypreStructuredSolver.hpp:944
-
SMG solver.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1056
-
HypreStructSMG(const ArrayLayout_t &layout, const bool is_preconditioner=false)
Constructor.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1062
-
void setPreconditionerImpl(const HypreStructuredSolver< Scalar, EntityType, MemorySpace > &) override
Set a preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1170
-
void setToleranceImpl(const double tol) override
Set convergence tolerance implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1121
-
void setRelChange(const int rel_change)
Definition Cabana_Grid_HypreStructuredSolver.hpp:1083
-
void solveImpl(HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x) override
Solver implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1146
-
HYPRE_PtrToStructSolverFcn getHypreSetupFunction() const override
Get the preconditioner setup function.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1111
-
HYPRE_PtrToStructSolverFcn getHypreSolveFunction() const override
Get the preconditioner solve function.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1115
-
void setLogging(const int logging)
Set the amount of logging to do.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1104
-
void setMaxIterImpl(const int max_iter) override
Set maximum iteration implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1127
-
int getNumIterImpl() override
Get the number of iterations taken on the last solve.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1153
-
void setPrintLevelImpl(const int print_level) override
Set the output level.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1133
-
double getFinalRelativeResidualNormImpl() override
Get the relative residual norm achieved on the last solve.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1161
-
void setNumPostRelax(const int num_post_relax)
Set number of relaxation sweeps before coarse-grid correction.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1097
-
void setNumPreRelax(const int num_pre_relax)
Set number of relaxation sweeps before coarse-grid correction.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1090
-
void setupImpl(HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x) override
Setup implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1139
-
HYPRE_StructSolver getHypreSolver() const override
Get the preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1110
+
BiCGSTAB solver.
Definition Cabana_Grid_HypreStructuredSolver.hpp:760
+
double getFinalRelativeResidualNormImpl() override
Get the relative residual norm achieved on the last solve.
Definition Cabana_Grid_HypreStructuredSolver.hpp:846
+
void solveImpl() override
Solver implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:832
+
void setLogging(const int logging)
Set the amount of logging to do.
Definition Cabana_Grid_HypreStructuredSolver.hpp:791
+
void setAbsoluteTol(const double tol)
Set the absolute tolerance.
Definition Cabana_Grid_HypreStructuredSolver.hpp:784
+
HYPRE_StructSolver getHypreSolver() const override
Get the preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:797
+
int getNumIterImpl() override
Get the number of iterations taken on the last solve.
Definition Cabana_Grid_HypreStructuredSolver.hpp:838
+
HYPRE_PtrToStructSolverFcn getHypreSetupFunction() const override
Get the preconditioner setup function.
Definition Cabana_Grid_HypreStructuredSolver.hpp:798
+
void setMaxIterImpl(const int max_iter) override
Set maximum iteration implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:814
+
void setPreconditionerImpl(const HypreStructuredSolver< Scalar, EntityType, MemorySpace > &preconditioner) override
Set a preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:855
+
void setPrintLevelImpl(const int print_level) override
Set the output level.
Definition Cabana_Grid_HypreStructuredSolver.hpp:820
+
HYPRE_PtrToStructSolverFcn getHypreSolveFunction() const override
Get the preconditioner solve function.
Definition Cabana_Grid_HypreStructuredSolver.hpp:802
+
void setupImpl() override
Setup implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:826
+
void setToleranceImpl(const double tol) override
Set convergence tolerance implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:808
+
HypreStructBiCGSTAB(const ArrayLayout_t &layout, const bool is_preconditioner=false)
Constructor.
Definition Cabana_Grid_HypreStructuredSolver.hpp:766
+
Diagonal preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1293
+
void solveImpl() override
Solver implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1343
+
double getFinalRelativeResidualNormImpl() override
Get the relative residual norm achieved on the last solve.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1355
+
int getNumIterImpl() override
Get the number of iterations taken on the last solve.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1349
+
void setupImpl() override
Setup implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1337
+
void setPrintLevelImpl(const int) override
Set the output level.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1331
+
HYPRE_PtrToStructSolverFcn getHypreSetupFunction() const override
Get the preconditioner setup function.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1309
+
HYPRE_StructSolver getHypreSolver() const override
Get the preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1308
+
void setToleranceImpl(const double) override
Set convergence tolerance implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1319
+
HypreStructDiagonal(const ArrayLayout_t &layout, const bool is_preconditioner=false)
Constructor.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1299
+
void setPreconditionerImpl(const HypreStructuredSolver< Scalar, EntityType, MemorySpace > &) override
Set a preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1361
+
void setMaxIterImpl(const int) override
Set maximum iteration implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1325
+
HYPRE_PtrToStructSolverFcn getHypreSolveFunction() const override
Get the preconditioner solve function.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1313
+
GMRES solver.
Definition Cabana_Grid_HypreStructuredSolver.hpp:635
+
void setToleranceImpl(const double tol) override
Set convergence tolerance implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:690
+
void solveImpl() override
Solver implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:714
+
HYPRE_PtrToStructSolverFcn getHypreSetupFunction() const override
Get the preconditioner setup function.
Definition Cabana_Grid_HypreStructuredSolver.hpp:680
+
HypreStructGMRES(const ArrayLayout_t &layout, const bool is_preconditioner=false)
Constructor.
Definition Cabana_Grid_HypreStructuredSolver.hpp:641
+
int getNumIterImpl() override
Get the number of iterations taken on the last solve.
Definition Cabana_Grid_HypreStructuredSolver.hpp:720
+
void setPreconditionerImpl(const HypreStructuredSolver< Scalar, EntityType, MemorySpace > &preconditioner) override
Set a preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:737
+
void setMaxIterImpl(const int max_iter) override
Set maximum iteration implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:696
+
HYPRE_PtrToStructSolverFcn getHypreSolveFunction() const override
Get the preconditioner solve function.
Definition Cabana_Grid_HypreStructuredSolver.hpp:684
+
HYPRE_StructSolver getHypreSolver() const override
Get the preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:679
+
void setKDim(const int k_dim)
Set the max size of the Krylov space.
Definition Cabana_Grid_HypreStructuredSolver.hpp:666
+
double getFinalRelativeResidualNormImpl() override
Get the relative residual norm achieved on the last solve.
Definition Cabana_Grid_HypreStructuredSolver.hpp:728
+
void setLogging(const int logging)
Set the amount of logging to do.
Definition Cabana_Grid_HypreStructuredSolver.hpp:673
+
void setAbsoluteTol(const double tol)
Set the absolute tolerance.
Definition Cabana_Grid_HypreStructuredSolver.hpp:659
+
void setupImpl() override
Setup implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:708
+
void setPrintLevelImpl(const int print_level) override
Set the output level.
Definition Cabana_Grid_HypreStructuredSolver.hpp:702
+
Jacobi solver.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1194
+
void setPreconditionerImpl(const HypreStructuredSolver< Scalar, EntityType, MemorySpace > &) override
Set a preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1274
+
void setToleranceImpl(const double tol) override
Set convergence tolerance implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1228
+
double getFinalRelativeResidualNormImpl() override
Get the relative residual norm achieved on the last solve.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1265
+
HYPRE_PtrToStructSolverFcn getHypreSolveFunction() const override
Get the preconditioner solve function.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1222
+
void setupImpl() override
Setup implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1245
+
void setMaxIterImpl(const int max_iter) override
Set maximum iteration implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1234
+
int getNumIterImpl() override
Get the number of iterations taken on the last solve.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1257
+
void setPrintLevelImpl(const int) override
Set the output level.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1240
+
HYPRE_PtrToStructSolverFcn getHypreSetupFunction() const override
Get the preconditioner setup function.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1218
+
void solveImpl() override
Solver implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1251
+
HYPRE_StructSolver getHypreSolver() const override
Get the preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1217
+
HypreStructJacobi(const ArrayLayout_t &layout, const bool is_preconditioner=false)
Constructor.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1200
+
PCG solver.
Definition Cabana_Grid_HypreStructuredSolver.hpp:507
+
void setRelChange(const int rel_change)
Definition Cabana_Grid_HypreStructuredSolver.hpp:541
+
void setToleranceImpl(const double tol) override
Set convergence tolerance implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:565
+
void setupImpl() override
Setup implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:583
+
HYPRE_StructSolver getHypreSolver() const override
Get the preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:554
+
HypreStructPCG(const ArrayLayout_t &layout, const bool is_preconditioner=false)
Constructor.
Definition Cabana_Grid_HypreStructuredSolver.hpp:513
+
HYPRE_PtrToStructSolverFcn getHypreSetupFunction() const override
Get the preconditioner setup function.
Definition Cabana_Grid_HypreStructuredSolver.hpp:555
+
void solveImpl() override
Solver implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:589
+
int getNumIterImpl() override
Get the number of iterations taken on the last solve.
Definition Cabana_Grid_HypreStructuredSolver.hpp:595
+
void setAbsoluteTol(const double tol)
Set the absolute tolerance.
Definition Cabana_Grid_HypreStructuredSolver.hpp:533
+
double getFinalRelativeResidualNormImpl() override
Get the relative residual norm achieved on the last solve.
Definition Cabana_Grid_HypreStructuredSolver.hpp:603
+
void setMaxIterImpl(const int max_iter) override
Set maximum iteration implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:571
+
HYPRE_PtrToStructSolverFcn getHypreSolveFunction() const override
Get the preconditioner solve function.
Definition Cabana_Grid_HypreStructuredSolver.hpp:559
+
void setPrintLevelImpl(const int print_level) override
Set the output level.
Definition Cabana_Grid_HypreStructuredSolver.hpp:577
+
void setLogging(const int logging)
Set the amount of logging to do.
Definition Cabana_Grid_HypreStructuredSolver.hpp:548
+
void setPreconditionerImpl(const HypreStructuredSolver< Scalar, EntityType, MemorySpace > &preconditioner) override
Set a preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:612
+
PFMG solver.
Definition Cabana_Grid_HypreStructuredSolver.hpp:878
+
HYPRE_PtrToStructSolverFcn getHypreSolveFunction() const override
Get the preconditioner solve function.
Definition Cabana_Grid_HypreStructuredSolver.hpp:991
+
void setRelaxType(const int relax_type)
Set relaxation type.
Definition Cabana_Grid_HypreStructuredSolver.hpp:927
+
void setPreconditionerImpl(const HypreStructuredSolver< Scalar, EntityType, MemorySpace > &) override
Set a preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1044
+
void setSkipRelax(const int skip_relax)
Definition Cabana_Grid_HypreStructuredSolver.hpp:973
+
void setPrintLevelImpl(const int print_level) override
Set the output level.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1009
+
double getFinalRelativeResidualNormImpl() override
Get the relative residual norm achieved on the last solve.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1035
+
void setLogging(const int logging)
Set the amount of logging to do.
Definition Cabana_Grid_HypreStructuredSolver.hpp:980
+
void setNumPreRelax(const int num_pre_relax)
Set number of relaxation sweeps before coarse-grid correction.
Definition Cabana_Grid_HypreStructuredSolver.hpp:957
+
void setJacobiWeight(const double weight)
Set the Jacobi weight.
Definition Cabana_Grid_HypreStructuredSolver.hpp:934
+
HYPRE_StructSolver getHypreSolver() const override
Get the preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:986
+
void solveImpl() override
Solver implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1021
+
HypreStructPFMG(const ArrayLayout_t &layout, const bool is_preconditioner=false)
Constructor.
Definition Cabana_Grid_HypreStructuredSolver.hpp:884
+
HYPRE_PtrToStructSolverFcn getHypreSetupFunction() const override
Get the preconditioner setup function.
Definition Cabana_Grid_HypreStructuredSolver.hpp:987
+
void setupImpl() override
Setup implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1015
+
int getNumIterImpl() override
Get the number of iterations taken on the last solve.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1027
+
void setMaxIterImpl(const int max_iter) override
Set maximum iteration implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1003
+
void setToleranceImpl(const double tol) override
Set convergence tolerance implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:997
+
void setRelChange(const int rel_change)
Definition Cabana_Grid_HypreStructuredSolver.hpp:912
+
void setNumPostRelax(const int num_post_relax)
Set number of relaxation sweeps before coarse-grid correction.
Definition Cabana_Grid_HypreStructuredSolver.hpp:964
+
void setMaxLevels(const int max_levels)
Set the maximum number of multigrid levels.
Definition Cabana_Grid_HypreStructuredSolver.hpp:904
+
void setRAPType(const int rap_type)
Set type of coarse-grid operator to use.
Definition Cabana_Grid_HypreStructuredSolver.hpp:950
+
SMG solver.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1063
+
HypreStructSMG(const ArrayLayout_t &layout, const bool is_preconditioner=false)
Constructor.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1069
+
void solveImpl() override
Solver implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1152
+
void setPreconditionerImpl(const HypreStructuredSolver< Scalar, EntityType, MemorySpace > &) override
Set a preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1175
+
void setToleranceImpl(const double tol) override
Set convergence tolerance implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1128
+
void setRelChange(const int rel_change)
Definition Cabana_Grid_HypreStructuredSolver.hpp:1090
+
HYPRE_PtrToStructSolverFcn getHypreSetupFunction() const override
Get the preconditioner setup function.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1118
+
HYPRE_PtrToStructSolverFcn getHypreSolveFunction() const override
Get the preconditioner solve function.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1122
+
void setLogging(const int logging)
Set the amount of logging to do.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1111
+
void setMaxIterImpl(const int max_iter) override
Set maximum iteration implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1134
+
int getNumIterImpl() override
Get the number of iterations taken on the last solve.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1158
+
void setPrintLevelImpl(const int print_level) override
Set the output level.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1140
+
void setupImpl() override
Setup implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1146
+
double getFinalRelativeResidualNormImpl() override
Get the relative residual norm achieved on the last solve.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1166
+
void setNumPostRelax(const int num_post_relax)
Set number of relaxation sweeps before coarse-grid correction.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1104
+
void setNumPreRelax(const int num_pre_relax)
Set number of relaxation sweeps before coarse-grid correction.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1097
+
HYPRE_StructSolver getHypreSolver() const override
Get the preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:1117
Hypre structured solver interface for scalar fields.
Definition Cabana_Grid_HypreStructuredSolver.hpp:49
bool isPreconditioner() const
Return if this solver is a preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:178
Scalar value_type
Scalar value type.
Definition Cabana_Grid_HypreStructuredSolver.hpp:56
virtual HYPRE_PtrToStructSolverFcn getHypreSetupFunction() const =0
Get the preconditioner setup function.
void printMatrix(const char *prefix)
Print the hypre matrix to ouput file.
Definition Cabana_Grid_HypreStructuredSolver.hpp:288
+
HYPRE_StructMatrix _A
Matrix for the problem Ax = b.
Definition Cabana_Grid_HypreStructuredSolver.hpp:484
+
HYPRE_StructVector _b
Forcing term for the problem Ax = b.
Definition Cabana_Grid_HypreStructuredSolver.hpp:486
double getFinalRelativeResidualNorm()
Get the relative residual norm achieved on the last solve.
Definition Cabana_Grid_HypreStructuredSolver.hpp:428
void setup()
Setup the problem.
Definition Cabana_Grid_HypreStructuredSolver.hpp:342
virtual void setMaxIterImpl(const int max_iter)=0
Set maximum iteration implementation.
@@ -1924,24 +1930,25 @@
virtual void setPreconditionerImpl(const HypreStructuredSolver< Scalar, EntityType, MemorySpace > &preconditioner)=0
Set a preconditioner.
virtual void setToleranceImpl(const double tol)=0
Set convergence tolerance implementation.
void setMatrixStencil(const std::vector< std::array< int, NumSpaceDim > > &stencil, const bool is_symmetric=false)
Set the operator stencil.
Definition Cabana_Grid_HypreStructuredSolver.hpp:190
-
virtual void setupImpl(HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x)=0
Setup implementation.
EntityType entity_type
Entity type.
Definition Cabana_Grid_HypreStructuredSolver.hpp:52
virtual double getFinalRelativeResidualNormImpl()=0
Get the relative residual norm achieved on the last solve.
void setPrintLevel(const int print_level)
Set the output level.
Definition Cabana_Grid_HypreStructuredSolver.hpp:318
+
virtual void solveImpl()=0
Solver implementation.
virtual int getNumIterImpl()=0
Get the number of iterations taken on the last solve.
MemorySpace memory_space
Kokkos memory space..
Definition Cabana_Grid_HypreStructuredSolver.hpp:54
virtual HYPRE_StructSolver getHypreSolver() const =0
Get the preconditioner.
void setMatrixValues(const Array_t &values)
Set the matrix values.
Definition Cabana_Grid_HypreStructuredSolver.hpp:230
void printLHS(const char *prefix)
Print the hypre LHS to ouput file.
Definition Cabana_Grid_HypreStructuredSolver.hpp:297
void printRHS(const char *prefix)
Print the hypre RHS to ouput file.
Definition Cabana_Grid_HypreStructuredSolver.hpp:306
-
void checkHypreError(const int error) const
Check a hypre error.
Definition Cabana_Grid_HypreStructuredSolver.hpp:470
+
void checkHypreError(const int error) const
Check a hypre error.
Definition Cabana_Grid_HypreStructuredSolver.hpp:468
int getNumIter()
Get the number of iterations taken on the last solve.
Definition Cabana_Grid_HypreStructuredSolver.hpp:425
virtual HYPRE_PtrToStructSolverFcn getHypreSolveFunction() const =0
Get the preconditioner solve function.
+
virtual void setupImpl()=0
Setup implementation.
+
HYPRE_StructVector _x
Solution to the problem Ax = b.
Definition Cabana_Grid_HypreStructuredSolver.hpp:488
void setMaxIter(const int max_iter)
Set maximum iteration implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:315
void solve(const Array_t &b, Array_t &x)
Solve the problem Ax = b for x.
Definition Cabana_Grid_HypreStructuredSolver.hpp:358
void setTolerance(const double tol)
Set convergence tolerance implementation.
Definition Cabana_Grid_HypreStructuredSolver.hpp:312
void setPreconditioner(const std::shared_ptr< HypreStructuredSolver< Scalar, EntityType, MemorySpace > > &preconditioner)
Set a preconditioner.
Definition Cabana_Grid_HypreStructuredSolver.hpp:325
-
virtual void solveImpl(HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x)=0
Solver implementation.
virtual void setPrintLevelImpl(const int print_level)=0
Set the output level.
Structured index space.
Definition Cabana_Grid_IndexSpace.hpp:37
Core: particle data structures and algorithms.
Definition Cabana_AoSoA.hpp:36
diff --git a/doxygen/classCabana_1_1Grid_1_1HypreSemiStructBiCGSTAB-members.html b/doxygen/classCabana_1_1Grid_1_1HypreSemiStructBiCGSTAB-members.html index f87e1516d..f1ef1b575 100644 --- a/doxygen/classCabana_1_1Grid_1_1HypreSemiStructBiCGSTAB-members.html +++ b/doxygen/classCabana_1_1Grid_1_1HypreSemiStructBiCGSTAB-members.html @@ -81,7 +81,7 @@

This is the complete list of members for Cabana::Grid::HypreSemiStructBiCGSTAB< Scalar, EntityType, MemorySpace >, including all inherited members.

- + @@ -114,9 +114,9 @@ - + - + diff --git a/doxygen/classCabana_1_1Grid_1_1HypreSemiStructBiCGSTAB.html b/doxygen/classCabana_1_1Grid_1_1HypreSemiStructBiCGSTAB.html index 4c1118ebf..920cd92ab 100644 --- a/doxygen/classCabana_1_1Grid_1_1HypreSemiStructBiCGSTAB.html +++ b/doxygen/classCabana_1_1Grid_1_1HypreSemiStructBiCGSTAB.html @@ -111,10 +111,9 @@
Base typedefCabana::Grid::HypreSemiStructBiCGSTAB< Scalar, EntityType, MemorySpace >
base_type typedefCabana::Grid::HypreSemiStructBiCGSTAB< Scalar, EntityType, MemorySpace >
checkHypreError(const int error) constCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inlineprotected
createMatrixStencil(int NumSpaceDim, int var=0, int n_vars=3, std::vector< unsigned > stencil_length={ 7, 7, 7 })Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
entity_type typedefCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >
setTolerance(const double tol)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setToleranceImpl(const double tol) overrideCabana::Grid::HypreSemiStructBiCGSTAB< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
setup()Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setupImpl(HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x) overrideCabana::Grid::HypreSemiStructBiCGSTAB< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
setupImpl() overrideCabana::Grid::HypreSemiStructBiCGSTAB< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
solve(const Array_t &b, Array_t &x, int n_vars=3)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
solveImpl(HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x) overrideCabana::Grid::HypreSemiStructBiCGSTAB< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
solveImpl() overrideCabana::Grid::HypreSemiStructBiCGSTAB< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
value_type typedefCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >
~HypreSemiStructBiCGSTAB() (defined in Cabana::Grid::HypreSemiStructBiCGSTAB< Scalar, EntityType, MemorySpace >)Cabana::Grid::HypreSemiStructBiCGSTAB< Scalar, EntityType, MemorySpace >inline
~HypreSemiStructuredSolver() (defined in Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inlinevirtual
- - - + + + @@ -229,12 +228,12 @@ - - - - - - + + + + + + @@ -257,11 +256,45 @@ const int  + + + + + + + + + +

Public Types

-using Base = HypreSemiStructuredSolver<Scalar, EntityType, MemorySpace>
 Base HYPRE semi-structured solver type.
 
using base_type
 Base HYPRE semi-structured solver type.
 
- Public Types inherited from Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >
using entity_type = EntityType
void setPrintLevelImpl (const int print_level) override
 Set the output level.
 
void setupImpl (HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x) override
 Setup implementation.
 
void solveImpl (HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x) override
 Solver implementation.
 
void setupImpl () override
 Setup implementation.
 
void solveImpl () override
 Solver implementation.
 
int getNumIterImpl () override
 Get the number of iterations taken on the last solve.
 
object_type = HYPRE_SSTRUCT
 Object Type for SStruct.
 
- Protected Attributes inherited from Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >
+HYPRE_SStructMatrix _A
 Matrix for the problem Ax = b.
 
+HYPRE_SStructVector _b
 Forcing term for the problem Ax = b.
 
+HYPRE_SStructVector _x
 Solution to the problem Ax = b.
 

Detailed Description

template<class Scalar, class EntityType, class MemorySpace>
class Cabana::Grid::HypreSemiStructBiCGSTAB< Scalar, EntityType, MemorySpace >

BiCGSTAB solver.

-

Member Function Documentation

+

Member Typedef Documentation

+ +

◆ base_type

+ +
+
+
+template<class Scalar , class EntityType , class MemorySpace >
+ + + + +
using Cabana::Grid::HypreSemiStructBiCGSTAB< Scalar, EntityType, MemorySpace >::base_type
+
+Initial value:
+
HypreSemiStructuredSolver<Scalar, EntityType, MemorySpace>
+
+

Base HYPRE semi-structured solver type.

+ +
+
+

Member Function Documentation

◆ getFinalRelativeResidualNormImpl()

@@ -541,8 +574,8 @@

-

◆ setupImpl()

+ +

◆ setupImpl()

@@ -555,17 +588,8 @@

void Cabana::Grid::HypreSemiStructBiCGSTAB< Scalar, EntityType, MemorySpace >::setupImpl ( - HYPRE_SStructMatrix A, - - - - - HYPRE_SStructVector b, - - - + ) - HYPRE_SStructVector x ) @@ -577,12 +601,12 @@

Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >.

+

Implements Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >.

- -

◆ solveImpl()

+ +

◆ solveImpl()

@@ -595,17 +619,8 @@

void Cabana::Grid::HypreSemiStructBiCGSTAB< Scalar, EntityType, MemorySpace >::solveImpl ( - HYPRE_SStructMatrix A, - - - - - HYPRE_SStructVector b, - - - + ) - HYPRE_SStructVector x ) @@ -617,7 +632,7 @@

Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >.

+

Implements Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >.

diff --git a/doxygen/classCabana_1_1Grid_1_1HypreSemiStructDiagonal-members.html b/doxygen/classCabana_1_1Grid_1_1HypreSemiStructDiagonal-members.html index 3ecab6427..36b443d30 100644 --- a/doxygen/classCabana_1_1Grid_1_1HypreSemiStructDiagonal-members.html +++ b/doxygen/classCabana_1_1Grid_1_1HypreSemiStructDiagonal-members.html @@ -81,42 +81,45 @@

This is the complete list of members for Cabana::Grid::HypreSemiStructDiagonal< Scalar, EntityType, MemorySpace >, including all inherited members.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Base typedefCabana::Grid::HypreSemiStructDiagonal< Scalar, EntityType, MemorySpace >
checkHypreError(const int error) constCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inlineprotected
createMatrixStencil(int NumSpaceDim, int var=0, int n_vars=3, std::vector< unsigned > stencil_length={ 7, 7, 7 })Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
entity_type typedefCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >
getFinalRelativeResidualNorm()Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
getFinalRelativeResidualNormImpl() overrideCabana::Grid::HypreSemiStructDiagonal< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
getHypreSetupFunction() const overrideCabana::Grid::HypreSemiStructDiagonal< Scalar, EntityType, MemorySpace >inlinevirtual
getHypreSolveFunction() const overrideCabana::Grid::HypreSemiStructDiagonal< Scalar, EntityType, MemorySpace >inlinevirtual
getHypreSolver() const overrideCabana::Grid::HypreSemiStructDiagonal< Scalar, EntityType, MemorySpace >inlinevirtual
getNumIter()Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
getNumIterImpl() overrideCabana::Grid::HypreSemiStructDiagonal< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
HypreSemiStructDiagonal(const ArrayLayout_t &layout, const bool is_preconditioner=false, int n_vars=3)Cabana::Grid::HypreSemiStructDiagonal< Scalar, EntityType, MemorySpace >inline
HypreSemiStructuredSolver(const ArrayLayout_t &layout, int n_vars, const bool is_preconditioner=false)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
isPreconditioner() constCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
memory_space typedefCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >
object_typeCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >
printLHS(const char *prefix)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
printMatrix(const char *prefix)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
printRHS(const char *prefix)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setMatrixStencil(const std::vector< std::array< int, NumSpaceDim > > &stencil, int var=0, int dep=0)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setMatrixValues(const Array_t &values, int v_x, int v_h)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setMaxIter(const int max_iter)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setMaxIterImpl(const int) overrideCabana::Grid::HypreSemiStructDiagonal< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
setPreconditioner(const std::shared_ptr< HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace > > &preconditioner)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setPreconditionerImpl(const HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace > &) overrideCabana::Grid::HypreSemiStructDiagonal< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
setPrintLevel(const int print_level)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setPrintLevelImpl(const int) overrideCabana::Grid::HypreSemiStructDiagonal< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
setSolverGraph(int n_vars)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setTolerance(const double tol)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setToleranceImpl(const double) overrideCabana::Grid::HypreSemiStructDiagonal< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
setup()Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setupImpl(HYPRE_SStructMatrix, HYPRE_SStructVector, HYPRE_SStructVector) overrideCabana::Grid::HypreSemiStructDiagonal< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
solve(const Array_t &b, Array_t &x, int n_vars=3)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
solveImpl(HYPRE_SStructMatrix, HYPRE_SStructVector, HYPRE_SStructVector) overrideCabana::Grid::HypreSemiStructDiagonal< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
value_type typedefCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >
~HypreSemiStructuredSolver() (defined in Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inlinevirtual
_ACabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >protected
_bCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >protected
_xCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >protected
base_type typedefCabana::Grid::HypreSemiStructDiagonal< Scalar, EntityType, MemorySpace >
checkHypreError(const int error) constCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inlineprotected
createMatrixStencil(int NumSpaceDim, int var=0, int n_vars=3, std::vector< unsigned > stencil_length={ 7, 7, 7 })Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
entity_type typedefCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >
getFinalRelativeResidualNorm()Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
getFinalRelativeResidualNormImpl() overrideCabana::Grid::HypreSemiStructDiagonal< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
getHypreSetupFunction() const overrideCabana::Grid::HypreSemiStructDiagonal< Scalar, EntityType, MemorySpace >inlinevirtual
getHypreSolveFunction() const overrideCabana::Grid::HypreSemiStructDiagonal< Scalar, EntityType, MemorySpace >inlinevirtual
getHypreSolver() const overrideCabana::Grid::HypreSemiStructDiagonal< Scalar, EntityType, MemorySpace >inlinevirtual
getNumIter()Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
getNumIterImpl() overrideCabana::Grid::HypreSemiStructDiagonal< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
HypreSemiStructDiagonal(const ArrayLayout_t &layout, const bool is_preconditioner=false, int n_vars=3)Cabana::Grid::HypreSemiStructDiagonal< Scalar, EntityType, MemorySpace >inline
HypreSemiStructuredSolver(const ArrayLayout_t &layout, int n_vars, const bool is_preconditioner=false)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
isPreconditioner() constCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
memory_space typedefCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >
object_typeCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >
printLHS(const char *prefix)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
printMatrix(const char *prefix)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
printRHS(const char *prefix)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setMatrixStencil(const std::vector< std::array< int, NumSpaceDim > > &stencil, int var=0, int dep=0)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setMatrixValues(const Array_t &values, int v_x, int v_h)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setMaxIter(const int max_iter)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setMaxIterImpl(const int) overrideCabana::Grid::HypreSemiStructDiagonal< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
setPreconditioner(const std::shared_ptr< HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace > > &preconditioner)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setPreconditionerImpl(const HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace > &) overrideCabana::Grid::HypreSemiStructDiagonal< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
setPrintLevel(const int print_level)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setPrintLevelImpl(const int) overrideCabana::Grid::HypreSemiStructDiagonal< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
setSolverGraph(int n_vars)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setTolerance(const double tol)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setToleranceImpl(const double) overrideCabana::Grid::HypreSemiStructDiagonal< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
setup()Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setupImpl() overrideCabana::Grid::HypreSemiStructDiagonal< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
solve(const Array_t &b, Array_t &x, int n_vars=3)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
solveImpl() overrideCabana::Grid::HypreSemiStructDiagonal< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
value_type typedefCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >
~HypreSemiStructuredSolver() (defined in Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inlinevirtual

Member Typedef Documentation

+ +

◆ base_type

+ +
+
+
+template<class Scalar , class EntityType , class MemorySpace >
+ + + + +
using Cabana::Grid::HypreSemiStructDiagonal< Scalar, EntityType, MemorySpace >::base_type
+
+Initial value:
+
HypreSemiStructuredSolver<Scalar, EntityType, MemorySpace>
+
+

Base HYPRE semi-structured solver type.

+ +
+
+

Member Function Documentation

◆ getFinalRelativeResidualNormImpl()

@@ -533,8 +566,8 @@

-

◆ setupImpl()

+ +

◆ setupImpl()

@@ -547,17 +580,8 @@

void Cabana::Grid::HypreSemiStructDiagonal< Scalar, EntityType, MemorySpace >::setupImpl ( - HYPRE_SStructMatrix A, - - - - - HYPRE_SStructVector b, - - - + ) - HYPRE_SStructVector x ) @@ -569,12 +593,12 @@

Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >.

+

Implements Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >.

- -

◆ solveImpl()

+ +

◆ solveImpl()

@@ -587,17 +611,8 @@

void Cabana::Grid::HypreSemiStructDiagonal< Scalar, EntityType, MemorySpace >::solveImpl ( - HYPRE_SStructMatrix A, - - - - - HYPRE_SStructVector b, - - - + ) - HYPRE_SStructVector x ) @@ -609,7 +624,7 @@

Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >.

+

Implements Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >.

diff --git a/doxygen/classCabana_1_1Grid_1_1HypreSemiStructGMRES-members.html b/doxygen/classCabana_1_1Grid_1_1HypreSemiStructGMRES-members.html index 3f96f0a93..9ac22a403 100644 --- a/doxygen/classCabana_1_1Grid_1_1HypreSemiStructGMRES-members.html +++ b/doxygen/classCabana_1_1Grid_1_1HypreSemiStructGMRES-members.html @@ -81,7 +81,7 @@

This is the complete list of members for Cabana::Grid::HypreSemiStructGMRES< Scalar, EntityType, MemorySpace >, including all inherited members.

- + @@ -115,9 +115,9 @@ - + - + diff --git a/doxygen/classCabana_1_1Grid_1_1HypreSemiStructGMRES.html b/doxygen/classCabana_1_1Grid_1_1HypreSemiStructGMRES.html index 0d0859e60..c778434e7 100644 --- a/doxygen/classCabana_1_1Grid_1_1HypreSemiStructGMRES.html +++ b/doxygen/classCabana_1_1Grid_1_1HypreSemiStructGMRES.html @@ -111,10 +111,9 @@
Base typedefCabana::Grid::HypreSemiStructGMRES< Scalar, EntityType, MemorySpace >
base_type typedefCabana::Grid::HypreSemiStructGMRES< Scalar, EntityType, MemorySpace >
checkHypreError(const int error) constCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inlineprotected
createMatrixStencil(int NumSpaceDim, int var=0, int n_vars=3, std::vector< unsigned > stencil_length={ 7, 7, 7 })Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
entity_type typedefCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >
setTolerance(const double tol)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setToleranceImpl(const double tol) overrideCabana::Grid::HypreSemiStructGMRES< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
setup()Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setupImpl(HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x) overrideCabana::Grid::HypreSemiStructGMRES< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
setupImpl() overrideCabana::Grid::HypreSemiStructGMRES< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
solve(const Array_t &b, Array_t &x, int n_vars=3)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
solveImpl(HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x) overrideCabana::Grid::HypreSemiStructGMRES< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
solveImpl() overrideCabana::Grid::HypreSemiStructGMRES< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
value_type typedefCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >
~HypreSemiStructGMRES() (defined in Cabana::Grid::HypreSemiStructGMRES< Scalar, EntityType, MemorySpace >)Cabana::Grid::HypreSemiStructGMRES< Scalar, EntityType, MemorySpace >inline
~HypreSemiStructuredSolver() (defined in Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inlinevirtual
- - - + + + @@ -233,12 +232,12 @@ - - - - - - + + + + + + @@ -261,11 +260,45 @@ const int  + + + + + + + + + +

Public Types

-using Base = HypreSemiStructuredSolver<Scalar, EntityType, MemorySpace>
 Base HYPRE semi-structured solver type.
 
using base_type
 Base HYPRE semi-structured solver type.
 
- Public Types inherited from Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >
using entity_type = EntityType
void setPrintLevelImpl (const int print_level) override
 Set the output level.
 
void setupImpl (HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x) override
 Setup implementation.
 
void solveImpl (HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x) override
 Solver implementation.
 
void setupImpl () override
 Setup implementation.
 
void solveImpl () override
 Solver implementation.
 
int getNumIterImpl () override
 Get the number of iterations taken on the last solve.
 
object_type = HYPRE_SSTRUCT
 Object Type for SStruct.
 
- Protected Attributes inherited from Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >
+HYPRE_SStructMatrix _A
 Matrix for the problem Ax = b.
 
+HYPRE_SStructVector _b
 Forcing term for the problem Ax = b.
 
+HYPRE_SStructVector _x
 Solution to the problem Ax = b.
 

Detailed Description

template<class Scalar, class EntityType, class MemorySpace>
class Cabana::Grid::HypreSemiStructGMRES< Scalar, EntityType, MemorySpace >

GMRES solver.

-

Member Function Documentation

+

Member Typedef Documentation

+ +

◆ base_type

+ +
+
+
+template<class Scalar , class EntityType , class MemorySpace >
+ + + + +
using Cabana::Grid::HypreSemiStructGMRES< Scalar, EntityType, MemorySpace >::base_type
+
+Initial value:
+
HypreSemiStructuredSolver<Scalar, EntityType, MemorySpace>
+
+

Base HYPRE semi-structured solver type.

+ +
+
+

Member Function Documentation

◆ getFinalRelativeResidualNormImpl()

@@ -545,8 +578,8 @@

-

◆ setupImpl()

+ +

◆ setupImpl()

@@ -559,17 +592,8 @@

void Cabana::Grid::HypreSemiStructGMRES< Scalar, EntityType, MemorySpace >::setupImpl ( - HYPRE_SStructMatrix A, - - - - - HYPRE_SStructVector b, - - - + ) - HYPRE_SStructVector x ) @@ -581,12 +605,12 @@

Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >.

+

Implements Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >.

- -

◆ solveImpl()

+ +

◆ solveImpl()

@@ -599,17 +623,8 @@

void Cabana::Grid::HypreSemiStructGMRES< Scalar, EntityType, MemorySpace >::solveImpl ( - HYPRE_SStructMatrix A, - - - - - HYPRE_SStructVector b, - - - + ) - HYPRE_SStructVector x ) @@ -621,7 +636,7 @@

Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >.

+

Implements Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >.

diff --git a/doxygen/classCabana_1_1Grid_1_1HypreSemiStructPCG-members.html b/doxygen/classCabana_1_1Grid_1_1HypreSemiStructPCG-members.html index a27a50a0a..3f614cd9f 100644 --- a/doxygen/classCabana_1_1Grid_1_1HypreSemiStructPCG-members.html +++ b/doxygen/classCabana_1_1Grid_1_1HypreSemiStructPCG-members.html @@ -81,7 +81,7 @@

This is the complete list of members for Cabana::Grid::HypreSemiStructPCG< Scalar, EntityType, MemorySpace >, including all inherited members.

- + @@ -115,9 +115,9 @@ - + - + diff --git a/doxygen/classCabana_1_1Grid_1_1HypreSemiStructPCG.html b/doxygen/classCabana_1_1Grid_1_1HypreSemiStructPCG.html index 550cdefad..ff9e3d42a 100644 --- a/doxygen/classCabana_1_1Grid_1_1HypreSemiStructPCG.html +++ b/doxygen/classCabana_1_1Grid_1_1HypreSemiStructPCG.html @@ -111,10 +111,9 @@
Base typedefCabana::Grid::HypreSemiStructPCG< Scalar, EntityType, MemorySpace >
base_type typedefCabana::Grid::HypreSemiStructPCG< Scalar, EntityType, MemorySpace >
checkHypreError(const int error) constCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inlineprotected
createMatrixStencil(int NumSpaceDim, int var=0, int n_vars=3, std::vector< unsigned > stencil_length={ 7, 7, 7 })Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
entity_type typedefCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >
setTolerance(const double tol)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setToleranceImpl(const double tol) overrideCabana::Grid::HypreSemiStructPCG< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
setup()Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setupImpl(HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x) overrideCabana::Grid::HypreSemiStructPCG< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
setupImpl() overrideCabana::Grid::HypreSemiStructPCG< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
solve(const Array_t &b, Array_t &x, int n_vars=3)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
solveImpl(HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x) overrideCabana::Grid::HypreSemiStructPCG< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
solveImpl() overrideCabana::Grid::HypreSemiStructPCG< Scalar, EntityType, MemorySpace >inlineprotectedvirtual
value_type typedefCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >
~HypreSemiStructPCG() (defined in Cabana::Grid::HypreSemiStructPCG< Scalar, EntityType, MemorySpace >)Cabana::Grid::HypreSemiStructPCG< Scalar, EntityType, MemorySpace >inline
~HypreSemiStructuredSolver() (defined in Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inlinevirtual
- - - + + + @@ -231,12 +230,12 @@ - - - - - - + + + + + + @@ -259,11 +258,45 @@ const int  + + + + + + + + + +

Public Types

-using Base = HypreSemiStructuredSolver<Scalar, EntityType, MemorySpace>
 Base HYPRE semi-structured solver type.
 
using base_type
 Base HYPRE semi-structured solver type.
 
- Public Types inherited from Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >
using entity_type = EntityType
void setPrintLevelImpl (const int print_level) override
 Set the output level.
 
void setupImpl (HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x) override
 Setup implementation.
 
void solveImpl (HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x) override
 Solver implementation.
 
void setupImpl () override
 Setup implementation.
 
void solveImpl () override
 Solver implementation.
 
int getNumIterImpl () override
 Get the number of iterations taken on the last solve.
 
object_type = HYPRE_SSTRUCT
 Object Type for SStruct.
 
- Protected Attributes inherited from Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >
+HYPRE_SStructMatrix _A
 Matrix for the problem Ax = b.
 
+HYPRE_SStructVector _b
 Forcing term for the problem Ax = b.
 
+HYPRE_SStructVector _x
 Solution to the problem Ax = b.
 

Detailed Description

template<class Scalar, class EntityType, class MemorySpace>
class Cabana::Grid::HypreSemiStructPCG< Scalar, EntityType, MemorySpace >

PCG solver.

-

Member Function Documentation

+

Member Typedef Documentation

+ +

◆ base_type

+ +
+
+
+template<class Scalar , class EntityType , class MemorySpace >
+ + + + +
using Cabana::Grid::HypreSemiStructPCG< Scalar, EntityType, MemorySpace >::base_type
+
+Initial value:
+
HypreSemiStructuredSolver<Scalar, EntityType, MemorySpace>
+
+

Base HYPRE semi-structured solver type.

+ +
+
+

Member Function Documentation

◆ getFinalRelativeResidualNormImpl()

@@ -571,8 +604,8 @@

-

◆ setupImpl()

+ +

◆ setupImpl()

@@ -585,17 +618,8 @@

void Cabana::Grid::HypreSemiStructPCG< Scalar, EntityType, MemorySpace >::setupImpl ( - HYPRE_SStructMatrix A, - - - - - HYPRE_SStructVector b, - - - + ) - HYPRE_SStructVector x ) @@ -607,12 +631,12 @@

Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >.

+

Implements Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >.

- -

◆ solveImpl()

+ +

◆ solveImpl()

@@ -625,17 +649,8 @@

void Cabana::Grid::HypreSemiStructPCG< Scalar, EntityType, MemorySpace >::solveImpl ( - HYPRE_SStructMatrix A, - - - - - HYPRE_SStructVector b, - - - + ) - HYPRE_SStructVector x ) @@ -647,7 +662,7 @@

Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >.

+

Implements Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >.

diff --git a/doxygen/classCabana_1_1Grid_1_1HypreSemiStructuredSolver-members.html b/doxygen/classCabana_1_1Grid_1_1HypreSemiStructuredSolver-members.html index ba443cb9b..d2b40cddd 100644 --- a/doxygen/classCabana_1_1Grid_1_1HypreSemiStructuredSolver-members.html +++ b/doxygen/classCabana_1_1Grid_1_1HypreSemiStructuredSolver-members.html @@ -81,40 +81,43 @@

This is the complete list of members for Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >, including all inherited members.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
checkHypreError(const int error) constCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inlineprotected
createMatrixStencil(int NumSpaceDim, int var=0, int n_vars=3, std::vector< unsigned > stencil_length={ 7, 7, 7 })Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
entity_type typedefCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >
getFinalRelativeResidualNorm()Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
getFinalRelativeResidualNormImpl()=0Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >protectedpure virtual
getHypreSetupFunction() const =0Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >pure virtual
getHypreSolveFunction() const =0Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >pure virtual
getHypreSolver() const =0Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >pure virtual
getNumIter()Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
getNumIterImpl()=0Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >protectedpure virtual
HypreSemiStructuredSolver(const ArrayLayout_t &layout, int n_vars, const bool is_preconditioner=false)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
isPreconditioner() constCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
memory_space typedefCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >
object_typeCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >
printLHS(const char *prefix)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
printMatrix(const char *prefix)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
printRHS(const char *prefix)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setMatrixStencil(const std::vector< std::array< int, NumSpaceDim > > &stencil, int var=0, int dep=0)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setMatrixValues(const Array_t &values, int v_x, int v_h)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setMaxIter(const int max_iter)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setMaxIterImpl(const int max_iter)=0Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >protectedpure virtual
setPreconditioner(const std::shared_ptr< HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace > > &preconditioner)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setPreconditionerImpl(const HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace > &preconditioner)=0Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >protectedpure virtual
setPrintLevel(const int print_level)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setPrintLevelImpl(const int print_level)=0Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >protectedpure virtual
setSolverGraph(int n_vars)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setTolerance(const double tol)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setToleranceImpl(const double tol)=0Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >protectedpure virtual
setup()Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setupImpl(HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x)=0Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >protectedpure virtual
solve(const Array_t &b, Array_t &x, int n_vars=3)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
solveImpl(HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x)=0Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >protectedpure virtual
value_type typedefCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >
~HypreSemiStructuredSolver() (defined in Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inlinevirtual
_ACabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >protected
_bCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >protected
_xCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >protected
checkHypreError(const int error) constCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inlineprotected
createMatrixStencil(int NumSpaceDim, int var=0, int n_vars=3, std::vector< unsigned > stencil_length={ 7, 7, 7 })Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
entity_type typedefCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >
getFinalRelativeResidualNorm()Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
getFinalRelativeResidualNormImpl()=0Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >protectedpure virtual
getHypreSetupFunction() const =0Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >pure virtual
getHypreSolveFunction() const =0Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >pure virtual
getHypreSolver() const =0Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >pure virtual
getNumIter()Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
getNumIterImpl()=0Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >protectedpure virtual
HypreSemiStructuredSolver(const ArrayLayout_t &layout, int n_vars, const bool is_preconditioner=false)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
isPreconditioner() constCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
memory_space typedefCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >
object_typeCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >
printLHS(const char *prefix)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
printMatrix(const char *prefix)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
printRHS(const char *prefix)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setMatrixStencil(const std::vector< std::array< int, NumSpaceDim > > &stencil, int var=0, int dep=0)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setMatrixValues(const Array_t &values, int v_x, int v_h)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setMaxIter(const int max_iter)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setMaxIterImpl(const int max_iter)=0Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >protectedpure virtual
setPreconditioner(const std::shared_ptr< HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace > > &preconditioner)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setPreconditionerImpl(const HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace > &preconditioner)=0Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >protectedpure virtual
setPrintLevel(const int print_level)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setPrintLevelImpl(const int print_level)=0Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >protectedpure virtual
setSolverGraph(int n_vars)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setTolerance(const double tol)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setToleranceImpl(const double tol)=0Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >protectedpure virtual
setup()Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
setupImpl()=0Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >protectedpure virtual
solve(const Array_t &b, Array_t &x, int n_vars=3)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inline
solveImpl()=0Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >protectedpure virtual
value_type typedefCabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >
~HypreSemiStructuredSolver() (defined in Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >)Cabana::Grid::HypreSemiStructuredSolver< Scalar, EntityType, MemorySpace >inlinevirtual