// @HEADER // ***************************************************************************** // Stokhos Package // // Copyright 2009 NTESS and the Stokhos contributors. // SPDX-License-Identifier: BSD-3-Clause // ***************************************************************************** // @HEADER #ifndef STOKHOS_INTERLACED_OPERATOR_HPP #define STOKHOS_INTERLACED_OPERATOR_HPP #include "Stokhos_SGOperator.hpp" #include "EpetraExt_MultiComm.h" #include "Stokhos_OrthogPolyBasis.hpp" #include "Stokhos_EpetraSparse3Tensor.hpp" #include "Teuchos_ParameterList.hpp" #include "EpetraExt_BlockCrsMatrix.h" #include namespace Stokhos { /*! * \brief An Epetra operator representing the block stochastic Galerkin * operator generated by fully assembling the matrix. The ordering of this * operator is interlaced. That means that all stochastic degrees of freedom * associated with a deterministic degree of freedom are interlaced. The result * is a large sparse matrix that is composed of small (relatively) dense blocks. */ class InterlacedOperator : public Stokhos::SGOperator, public EpetraExt::BlockCrsMatrix { public: //! Constructor InterlacedOperator( const Teuchos::RCP& sg_comm, const Teuchos::RCP >& sg_basis, const Teuchos::RCP& epetraCijk, const Teuchos::RCP& base_graph, const Teuchos::RCP& params); //! Destructor virtual ~InterlacedOperator(); /** \name Stokhos::SGOperator methods */ //@{ //! Setup operator virtual void setupOperator( const Teuchos::RCP& poly); //! Get SG polynomial virtual Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > getSGPolynomial(); //! Get SG polynomial virtual Teuchos::RCP getSGPolynomial() const; //@} //! Sum into global matrix void SumIntoGlobalBlock_Deterministic(double alpha,const Epetra_RowMatrix & determBlock,int Row,int Col); private: //! Private to prohibit copying InterlacedOperator(const InterlacedOperator&); //! Private to prohibit copying InterlacedOperator& operator=(const InterlacedOperator&); protected: //! Stores SG parallel communicator Teuchos::RCP sg_comm; //! Stochastic Galerking basis Teuchos::RCP > sg_basis; //! Stores Epetra Cijk tensor Teuchos::RCP epetraCijk; //! Short-hand for Cijk typedef Stokhos::Sparse3Tensor Cijk_type; //! Stores triple product tensor Teuchos::RCP Cijk; //! Stores operators Teuchos::RCP block_ops; //! Flag indicating whether operator be scaled with <\psi_i^2> bool scale_op; //! Flag indicating whether to include mean term bool include_mean; //! Flag indicating whether to only use linear terms bool only_use_linear; int determOffset_; }; // class InterlacedOperator } // namespace Stokhos #endif // STOKHOS_INTERLACED_OPERATOR_HPP