FV3 Bundle
oops::CostFunction< MODEL > Class Template Referenceabstract

Cost Function. More...

#include <CostFunction.h>

Inheritance diagram for oops::CostFunction< MODEL >:
[legend]
Collaboration diagram for oops::CostFunction< MODEL >:
[legend]

Public Member Functions

 CostFunction (const eckit::Configuration &, const Geometry_ &, const Model_ &)
 
virtual ~CostFunction ()
 
double evaluate (const CtrlVar_ &, const eckit::Configuration &config=eckit::LocalConfiguration(), PostProcessor< State_ > post=PostProcessor< State_ >()) const
 
double linearize (const CtrlVar_ &, const eckit::Configuration &, PostProcessor< State_ > post=PostProcessor< State_ >())
 
virtual void runTLM (CtrlInc_ &, PostProcessorTLAD< MODEL > &, PostProcessor< Increment_ > post=PostProcessor< Increment_ >(), const bool idModel=false) const =0
 
virtual void runADJ (CtrlInc_ &, PostProcessorTLAD< MODEL > &, PostProcessor< Increment_ > post=PostProcessor< Increment_ >(), const bool idModel=false) const =0
 
virtual void zeroAD (CtrlInc_ &) const =0
 
virtual void runNL (CtrlVar_ &, PostProcessor< State_ > &) const =0
 
void addIncrement (CtrlVar_ &, const CtrlInc_ &, PostProcessor< Increment_ > post=PostProcessor< Increment_ >()) const
 
void resetLinearization ()
 
void computeGradientFG (CtrlInc_ &) const
 Compute cost function gradient at first guess (without Jb). More...
 
const JbTotal_jb () const
 Access \( J_b\). More...
 
const CostBase_jterm (const unsigned ii) const
 Access terms of the cost function other than \( J_b\). More...
 
unsigned nterms () const
 
const double getCostJb () const
 
const double getCostJoJc () const
 

Protected Member Functions

void setupTerms (const eckit::Configuration &)
 
const Model_getModel () const
 
const LinearModel_getTLM (const unsigned isub=0) const
 

Private Types

typedef ControlIncrement< MODEL > CtrlInc_
 
typedef ControlVariable< MODEL > CtrlVar_
 
typedef CostJbTotal< MODEL > JbTotal_
 
typedef CostTermBase< MODEL > CostBase_
 
typedef JqTerm< MODEL > JqTerm_
 
typedef JqTermTLAD< MODEL > JqTermTLAD_
 
typedef Geometry< MODEL > Geometry_
 
typedef Model< MODEL > Model_
 
typedef LinearModel< MODEL > LinearModel_
 
typedef State< MODEL > State_
 
typedef Increment< MODEL > Increment_
 

Private Member Functions

virtual void addIncr (CtrlVar_ &, const CtrlInc_ &, PostProcessor< Increment_ > &) const =0
 
virtual CostJbState< MODEL > * newJb (const eckit::Configuration &, const Geometry_ &, const CtrlVar_ &) const =0
 
virtual CostJo< MODEL > * newJo (const eckit::Configuration &) const =0
 
virtual CostTermBase< MODEL > * newJc (const eckit::Configuration &, const Geometry_ &) const =0
 
virtual void doLinearize (const Geometry_ &, const eckit::Configuration &, const CtrlVar_ &, const CtrlVar_ &)=0
 

Private Attributes

const Geometry_resol_
 
const Model_model_
 
boost::scoped_ptr< const CtrlVar_xb_
 
boost::scoped_ptr< JbTotal_jb_
 
boost::ptr_vector< CostBase_jterms_
 
boost::ptr_vector< LinearModel_tlm_
 
double costJb_
 
double costJoJc_
 
const Variables anvars_
 

Detailed Description

template<typename MODEL>
class oops::CostFunction< MODEL >

Cost Function.

The CostFunction defines and manages the computation of all the terms of the variational data assimilation cost function.

Definition at line 56 of file CostFunction.h.

Member Typedef Documentation

◆ CostBase_

template<typename MODEL>
typedef CostTermBase<MODEL> oops::CostFunction< MODEL >::CostBase_
private

Definition at line 60 of file CostFunction.h.

◆ CtrlInc_

template<typename MODEL>
typedef ControlIncrement<MODEL> oops::CostFunction< MODEL >::CtrlInc_
private

Definition at line 57 of file CostFunction.h.

◆ CtrlVar_

template<typename MODEL>
typedef ControlVariable<MODEL> oops::CostFunction< MODEL >::CtrlVar_
private

Definition at line 58 of file CostFunction.h.

◆ Geometry_

template<typename MODEL>
typedef Geometry<MODEL> oops::CostFunction< MODEL >::Geometry_
private

