OOPS
IdVariableChange.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2017-2018 UCAR.
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  */
7 
8 #ifndef OOPS_GENERIC_IDVARIABLECHANGE_H_
9 #define OOPS_GENERIC_IDVARIABLECHANGE_H_
10 
11 #include <ostream>
12 #include <string>
13 
16 #include "oops/interface/State.h"
17 #include "oops/util/Printable.h"
18 
19 // Forward declarations
20 namespace eckit {
21  class Configuration;
22 }
23 
24 namespace oops {
25 
26 // -------------------------------------------------------------------------------------------------
27 /// No change of variable
28 
29 template <typename MODEL>
30 class IdVariableChange : public VariableChangeBase<MODEL> {
33  public:
34  static const std::string classname() {return "oops::IdVariableChange";}
35 
36  IdVariableChange(const Geometry_ &, const eckit::Configuration & conf)
37  : VariableChangeBase<MODEL>(conf) {}
38  virtual ~IdVariableChange() {}
39 
40 /// Perform identity change of variable
41  void changeVar(const State_ & x1, State_ & x2) const override {x2 = x1;}
42  void changeVarInverse(const State_ & x1, State_ & x2) const override {x2 = x1;}
43 
44  private:
45  void print(std::ostream & os) const override {os << "IdVariableChange";}
46 };
47 
48 // -------------------------------------------------------------------------------------------------
49 
50 } // namespace oops
51 #endif // OOPS_GENERIC_IDVARIABLECHANGE_H_
oops::IdVariableChange::classname
static const std::string classname()
Definition: IdVariableChange.h:34
oops
The namespace for the main oops code.
Definition: ErrorCovarianceL95.cc:22
oops::VariableChangeBase
Definition: VariableChangeBase.h:49
oops::IdVariableChange::changeVarInverse
void changeVarInverse(const State_ &x1, State_ &x2) const override
Definition: IdVariableChange.h:42
oops::IdVariableChange::IdVariableChange
IdVariableChange(const Geometry_ &, const eckit::Configuration &conf)
Definition: IdVariableChange.h:36
oops::IdVariableChange
No change of variable.
Definition: IdVariableChange.h:30
oops::IdVariableChange::Geometry_
Geometry< MODEL > Geometry_
Definition: IdVariableChange.h:31
oops::IdVariableChange::changeVar
void changeVar(const State_ &x1, State_ &x2) const override
Perform identity change of variable.
Definition: IdVariableChange.h:41
oops::IdVariableChange::~IdVariableChange
virtual ~IdVariableChange()
Definition: IdVariableChange.h:38
oops::IdVariableChange::print
void print(std::ostream &os) const override
Definition: IdVariableChange.h:45
eckit
Definition: FieldL95.h:22
oops::IdVariableChange::State_
State< MODEL > State_
Definition: IdVariableChange.h:32
oops::Geometry
Geometry class used in oops; subclass of interface class above.
Definition: oops/interface/Geometry.h:189
oops::State
Encapsulates the model state.
Definition: CostJbState.h:28
State.h
VariableChangeBase.h
Geometry.h