Teko Version of the Day
Loading...
Searching...
No Matches
Teko_PreconditionerState.cpp
1// @HEADER
2// *****************************************************************************
3// Teko: A package for block and physics based preconditioning
4//
5// Copyright 2010 NTESS and the Teko contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#include "Teko_PreconditionerState.hpp"
11
12#include "Thyra_DefaultPreconditioner.hpp"
13
14using namespace Thyra;
15
16namespace Teko {
18
20void PreconditionerState::setParameterList(const RCP<Teuchos::ParameterList>& paramList) {
21 paramList_ = paramList;
22}
23
25RCP<Teuchos::ParameterList> PreconditionerState::getNonconstParameterList() {
26 if (paramList_ == Teuchos::null) paramList_ = Teuchos::rcp(new Teuchos::ParameterList());
27
28 return paramList_;
29}
30
32RCP<Teuchos::ParameterList> PreconditionerState::unsetParameterList() {
33 RCP<Teuchos::ParameterList> paramList = paramList_;
34 paramList_ = Teuchos::null;
35 return paramList;
36}
37
39void PreconditionerState::merge(const PreconditionerState& ps, int /* position */) {
40 // merge the two linearOps lists
41 linearOps_.insert(ps.linearOps_.begin(), ps.linearOps_.end());
42
43 // merge two parameter lists
44 Teuchos::ParameterList::ConstIterator itr;
45 if (ps.paramList_ != Teuchos::null) {
46 Teuchos::RCP<Teuchos::ParameterList> paramList = getNonconstParameterList();
47 for (itr = ps.paramList_->begin(); itr != ps.paramList_->end(); ++itr)
48 paramList->setEntry(itr->first, itr->second);
49 }
50}
51
53unsigned int PreconditionerState::getTag() const { return tag_; }
54
56void PreconditionerState::setTag(unsigned int tag) { tag_ = tag; }
57
59
60} // end namespace Teko
Teuchos::RCP< Teuchos::ParameterList > unsetParameterList()
Unset the parameter list that was set using setParameterList().
void setParameterList(const Teuchos::RCP< Teuchos::ParameterList > &paramList)
Set parameters from a parameter list and return with default values.
unsigned int getTag() const
Get the tag for this operator.
void setTag(unsigned int tag)
Set the tag for this operator.
Teuchos::RCP< Teuchos::ParameterList > getNonconstParameterList()
Get the parameter list that was set using setParameterList().
virtual void merge(const PreconditionerState &ps, int position=-1)
Merge internal storage of another PreconditionerState object into this one.
Teuchos::RCP< Teuchos::ParameterList > paramList_
for ParameterListAcceptor