OOPS
GMRESRMinimizer.h
Go to the documentation of this file.
1
/*
2
* (C) Copyright 2009-2016 ECMWF.
3
*
4
* This software is licensed under the terms of the Apache Licence Version 2.0
5
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6
* In applying this licence, ECMWF does not waive the privileges and immunities
7
* granted to it by virtue of its status as an intergovernmental organisation nor
8
* does it submit to any jurisdiction.
9
*/
10
11
#ifndef OOPS_ASSIMILATION_GMRESRMINIMIZER_H_
12
#define OOPS_ASSIMILATION_GMRESRMINIMIZER_H_
13
14
#include <string>
15
16
#include "
oops/assimilation/BMatrix.h
"
17
#include "
oops/assimilation/ControlIncrement.h
"
18
#include "
oops/assimilation/CostFunction.h
"
19
#include "
oops/assimilation/GMRESR.h
"
20
#include "
oops/assimilation/HessianMatrix.h
"
21
#include "
oops/assimilation/PrimalMinimizer.h
"
22
23
namespace
oops
{
24
25
/// GMRESR Minimizer
26
/*!
27
* Implements the GMRESR algorithm.
28
*/
29
30
// -----------------------------------------------------------------------------
31
32
template
<
typename
MODEL,
typename
OBS>
class
GMRESRMinimizer
:
public
PrimalMinimizer
<MODEL, OBS> {
33
typedef
BMatrix<MODEL, OBS>
Bmat_
;
34
typedef
CostFunction<MODEL, OBS>
CostFct_
;
35
typedef
ControlIncrement<MODEL, OBS>
CtrlInc_
;
36
typedef
HessianMatrix<MODEL, OBS>
Hessian_
;
37
38
public
:
39
const
std::string
classname
()
const override
{
return
"GMRESRMinimizer"
;}
40
GMRESRMinimizer
(
const
eckit::Configuration &,
const
CostFct_
& J)
41
:
PrimalMinimizer
<MODEL, OBS>(J) {}
42
~GMRESRMinimizer
() {}
43
44
private
:
45
double
solve
(
CtrlInc_
&,
const
CtrlInc_
&,
46
const
Hessian_
&,
const
Bmat_
&,
47
const
int
,
const
double
)
override
;
48
};
49
50
// =============================================================================
51
52
template
<
typename
MODEL,
typename
OBS>
53
double
GMRESRMinimizer<MODEL, OBS>::solve
(
CtrlInc_
& dx,
const
CtrlInc_
& rhs,
54
const
Hessian_
& hessian,
const
Bmat_
& B,
55
const
int
ninner,
const
double
gnreduc) {
56
// Solve the linear system
57
double
reduc =
GMRESR
(dx, rhs, hessian, B, ninner, gnreduc);
58
return
reduc;
59
}
60
61
// -----------------------------------------------------------------------------
62
63
}
// namespace oops
64
65
#endif // OOPS_ASSIMILATION_GMRESRMINIMIZER_H_
oops::PrimalMinimizer
Primal Minimizer.
Definition:
PrimalMinimizer.h:33
oops
The namespace for the main oops code.
Definition:
ErrorCovarianceL95.cc:22
oops::GMRESR
double GMRESR(VECTOR &xx, const VECTOR &bb, const AMATRIX &A, const PMATRIX &precond, const int maxiter, const double tolerance)
Definition:
GMRESR.h:63
oops::GMRESRMinimizer::CtrlInc_
ControlIncrement< MODEL, OBS > CtrlInc_
Definition:
GMRESRMinimizer.h:35
HessianMatrix.h
CostFunction.h
PrimalMinimizer.h
GMRESR.h
GMRESR solver for Ax=b.
oops::GMRESRMinimizer::solve
double solve(CtrlInc_ &, const CtrlInc_ &, const Hessian_ &, const Bmat_ &, const int, const double) override
Definition:
GMRESRMinimizer.h:53
oops::GMRESRMinimizer
GMRESR Minimizer.
Definition:
GMRESRMinimizer.h:32
oops::ControlIncrement
Definition:
ControlIncrement.h:46
oops::GMRESRMinimizer::Hessian_
HessianMatrix< MODEL, OBS > Hessian_
Definition:
GMRESRMinimizer.h:36
oops::HessianMatrix
The Hessian matrix: .
Definition:
HessianMatrix.h:31
BMatrix.h
oops::GMRESRMinimizer::classname
const std::string classname() const override
Definition:
GMRESRMinimizer.h:39
oops::GMRESRMinimizer::GMRESRMinimizer
GMRESRMinimizer(const eckit::Configuration &, const CostFct_ &J)
Definition:
GMRESRMinimizer.h:40
oops::GMRESRMinimizer::Bmat_
BMatrix< MODEL, OBS > Bmat_
Definition:
GMRESRMinimizer.h:33
oops::GMRESRMinimizer::~GMRESRMinimizer
~GMRESRMinimizer()
Definition:
GMRESRMinimizer.h:42
ControlIncrement.h
oops::BMatrix
The matrix.
Definition:
BMatrix.h:27
oops::CostFunction
Cost Function.
Definition:
CostFunction.h:53
oops::GMRESRMinimizer::CostFct_
CostFunction< MODEL, OBS > CostFct_
Definition:
GMRESRMinimizer.h:34
fv3-bundle
oops
src
oops
assimilation
GMRESRMinimizer.h
Generated on Sun Oct 25 2020 12:42:57 for OOPS by
1.8.18