Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Stokhos_SGOperatorFactory.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 
15 #include "Teuchos_Assert.hpp"
16 
19  params(params_)
20 {
21 }
22 
26  const Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> >& sg_basis,
28  const Teuchos::RCP<const Epetra_Map>& domain_base_map,
29  const Teuchos::RCP<const Epetra_Map>& range_base_map,
30  const Teuchos::RCP<const Epetra_Map>& domain_sg_map,
31  const Teuchos::RCP<const Epetra_Map>& range_sg_map)
32 {
34  std::string op_method = params->get("Operator Method", "Matrix Free");
35  if (op_method == "Matrix Free") {
37  sg_comm, sg_basis, epetraCijk,
38  domain_base_map, range_base_map,
39  domain_sg_map, range_sg_map, params));
40  }
41  else if (op_method == "KL Matrix Free") {
43  sg_comm, sg_basis, epetraCijk,
44  domain_base_map, range_base_map,
45  domain_sg_map, range_sg_map, params));
46  }
47  else if (op_method == "KL Reduced Matrix Free") {
49  sg_comm, sg_basis, epetraCijk,
50  domain_base_map, range_base_map,
51  domain_sg_map, range_sg_map, params));
52  }
53  else if (op_method == "Fully Assembled") {
55  params->get< Teuchos::RCP<const Epetra_CrsGraph> >("Base Graph");
57  sg_comm, sg_basis, epetraCijk, base_graph,
58  domain_sg_map, range_sg_map, params));
59  }
60  else
61  TEUCHOS_TEST_FOR_EXCEPTION(true, std::logic_error,
62  "Error! Unknown operator method " << op_method
63  << "." << std::endl);
64 
65  return sg_op;
66 }
An Epetra operator representing the block stochastic Galerkin operator.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
An Epetra operator representing the block stochastic Galerkin operator.
T * get() const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
virtual Teuchos::RCP< Stokhos::SGOperator > build(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)
Build preconditioner operator.
SGOperatorFactory(const Teuchos::RCP< Teuchos::ParameterList > &params)
Constructor.
An Epetra operator representing the block stochastic Galerkin operator.
An Epetra operator representing the block stochastic Galerkin operator generated by fully assembling ...