//=========================================================================== // GoTools Core - SINTEF Geometry Tools Core library, version 2.0.1 // // Copyright (C) 2000-2007, 2010 SINTEF ICT, Applied Mathematics, Norway. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation version 2 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., // 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. // // Contact information: E-mail: tor.dokken@sintef.no // SINTEF ICT, Department of Applied Mathematics, // P.O. Box 124 Blindern, // 0314 Oslo, Norway. // // Other licenses are also available for this software, notably licenses // for: // - Building commercial software. // - Building software whose source code you wish to keep private. //=========================================================================== 00018 #ifndef _SOLVEBCG_H 00019 #define _SOLVEBCG_H 00020 00021 00022 #include "GoTools/creators/SolveCG.h" 00023 00024 namespace Go 00025 { 00026 00027 class SolveBCG : public SolveCG 00028 { 00029 00030 public: 00031 00032 SolveBCG(int conv_type, bool symm); 00033 00034 // Destructor. 00035 virtual ~SolveBCG(); 00036 00037 // Prepare for preconditioning. 00038 virtual void precond(double relaxfac); 00039 00040 // Solve the equation system. 00041 virtual int solve(double *ex, double *eb, int nn); 00042 00043 00044 private: 00045 00046 double omega_; // Relaxation parameter. 00047 int conv_type_; // We operate with 4 different types of convergence estimates. 00048 bool symm_; 00049 00050 void precondRILU(double relaxfac); // @@sbr Not sure RILU is what we will be using... 00051 00052 // Helper funtion, return largest element in array (i.e. the sup-norm). 00053 double max_abs_element(double* x, int nn); 00054 00055 }; 00056 00057 } // end namespace Go 00058 00059 00060 #endif // _SOLVEBCG_H 00061