Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
Stokhos_KLReducedMatrixFreeOperator.hpp
Go to the documentation of this file.
1 // $Id: Stokhos_MatrixFreeEpetraOp.hpp,v 1.7 2009/09/14 18:35:48 etphipp Exp $
2 // $Source: /space/CVS/Trilinos/packages/stokhos/src/Stokhos_MatrixFreeEpetraOp.hpp,v $
3 // @HEADER
4 // ***********************************************************************
5 //
6 // Stokhos Package
7 // Copyright (2009) Sandia Corporation
8 //
9 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
10 // license for use of this work by or on behalf of the U.S. Government.
11 //
12 // Redistribution and use in source and binary forms, with or without
13 // modification, are permitted provided that the following conditions are
14 // met:
15 //
16 // 1. Redistributions of source code must retain the above copyright
17 // notice, this list of conditions and the following disclaimer.
18 //
19 // 2. Redistributions in binary form must reproduce the above copyright
20 // notice, this list of conditions and the following disclaimer in the
21 // documentation and/or other materials provided with the distribution.
22 //
23 // 3. Neither the name of the Corporation nor the names of the
24 // contributors may be used to endorse or promote products derived from
25 // this software without specific prior written permission.
26 //
27 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
28 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
31 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
32 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
33 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
35 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
36 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
37 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 //
39 // Questions? Contact Eric T. Phipps (etphipp@sandia.gov).
40 //
41 // ***********************************************************************
42 // @HEADER
43 
44 #ifndef STOKHOS_KL_REDUCED_MATRIX_FREE_OPERATOR_HPP
45 #define STOKHOS_KL_REDUCED_MATRIX_FREE_OPERATOR_HPP
46 
47 #include "Stokhos_SGOperator.hpp"
48 #include "EpetraExt_MultiComm.h"
51 #include "Epetra_Map.h"
53 #include "Teuchos_Array.hpp"
54 
55 #include "Epetra_MultiVector.h"
60 
61 namespace Stokhos {
62 
68 
69  public:
70 
81 
84 
87 
89  virtual void setupOperator(
91 
95 
98  getSGPolynomial() const;
99 
101 
104 
106  virtual int SetUseTranspose(bool UseTranspose);
107 
112  virtual int Apply(const Epetra_MultiVector& Input,
113  Epetra_MultiVector& Result) const;
114 
119  virtual int ApplyInverse(const Epetra_MultiVector& X,
120  Epetra_MultiVector& Y) const;
121 
123  virtual double NormInf() const;
124 
126  virtual const char* Label () const;
127 
129  virtual bool UseTranspose() const;
130 
135  virtual bool HasNormInf() const;
136 
141  virtual const Epetra_Comm & Comm() const;
142 
147  virtual const Epetra_Map& OperatorDomainMap () const;
148 
153  virtual const Epetra_Map& OperatorRangeMap () const;
154 
156 
157  protected:
158 
160  void setup();
161 
162  private:
163 
166 
169 
170  protected:
171 
173  std::string label;
174 
177 
180 
183 
186 
189 
192 
195 
198 
201 
204 
207 
210 
213 
216 
218  int num_KL;
219 
222 
225 
228 
231 
234 
237 
240 
243 
246 
249 
252 
253  }; // class KLReducedMatrixFreeOperator
254 
255 } // namespace Stokhos
256 
257 #endif // STOKHOS_KL_REDUCED_MATRIX_FREE_OPERATOR_HPP
Teuchos_ParameterList.hpp
Stokhos::KLReducedMatrixFreeOperator::num_KL_computed
int num_KL_computed
Number of computed KL terms.
Definition: Stokhos_KLReducedMatrixFreeOperator.hpp:221
Stokhos::KLReducedMatrixFreeOperator::Comm
virtual const Epetra_Comm & Comm() const
Returns a reference to the Epetra_Comm communicator associated with this operator.
Definition: Stokhos_KLReducedMatrixFreeOperator.cpp:189
Stokhos_EpetraSparse3Tensor.hpp
Stokhos::KLReducedMatrixFreeOperator::dot_products
Teuchos::Array< Teuchos::Array< double > > dot_products
Dot products of KL eigenvectors and Jacobian blocks.
Definition: Stokhos_KLReducedMatrixFreeOperator.hpp:233
Stokhos_VectorOrthogPolyTraitsEpetra.hpp
Stokhos::KLReducedMatrixFreeOperator::~KLReducedMatrixFreeOperator
virtual ~KLReducedMatrixFreeOperator()
Destructor.
Definition: Stokhos_KLReducedMatrixFreeOperator.cpp:127
Stokhos::KLReducedMatrixFreeOperator::num_blocks
int num_blocks
Number of blocks.
Definition: Stokhos_KLReducedMatrixFreeOperator.hpp:215
Stokhos::KLReducedMatrixFreeOperator::mean
Teuchos::RCP< Epetra_CrsMatrix > mean
Mean block.
Definition: Stokhos_KLReducedMatrixFreeOperator.hpp:224
Stokhos::KLReducedMatrixFreeOperator
An Epetra operator representing the block stochastic Galerkin operator.
Definition: Stokhos_KLReducedMatrixFreeOperator.hpp:67
Stokhos::KLReducedMatrixFreeOperator::range_base_map
Teuchos::RCP< const Epetra_Map > range_base_map
Stores range base map.
Definition: Stokhos_KLReducedMatrixFreeOperator.hpp:188
Stokhos::KLReducedMatrixFreeOperator::OperatorDomainMap
virtual const Epetra_Map & OperatorDomainMap() const
Returns the Epetra_Map object associated with the domain of this matrix operator.
Definition: Stokhos_KLReducedMatrixFreeOperator.cpp:195
Stokhos::KLReducedMatrixFreeOperator::SetUseTranspose
virtual int SetUseTranspose(bool UseTranspose)
Set to true if the transpose of the operator is requested.
Definition: Stokhos_KLReducedMatrixFreeOperator.cpp:133
Stokhos::KLReducedMatrixFreeOperator::setupOperator
virtual void setupOperator(const Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > &poly)
Setup operator.
Definition: Stokhos_KLReducedMatrixFreeOperator.cpp:92
Stokhos_SGOperator.hpp
Stokhos::KLReducedMatrixFreeOperator::sg_basis
Teuchos::RCP< const Stokhos::OrthogPolyBasis< int, double > > sg_basis
Stochastic Galerking basis.
Definition: Stokhos_KLReducedMatrixFreeOperator.hpp:179
Stokhos_EpetraVectorOrthogPoly.hpp
Stokhos::KLReducedMatrixFreeOperator::block_vec_poly
Teuchos::RCP< Stokhos::EpetraVectorOrthogPoly > block_vec_poly
Polynomial sorting vectorized matrix coefficients.
Definition: Stokhos_KLReducedMatrixFreeOperator.hpp:230
Stokhos::KLReducedMatrixFreeOperator::domain_sg_map
Teuchos::RCP< const Epetra_Map > domain_sg_map
Stores domain SG map.
Definition: Stokhos_KLReducedMatrixFreeOperator.hpp:191
Epetra_Comm
Teuchos_Array.hpp
Stokhos::Sparse3Tensor< int, double >
Stokhos::KLReducedMatrixFreeOperator::HasNormInf
virtual bool HasNormInf() const
Returns true if the this object can provide an approximate Inf-norm, false otherwise.
Definition: Stokhos_KLReducedMatrixFreeOperator.cpp:182
Stokhos_VectorOrthogPoly.hpp
Stokhos::KLReducedMatrixFreeOperator::epetraCijk
Teuchos::RCP< const Stokhos::EpetraSparse3Tensor > epetraCijk
Stores Epetra Cijk tensor.
Definition: Stokhos_KLReducedMatrixFreeOperator.hpp:182
Stokhos_MatrixFreeOperator.hpp
Teuchos::RCP< const EpetraExt::MultiComm >
Stokhos::KLReducedMatrixFreeOperator::operator=
KLReducedMatrixFreeOperator & operator=(const KLReducedMatrixFreeOperator &)
Private to prohibit copying.
Stokhos::KLReducedMatrixFreeOperator::kl_ops
Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > kl_ops
KL blocks as operators.
Definition: Stokhos_KLReducedMatrixFreeOperator.hpp:242
Teuchos::Array
Stokhos::KLReducedMatrixFreeOperator::OperatorRangeMap
virtual const Epetra_Map & OperatorRangeMap() const
Returns the Epetra_Map object associated with the range of this matrix operator.
Definition: Stokhos_KLReducedMatrixFreeOperator.cpp:204
Stokhos::SGOperator
An abstract class to represent a generic stochastic Galerkin operator as an Epetra_Operator.
Definition: Stokhos_SGOperator.hpp:57
Stokhos::KLReducedMatrixFreeOperator::Cijk_type
Stokhos::Sparse3Tensor< int, double > Cijk_type
Short-hand for Cijk.
Definition: Stokhos_KLReducedMatrixFreeOperator.hpp:197
Stokhos::KLReducedMatrixFreeOperator::KLReducedMatrixFreeOperator
KLReducedMatrixFreeOperator(const Teuchos::RCP< const EpetraExt::MultiComm > &sg_comm, const Teuchos::RCP< const Stokhos::OrthogPolyBasis< int, double > > &sg_basis, const Teuchos::RCP< const Stokhos::EpetraSparse3Tensor > &epetraCijk, const Teuchos::RCP< const Epetra_Map > &domain_base_map, const Teuchos::RCP< const Epetra_Map > &range_base_map, const Teuchos::RCP< const Epetra_Map > &domain_sg_map, const Teuchos::RCP< const Epetra_Map > &range_sg_map, const Teuchos::RCP< Teuchos::ParameterList > &params)
Constructor.
Definition: Stokhos_KLReducedMatrixFreeOperator.cpp:53
Stokhos
Top-level namespace for Stokhos classes and functions.
Definition: Stokhos_AbstractPreconditionerFactory.hpp:48
Stokhos::KLReducedMatrixFreeOperator::ApplyInverse
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 ...
Definition: Stokhos_KLReducedMatrixFreeOperator.cpp:152
Stokhos::KLReducedMatrixFreeOperator::Cijk
Teuchos::RCP< const Cijk_type > Cijk
Stores triple product tensor.
Definition: Stokhos_KLReducedMatrixFreeOperator.hpp:200
Stokhos::KLReducedMatrixFreeOperator::Label
virtual const char * Label() const
Returns a character string describing the operator.
Definition: Stokhos_KLReducedMatrixFreeOperator.cpp:168
Stokhos::KLReducedMatrixFreeOperator::num_KL
int num_KL
Number of KL terms.
Definition: Stokhos_KLReducedMatrixFreeOperator.hpp:218
Stokhos::KLReducedMatrixFreeOperator::useTranspose
bool useTranspose
Flag indicating whether transpose was selected.
Definition: Stokhos_KLReducedMatrixFreeOperator.hpp:209
Stokhos::KLReducedMatrixFreeOperator::params
Teuchos::RCP< Teuchos::ParameterList > params
Algorithmic parameters.
Definition: Stokhos_KLReducedMatrixFreeOperator.hpp:206
Stokhos::KLReducedMatrixFreeOperator::kl_blocks
Teuchos::Array< Teuchos::RCP< Epetra_CrsMatrix > > kl_blocks
KL blocks.
Definition: Stokhos_KLReducedMatrixFreeOperator.hpp:239
Stokhos::KLReducedMatrixFreeOperator::sparse_kl_coeffs
Teuchos::RCP< Stokhos::Sparse3Tensor< int, double > > sparse_kl_coeffs
Sparse KL coefficients.
Definition: Stokhos_KLReducedMatrixFreeOperator.hpp:236
Stokhos::KLReducedMatrixFreeOperator::setup
void setup()
Setup KL blocks.
Definition: Stokhos_KLReducedMatrixFreeOperator.cpp:213
Stokhos::KLReducedMatrixFreeOperator::label
std::string label
Label for operator.
Definition: Stokhos_KLReducedMatrixFreeOperator.hpp:173
Stokhos::KLReducedMatrixFreeOperator::do_error_tests
bool do_error_tests
Whether to do KL error tests (can be expensive)
Definition: Stokhos_KLReducedMatrixFreeOperator.hpp:251
Stokhos::KLReducedMatrixFreeOperator::Apply
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 ...
Definition: Stokhos_KLReducedMatrixFreeOperator.cpp:145
Stokhos::KLReducedMatrixFreeOperator::getSGPolynomial
virtual Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > getSGPolynomial()
Get SG polynomial.
Definition: Stokhos_KLReducedMatrixFreeOperator.cpp:114
Stokhos::KLReducedMatrixFreeOperator::UseTranspose
virtual bool UseTranspose() const
Returns the current UseTranspose setting.
Definition: Stokhos_KLReducedMatrixFreeOperator.cpp:175
Epetra_MultiVector
Stokhos::KLReducedMatrixFreeOperator::block_ops
Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > block_ops
Stores operators.
Definition: Stokhos_KLReducedMatrixFreeOperator.hpp:203
Stokhos_OrthogPolyBasis.hpp
Stokhos::KLReducedMatrixFreeOperator::kl_mat_free_op
Teuchos::RCP< Stokhos::MatrixFreeOperator > kl_mat_free_op
Matrix-Free operator using KL operators.
Definition: Stokhos_KLReducedMatrixFreeOperator.hpp:245
Epetra_Map.h
Stokhos::KLReducedMatrixFreeOperator::NormInf
virtual double NormInf() const
Returns an approximate infinity norm of the operator matrix.
Definition: Stokhos_KLReducedMatrixFreeOperator.cpp:160
Stokhos::KLReducedMatrixFreeOperator::expansion_size
int expansion_size
Number of terms in expansion.
Definition: Stokhos_KLReducedMatrixFreeOperator.hpp:212
Stokhos::KLReducedMatrixFreeOperator::domain_base_map
Teuchos::RCP< const Epetra_Map > domain_base_map
Stores domain base map.
Definition: Stokhos_KLReducedMatrixFreeOperator.hpp:185
Stokhos::KLReducedMatrixFreeOperator::range_sg_map
Teuchos::RCP< const Epetra_Map > range_sg_map
Stores range SG map.
Definition: Stokhos_KLReducedMatrixFreeOperator.hpp:194
Stokhos::KLReducedMatrixFreeOperator::sg_comm
Teuchos::RCP< const EpetraExt::MultiComm > sg_comm
Stores SG parallel communicator.
Definition: Stokhos_KLReducedMatrixFreeOperator.hpp:176
Epetra_Map
Stokhos::KLReducedMatrixFreeOperator::block_vec_map
Teuchos::RCP< Epetra_Map > block_vec_map
Block map for vectorized-matrices.
Definition: Stokhos_KLReducedMatrixFreeOperator.hpp:227
Epetra_MultiVector.h
Stokhos::KLReducedMatrixFreeOperator::drop_tolerance
double drop_tolerance
Tolerance for dropping entries in sparse 3 tensor.
Definition: Stokhos_KLReducedMatrixFreeOperator.hpp:248
Stokhos::OrthogPolyBasis< int, double >