00001 // $Id: FEApp_SGMeanPrecOp.hpp,v 1.1 2008/08/01 22:57:12 etphipp Exp $ 00002 // $Source: /space/CVS/Trilinos/packages/sacado/example/FEApp/FEApp_SGMeanPrecOp.hpp,v $ 00003 // @HEADER 00004 // *********************************************************************** 00005 // 00006 // Sacado Package 00007 // Copyright (2006) Sandia Corporation 00008 // 00009 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 00010 // the U.S. Government retains certain rights in this software. 00011 // 00012 // This library is free software; you can redistribute it and/or modify 00013 // it under the terms of the GNU Lesser General Public License as 00014 // published by the Free Software Foundation; either version 2.1 of the 00015 // License, or (at your option) any later version. 00016 // 00017 // This library is distributed in the hope that it will be useful, but 00018 // WITHOUT ANY WARRANTY; without even the implied warranty of 00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00020 // Lesser General Public License for more details. 00021 // 00022 // You should have received a copy of the GNU Lesser General Public 00023 // License along with this library; if not, write to the Free Software 00024 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00025 // USA 00026 // Questions? Contact David M. Gay (dmgay@sandia.gov) or Eric T. Phipps 00027 // (etphipp@sandia.gov). 00028 // 00029 // *********************************************************************** 00030 // @HEADER 00031 00032 #ifndef FEAPP_SGMEANPRECOP_HPP 00033 #define FEAPP_SGMEANPRECOP_HPP 00034 00035 #include "FEApp_TemplateTypes.hpp" 00036 00037 #if SGFAD_ACTIVE 00038 00039 #include "Teuchos_RCP.hpp" 00040 00041 #include "Epetra_Operator.h" 00042 #include "Epetra_Map.h" 00043 #include "Epetra_CrsMatrix.h" 00044 #include "Epetra_MultiVector.h" 00045 #include "EpetraExt_BlockMultiVector.h" 00046 #include "Ifpack.h" 00047 00048 namespace FEApp { 00049 00053 class SGMeanPrecOp : public Epetra_Operator { 00054 00055 public: 00056 00058 SGMeanPrecOp(const Teuchos::RCP<const Epetra_Map>& base_map, 00059 const Teuchos::RCP<const Epetra_Map>& sg_map, 00060 unsigned int num_blocks, 00061 const Teuchos::RCP<Epetra_CrsMatrix>& mean_jac, 00062 const Teuchos::RCP<Teuchos::ParameterList>& precParams); 00063 00065 virtual ~SGMeanPrecOp(); 00066 00068 int reset(); 00069 00071 Teuchos::RCP<Epetra_CrsMatrix> getMeanJacobian(); 00072 00074 virtual int SetUseTranspose(bool UseTranspose); 00075 00080 virtual int Apply(const Epetra_MultiVector& Input, 00081 Epetra_MultiVector& Result) const; 00082 00087 virtual int ApplyInverse(const Epetra_MultiVector& X, 00088 Epetra_MultiVector& Y) const; 00089 00091 virtual double NormInf() const; 00092 00094 virtual const char* Label () const; 00095 00097 virtual bool UseTranspose() const; 00098 00103 virtual bool HasNormInf() const; 00104 00109 virtual const Epetra_Comm & Comm() const; 00110 00115 virtual const Epetra_Map& OperatorDomainMap () const; 00116 00121 virtual const Epetra_Map& OperatorRangeMap () const; 00122 00123 private: 00124 00126 SGMeanPrecOp(const SGMeanPrecOp&); 00127 00129 SGMeanPrecOp& operator=(const SGMeanPrecOp&); 00130 00131 protected: 00132 00134 string label; 00135 00137 Teuchos::RCP<const Epetra_Map> base_map; 00138 00140 Teuchos::RCP<const Epetra_Map> sg_map; 00141 00143 Teuchos::RCP<Epetra_CrsMatrix> mean_jac; 00144 00146 Teuchos::RCP<Teuchos::ParameterList> precParams; 00147 00149 bool useTranspose; 00150 00152 unsigned int num_blocks; 00153 00155 mutable Teuchos::RCP<EpetraExt::BlockMultiVector> sg_input; 00156 00158 mutable Teuchos::RCP<EpetraExt::BlockMultiVector> sg_result; 00159 00161 mutable std::vector< Teuchos::RCP<Epetra_MultiVector> > input_block; 00162 00164 mutable std::vector< Teuchos::RCP<Epetra_MultiVector> > result_block; 00165 00167 Teuchos::RCP<Ifpack_Preconditioner> ifpackPrec; 00168 00169 }; // class SGMeanPrecOp 00170 00171 } // namespace FEApp 00172 00173 #endif // SGFAD_ACTIVE 00174 00175 #endif // FEAPP_SGMEANPRECOP_HPP
1.4.7