Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Stokhos_MPPreconditionerFactory.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 
14 #include "Teuchos_Assert.hpp"
15 
18  params(params_)
19 {
20 }
21 
25  int num_mp_blocks,
26  const Teuchos::RCP<const Epetra_Map>& base_map,
27  const Teuchos::RCP<const Epetra_Map>& mp_map)
28 {
30  std::string prec_method = params->get("Preconditioner Method",
31  "Block Diagonal");
32  if (prec_method == "Block Diagonal") {
34  buildPointPreconditionerFactory();
36  mp_comm, num_mp_blocks,
37  base_map, mp_map, prec_factory,
38  params));
39  }
40  else if (prec_method == "Mean-based") {
42  buildPointPreconditionerFactory();
44  mp_comm, num_mp_blocks,
45  base_map, mp_map, prec_factory,
46  params));
47  }
48  else if (prec_method == "None")
49  mp_prec = Teuchos::null;
50  else
51  TEUCHOS_TEST_FOR_EXCEPTION(true, std::logic_error,
52  "Error! Unknown preconditioner method " << prec_method
53  << "." << std::endl);
54 
55  return mp_prec;
56 }
57 
61 {
62  std::string prec_name =
63  params->get("MP Preconditioner Type", "Ifpack");
65  Teuchos::rcp(&params->sublist("MP Preconditioner Parameters"),false);
66  return Teuchos::rcp(new Stokhos::PreconditionerFactory(prec_name,
67  precParams));
68 }
virtual Teuchos::RCP< Stokhos::MPPreconditioner > build(const Teuchos::RCP< const EpetraExt::MultiComm > &mp_comm, int num_mp_blocks, const Teuchos::RCP< const Epetra_Map > &base_map, const Teuchos::RCP< const Epetra_Map > &mp_map)
Build preconditioner operator.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
T * get() const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Teuchos::RCP< Stokhos::AbstractPreconditionerFactory > buildPointPreconditionerFactory()
Build preconditioner factory for each point.
MPPreconditionerFactory(const Teuchos::RCP< Teuchos::ParameterList > &params)
Constructor.
An class for building preconditioners.
A multi-point preconditioner based on applying the inverse of the diagonal.
A multi-point preconditioner based on applying the inverse of the mean.