OOPS
CostJbState.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_COSTJBSTATE_H_
12 #define OOPS_ASSIMILATION_COSTJBSTATE_H_
13 
14 #include <memory>
15 #include <boost/noncopyable.hpp>
16 
19 
20 namespace util {
21  class Duration;
22 }
23 
24 namespace oops {
25 
26 // Forward declaration
27  template<typename MODEL> class Increment;
28  template<typename MODEL> class State;
29  template<typename MODEL> class JqTermTLAD;
30 
31 // -----------------------------------------------------------------------------
32 
33 /// Jb Cost Function Base Class
34 /*!
35  * The CostJbState is the base class for the Jb term corresponding to the
36  * state part of the control variable.
37  */
38 
39 template<typename MODEL> class CostJbState : private boost::noncopyable {
43 
44  public:
45 /// Constructor
47 
48 /// Destructor
49  virtual ~CostJbState() {}
50 
51 /// Get increment from state. This is usually first guess - background.
52 /// The third state argument is M(x) at the end of the window/subwindows for
53 /// computing the model error term (M(x_{i-1})-x_i) when active.
54  virtual void computeIncrement(const State_ &, const State_ &, const State_ &,
55  Increment_ &) const = 0;
56 
57 /// Linearize before the linear computations.
58  virtual void linearize(const State_ &, const Geometry_ &) = 0;
59 
60 /// Add Jb gradient.
61  virtual void addGradient(const Increment_ &, Increment_ &, Increment_ &) const = 0;
62 
63 /// Initialize Jq computations if needed.
64  virtual JqTermTLAD<MODEL> * initializeJqTLAD() const = 0;
65 
66 /// Finalize \f$ J_b\f$ after the TL run.
67  virtual JqTermTLAD<MODEL> * initializeJqTL() const = 0;
68 
69 /// Initialize \f$ J_b\f$ before the AD run.
70  virtual JqTermTLAD<MODEL> * initializeJqAD(const Increment_ &) const = 0;
71 
72 /// Multiply by \f$ B\f$ and \f$ B^{-1}\f$.
73  virtual void Bmult(const Increment_ &, Increment_ &) const = 0;
74  virtual void Bminv(const Increment_ &, Increment_ &) const = 0;
75 
76 /// Randomize
77  virtual void randomize(Increment_ &) const = 0;
78 
79 /// Create new increment (set to 0).
80  virtual Increment_ * newStateIncrement() const = 0;
81 };
82 
83 // -----------------------------------------------------------------------------
84 
85 } // namespace oops
86 
87 #endif // OOPS_ASSIMILATION_COSTJBSTATE_H_
oops::CostJbState::initializeJqTL
virtual JqTermTLAD< MODEL > * initializeJqTL() const =0
Finalize after the TL run.
oops
The namespace for the main oops code.
Definition: ErrorCovarianceL95.cc:22
oops::CostJbState::initializeJqAD
virtual JqTermTLAD< MODEL > * initializeJqAD(const Increment_ &) const =0
Initialize before the AD run.
oops::CostJbState::CostJbState
CostJbState()
Constructor.
Definition: CostJbState.h:46
oops::CostJbState::computeIncrement
virtual void computeIncrement(const State_ &, const State_ &, const State_ &, Increment_ &) const =0
oops::CostJbState::~CostJbState
virtual ~CostJbState()
Destructor.
Definition: CostJbState.h:49
oops::CostJbState
Jb Cost Function Base Class.
Definition: CostJbState.h:39
oops::CostJbState::newStateIncrement
virtual Increment_ * newStateIncrement() const =0
Create new increment (set to 0).
oops::JqTermTLAD
Definition: CostJb3D.h:29
oops::CostJbState::addGradient
virtual void addGradient(const Increment_ &, Increment_ &, Increment_ &) const =0
Add Jb gradient.
oops::CostJbState::linearize
virtual void linearize(const State_ &, const Geometry_ &)=0
Linearize before the linear computations.
oops::CostJbState::Increment_
Increment< MODEL > Increment_
Definition: CostJbState.h:41
oops::CostJbState::initializeJqTLAD
virtual JqTermTLAD< MODEL > * initializeJqTLAD() const =0
Initialize Jq computations if needed.
oops::CostJbState::Bminv
virtual void Bminv(const Increment_ &, Increment_ &) const =0
oops::CostJbState::randomize
virtual void randomize(Increment_ &) const =0
Randomize.
oops::Geometry
Geometry class used in oops; subclass of interface class above.
Definition: oops/interface/Geometry.h:189
oops::CostJbState::State_
State< MODEL > State_
Definition: CostJbState.h:42
oops::State
Encapsulates the model state.
Definition: CostJbState.h:28
oops::CostJbState::Geometry_
Geometry< MODEL > Geometry_
Definition: CostJbState.h:40
oops::Increment
Increment Class: Difference between two states.
Definition: CostJbState.h:27
oops::CostJbState::Bmult
virtual void Bmult(const Increment_ &, Increment_ &) const =0
Multiply by and .
util
Definition: ObservationL95.h:32
Geometry.h
Increment.h