Definition at line 63 of file CostFunction.h.

◆ Increment_

template<typename MODEL>
typedef Increment<MODEL> oops::CostFunction< MODEL >::Increment_
private

Definition at line 67 of file CostFunction.h.

◆ JbTotal_

template<typename MODEL>
typedef CostJbTotal<MODEL> oops::CostFunction< MODEL >::JbTotal_
private

Definition at line 59 of file CostFunction.h.

◆ JqTerm_

template<typename MODEL>
typedef JqTerm<MODEL> oops::CostFunction< MODEL >::JqTerm_
private

Definition at line 61 of file CostFunction.h.

◆ JqTermTLAD_

template<typename MODEL>
typedef JqTermTLAD<MODEL> oops::CostFunction< MODEL >::JqTermTLAD_
private

Definition at line 62 of file CostFunction.h.

◆ LinearModel_

template<typename MODEL>
typedef LinearModel<MODEL> oops::CostFunction< MODEL >::LinearModel_
private

Definition at line 65 of file CostFunction.h.

◆ Model_

template<typename MODEL>
typedef Model<MODEL> oops::CostFunction< MODEL >::Model_
private

Definition at line 64 of file CostFunction.h.

◆ State_

template<typename MODEL>
typedef State<MODEL> oops::CostFunction< MODEL >::State_
private

Definition at line 66 of file CostFunction.h.

Constructor & Destructor Documentation

◆ CostFunction()

template<typename MODEL >
oops::CostFunction< MODEL >::CostFunction ( const eckit::Configuration &  config,
const Geometry_ resol,
const Model_ model 
)

Definition at line 202 of file CostFunction.h.

◆ ~CostFunction()

template<typename MODEL>
virtual oops::CostFunction< MODEL >::~CostFunction ( )
inlinevirtual

Definition at line 71 of file CostFunction.h.

Member Function Documentation

◆ addIncr()

template<typename MODEL>
virtual void oops::CostFunction< MODEL >::addIncr ( CtrlVar_ ,
const CtrlInc_ ,
PostProcessor< Increment_ > &   
) const
privatepure virtual

◆ addIncrement()

template<typename MODEL >
void oops::CostFunction< MODEL >::addIncrement ( CtrlVar_ xx,
const CtrlInc_ dx,
PostProcessor< Increment_ post = PostProcessor<Increment_>() 
) const

Definition at line 337 of file CostFunction.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ computeGradientFG()

template<typename MODEL >
void oops::CostFunction< MODEL >::computeGradientFG ( CtrlInc_ grad) const

Compute cost function gradient at first guess (without Jb).

Definition at line 319 of file CostFunction.h.

Here is the call graph for this function:

◆ doLinearize()

template<typename MODEL>
virtual void oops::CostFunction< MODEL >::doLinearize ( const Geometry_ ,
const eckit::Configuration &  ,
const CtrlVar_ ,
const CtrlVar_  
)
privatepure virtual

◆ evaluate()

template<typename MODEL >
double oops::CostFunction< MODEL >::evaluate ( const CtrlVar_ fguess,
const eckit::Configuration &  config = eckit::LocalConfiguration(),
PostProcessor< State_ post = PostProcessor<State_>() 
) const

Definition at line 240 of file CostFunction.h.

Here is the call graph for this function:

◆ getCostJb()

template<typename MODEL>
const double oops::CostFunction< MODEL >::getCostJb ( ) const
inline

Definition at line 101 of file CostFunction.h.

◆ getCostJoJc()

template<typename MODEL>
const double oops::CostFunction< MODEL >::getCostJoJc ( ) const
inline

Definition at line 102 of file CostFunction.h.

◆ getModel()

template<typename MODEL>
const Model_& oops::CostFunction< MODEL >::getModel ( ) const
inlineprotected

Definition at line 106 of file CostFunction.h.

◆ getTLM()

template<typename MODEL>
const LinearModel_& oops::CostFunction< MODEL >::getTLM ( const unsigned  isub = 0) const
inlineprotected

Definition at line 107 of file CostFunction.h.

◆ jb()

template<typename MODEL>
const JbTotal_& oops::CostFunction< MODEL >::jb ( ) const
inline

Access \( J_b\).

Definition at line 97 of file CostFunction.h.

Here is the caller graph for this function:

◆ jterm()

template<typename MODEL>
const CostBase_& oops::CostFunction< MODEL >::jterm ( const unsigned  ii) const
inline

Access terms of the cost function other than \( J_b\).

Definition at line 99 of file CostFunction.h.

Here is the caller graph for this function:

◆ linearize()

template<typename MODEL >
double oops::CostFunction< MODEL >::linearize ( const CtrlVar_ fguess,
const eckit::Configuration &  innerConf,
PostProcessor< State_ post = PostProcessor<State_>() 
)

