Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Stokhos_FullyAssembledPreconditioner.cpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Stokhos Package
4 //
5 // Copyright 2009 NTESS and the Stokhos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
12 
16  const Teuchos::RCP<Teuchos::ParameterList>& params_) :
17  label("Stokhos Fully Assembled Preconditioner"),
18  prec_factory(prec_factory_),
19  prec()
20 {
21 }
22 
25 {
26 }
27 
28 void
31  const Epetra_Vector& x)
32 {
33 
35  Teuchos::rcp_dynamic_cast<Stokhos::FullyAssembledOperator>(sg_op, true);
36  prec = prec_factory->compute(Teuchos::rcp_dynamic_cast<Epetra_CrsMatrix>(fa_op));
37  label = std::string("Stokhos Fully Assembled Preconditioner:\n") +
38  std::string(" ***** ") +
39  std::string(prec->Label());
40 }
41 
42 int
44 SetUseTranspose(bool UseTheTranspose)
45 {
46  return prec->SetUseTranspose(UseTheTranspose);
47 }
48 
49 int
51 Apply(const Epetra_MultiVector& Input, Epetra_MultiVector& Result) const
52 {
53  return prec->Apply(Input, Result);
54 }
55 
56 int
59 {
60  return prec->ApplyInverse(Input, Result);
61 }
62 
63 double
65 NormInf() const
66 {
67  return prec->NormInf();
68 }
69 
70 
71 const char*
73 Label () const
74 {
75  return const_cast<char*>(label.c_str());
76 }
77 
78 bool
80 UseTranspose() const
81 {
82  return prec->UseTranspose();
83 }
84 
85 bool
87 HasNormInf() const
88 {
89  return prec->HasNormInf();
90 }
91 
92 const Epetra_Comm &
94 Comm() const
95 {
96  return prec->Comm();
97 }
98 const Epetra_Map&
101 {
102  return prec->OperatorDomainMap();
103 }
104 
105 const Epetra_Map&
108 {
109  return prec->OperatorRangeMap();
110 }
virtual bool HasNormInf() const
Returns true if the this object can provide an approximate Inf-norm, false otherwise.
FullyAssembledPreconditioner(const Teuchos::RCP< Stokhos::AbstractPreconditionerFactory > &prec_factory, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor.
virtual const char * Label() const
Returns a character string describing the operator.
virtual const Epetra_Map & OperatorRangeMap() const
Returns the Epetra_Map object associated with the range of this matrix operator.
virtual int Apply(const Epetra_MultiVector &Input, Epetra_MultiVector &Result) const
Returns the result of a Epetra_Operator applied to a Epetra_MultiVector Input in Result as described ...
virtual int SetUseTranspose(bool UseTranspose)
Set to true if the transpose of the operator is requested.
virtual void setupPreconditioner(const Teuchos::RCP< Stokhos::SGOperator > &sg_op, const Epetra_Vector &x)
Setup preconditioner.
virtual double NormInf() const
Returns an approximate infinity norm of the operator matrix.
virtual bool UseTranspose() const
Returns the current UseTranspose setting.
virtual const Epetra_Comm & Comm() const
Returns a reference to the Epetra_Comm communicator associated with this operator.
virtual int ApplyInverse(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Returns the result of the inverse of the operator applied to a Epetra_MultiVector Input in Result as ...
virtual const Epetra_Map & OperatorDomainMap() const
Returns the Epetra_Map object associated with the domain of this matrix operator. ...
An Epetra operator representing the block stochastic Galerkin operator generated by fully assembling ...