Teko
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
src
mlutils
Teko_MLPreconditionerFactory.hpp
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
#ifndef __Teko_MLPrecondtionerFactory_hpp__
11
#define __Teko_MLPrecondtionerFactory_hpp__
12
13
#include "Teko_BlockPreconditionerFactory.hpp"
14
15
#include "ml_include.h"
16
#include "ml_operator.h"
17
18
namespace
ML_Epetra {
19
class
MultiLevelPreconditioner;
20
}
21
22
namespace
Teko {
23
25
class
MLPreconditionerState :
public
BlockPreconditionerState
{
26
public
:
27
MLPreconditionerState();
28
30
Teuchos::RCP<ML_Epetra::MultiLevelPreconditioner>
constructMLPreconditioner
(
31
const
Teuchos::ParameterList &mainList,
32
const
std::vector<Teuchos::RCP<const Teuchos::ParameterList> > &coarseningParams);
33
34
// Set functions
36
38
void
setMLComm
(ML_Comm *comm);
39
41
void
setMLOperator
(ML_Operator *op);
42
44
void
setIsFilled
(
bool
value);
45
47
void
setAggregationMatrices
(
const
std::vector<Epetra_RowMatrix *> &diags);
48
49
// Get functions
51
53
bool
isFilled
()
const
;
54
55
protected
:
56
static
void
cleanup_ML_Comm(ML_Comm *mlComm);
57
static
void
cleanup_ML_Operator(ML_Operator *mlComm);
58
59
bool
isFilled_;
60
Teuchos::RCP<ML_Comm> mlComm_;
// note that this has to be properly clean up!
61
Teuchos::RCP<ML_Operator> mlOp_;
// note that this has to be properly clean up!
62
63
std::vector<Epetra_RowMatrix *> diagonalOps_;
// patterns for setting up aggregation
64
Teuchos::RCP<ML_Epetra::MultiLevelPreconditioner> mlPreconditioner_;
65
};
66
70
class
MLPreconditionerFactory :
public
BlockPreconditionerFactory
{
71
public
:
72
MLPreconditionerFactory();
73
77
virtual
LinearOp
buildPreconditionerOperator
(BlockedLinearOp &blo,
78
BlockPreconditionerState
&state)
const
;
79
83
virtual
Teuchos::RCP<PreconditionerState>
buildPreconditionerState
()
const
;
84
88
void
initializeFromParameterList
(
const
Teuchos::ParameterList &settings);
89
90
protected
:
96
void
fillMLPreconditionerState
(
const
BlockedLinearOp &blo,
MLPreconditionerState
&mlState)
const
;
97
98
int
blockRowCount_;
99
std::vector<Teuchos::RCP<const Teuchos::ParameterList> > coarseningParams_;
100
Teuchos::ParameterList mainParams_;
101
};
102
103
}
// end namespace Teko
104
105
#endif
Teko::BlockPreconditionerFactory
Abstract class which block preconditioner factories in Teko should be based on.
Definition
Teko_BlockPreconditionerFactory.hpp:63
Teko::BlockPreconditionerState
An implementation of a state object for block preconditioners.
Definition
Teko_BlockPreconditionerFactory.hpp:43
Teko::MLPreconditionerFactory::initializeFromParameterList
void initializeFromParameterList(const Teuchos::ParameterList &settings)
This function builds the internals of the preconditioner factory from a parameter list.
Definition
Teko_MLPreconditionerFactory.cpp:142
Teko::MLPreconditionerFactory::fillMLPreconditionerState
void fillMLPreconditionerState(const BlockedLinearOp &blo, MLPreconditionerState &mlState) const
Fills an ML preconditioner state object.
Definition
Teko_MLPreconditionerFactory.cpp:87
Teko::MLPreconditionerFactory::buildPreconditionerState
virtual Teuchos::RCP< PreconditionerState > buildPreconditionerState() const
Function that permits the construction of an arbitrary PreconditionerState object.
Definition
Teko_MLPreconditionerFactory.cpp:83
Teko::MLPreconditionerFactory::buildPreconditionerOperator
virtual LinearOp buildPreconditionerOperator(BlockedLinearOp &blo, BlockPreconditionerState &state) const
Function that is called to build the preconditioner for the linear operator that is passed in.
Definition
Teko_MLPreconditionerFactory.cpp:69
Teko::MLPreconditionerState
Contains operator internals need for ML.
Definition
Teko_MLPreconditionerFactory.hpp:25
Teko::MLPreconditionerState::isFilled
bool isFilled() const
Has this object been filled yet.
Definition
Teko_MLPreconditionerFactory.cpp:40
Teko::MLPreconditionerState::setAggregationMatrices
void setAggregationMatrices(const std::vector< Epetra_RowMatrix * > &diags)
Set matrices to build multigrid hierarcy from.
Definition
Teko_MLPreconditionerFactory.cpp:46
Teko::MLPreconditionerState::setIsFilled
void setIsFilled(bool value)
Set if ML internals been constructed yet.
Definition
Teko_MLPreconditionerFactory.cpp:38
Teko::MLPreconditionerState::setMLOperator
void setMLOperator(ML_Operator *op)
set ML Operator pointer...it will be automatically cleaned up
Definition
Teko_MLPreconditionerFactory.cpp:33
Teko::MLPreconditionerState::setMLComm
void setMLComm(ML_Comm *comm)
set ML Comm pointer...it will be automatically cleaned up
Definition
Teko_MLPreconditionerFactory.cpp:29
Teko::MLPreconditionerState::constructMLPreconditioner
Teuchos::RCP< ML_Epetra::MultiLevelPreconditioner > constructMLPreconditioner(const Teuchos::ParameterList &mainList, const std::vector< Teuchos::RCP< const Teuchos::ParameterList > > &coarseningParams)
Build an ML preconditioner object using the set of coarsening parameters.
Definition
Teko_MLPreconditionerFactory.cpp:50
Generated by
1.17.0