Definition at line 277 of file CostFunction.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ newJb()

template<typename MODEL>
virtual CostJbState<MODEL>* oops::CostFunction< MODEL >::newJb ( const eckit::Configuration &  ,
const Geometry_ ,
const CtrlVar_  
) const
privatepure virtual

◆ newJc()

template<typename MODEL>
virtual CostTermBase<MODEL>* oops::CostFunction< MODEL >::newJc ( const eckit::Configuration &  ,
const Geometry_  
) const
privatepure virtual

◆ newJo()

template<typename MODEL>
virtual CostJo<MODEL>* oops::CostFunction< MODEL >::newJo ( const eckit::Configuration &  ) const
privatepure virtual

◆ nterms()

template<typename MODEL>
unsigned oops::CostFunction< MODEL >::nterms ( ) const
inline

Definition at line 100 of file CostFunction.h.

Here is the caller graph for this function:

◆ resetLinearization()

template<typename MODEL >
void oops::CostFunction< MODEL >::resetLinearization ( )

Definition at line 355 of file CostFunction.h.

Here is the caller graph for this function:

◆ runADJ()

template<typename MODEL>
virtual void oops::CostFunction< MODEL >::runADJ ( CtrlInc_ ,
PostProcessorTLAD< MODEL > &  ,
PostProcessor< Increment_ post = PostProcessorIncrement_ >(),
const bool  idModel = false 
) const
pure virtual

Implemented in oops::CostFct4DEnsVar< MODEL >, oops::CostFct4DVar< MODEL >, oops::CostFctWeak< MODEL >, and oops::CostFct3DVar< MODEL >.

Here is the caller graph for this function:

◆ runNL()

template<typename MODEL>
virtual void oops::CostFunction< MODEL >::runNL ( CtrlVar_ ,
PostProcessor< State_ > &   
) const
pure virtual

◆ runTLM()

template<typename MODEL>
virtual void oops::CostFunction< MODEL >::runTLM ( CtrlInc_ ,
PostProcessorTLAD< MODEL > &  ,
PostProcessor< Increment_ post = PostProcessorIncrement_ >(),
const bool  idModel = false 
) const
pure virtual

Implemented in oops::CostFct4DEnsVar< MODEL >, oops::CostFct4DVar< MODEL >, oops::CostFctWeak< MODEL >, and oops::CostFct3DVar< MODEL >.

Here is the caller graph for this function:

◆ setupTerms()

template<typename MODEL >
void oops::CostFunction< MODEL >::setupTerms ( const eckit::Configuration &  config)
protected

Definition at line 212 of file CostFunction.h.

Here is the caller graph for this function:

◆ zeroAD()

template<typename MODEL>
virtual void oops::CostFunction< MODEL >::zeroAD ( CtrlInc_ ) const
pure virtual

Implemented in oops::CostFct4DEnsVar< MODEL >, oops::CostFct4DVar< MODEL >, oops::CostFctWeak< MODEL >, and oops::CostFct3DVar< MODEL >.

Here is the caller graph for this function:

Member Data Documentation

◆ anvars_

template<typename MODEL>
const Variables oops::CostFunction< MODEL >::anvars_
private

Definition at line 129 of file CostFunction.h.

◆ costJb_

template<typename MODEL>
double oops::CostFunction< MODEL >::costJb_
mutableprivate

Definition at line 127 of file CostFunction.h.

◆ costJoJc_

template<typename MODEL>
double oops::CostFunction< MODEL >::costJoJc_
mutableprivate

Definition at line 128 of file CostFunction.h.

◆ jb_

template<typename MODEL>
boost::scoped_ptr<JbTotal_> oops::CostFunction< MODEL >::jb_
private

Definition at line 123 of file CostFunction.h.

◆ jterms_

template<typename MODEL>
boost::ptr_vector<CostBase_> oops::CostFunction< MODEL >::jterms_
private

Definition at line 124 of file CostFunction.h.

◆ model_

template<typename MODEL>
const Model_& oops::CostFunction< MODEL >::model_
private

Definition at line 121 of file CostFunction.h.

◆ resol_

template<typename MODEL>
const Geometry_& oops::CostFunction< MODEL >::resol_
private

Definition at line 120 of file CostFunction.h.

◆ tlm_

template<typename MODEL>
boost::ptr_vector<LinearModel_> oops::CostFunction< MODEL >::tlm_
private

Definition at line 125 of file CostFunction.h.

◆ xb_

template<typename MODEL>
boost::scoped_ptr<const CtrlVar_> oops::CostFunction< MODEL >::xb_
private

Definition at line 122 of file CostFunction.h.


The documentation for this class was generated from the following file: