ReFRACtor
composite_perturbation.h
Go to the documentation of this file.
1 #ifndef COMPOSITE_PERTURBATION_H
2 #define COMPOSITE_PERTURBATION_H
3 #include "perturbation.h"
4 #include <vector>
5 #include <list>
6 #include <boost/shared_ptr.hpp>
7 
8 namespace FullPhysics {
9 class CompositePerturbation;
10 /****************************************************************/
21 public:
22  virtual ~PerturbationBuilder() {}
23 
24 //-----------------------------------------------------------------------
27 //-----------------------------------------------------------------------
28 
29  virtual void attach_notify(CompositePerturbation& Comp_ig)
30  { }
31 
32 //-----------------------------------------------------------------------
35 //-----------------------------------------------------------------------
36 
37  virtual int number_element() const = 0;
38 
39 //-----------------------------------------------------------------------
48 //-----------------------------------------------------------------------
49 
50  virtual void build_perturbation(blitz::Array<double, 1>& v, int index) const = 0;
51 };
52 
53 /****************************************************************/
71 public:
73  virtual blitz::Array<double, 1> perturbation() const;
74  virtual void print(std::ostream& Os) const;
75  int number_element() const;
76 //-----------------------------------------------------------------------
78 //-----------------------------------------------------------------------
79 
81  {
82  blist.push_back(B);
83  B->attach_notify(*this);
84  }
85 
86 //-----------------------------------------------------------------------
88 //-----------------------------------------------------------------------
89 
91  {
92  blist.remove(B);
93  }
94 private:
95  std::list<boost::shared_ptr<PerturbationBuilder> > blist;
96 };
97 }
98 #endif
virtual void build_perturbation(blitz::Array< double, 1 > &v, int index) const =0
Called when we need this class to do its part in setting up the perturbation array.
void remove_builder(const boost::shared_ptr< PerturbationBuilder > &B)
Remove a builder to the build list.
virtual void attach_notify(CompositePerturbation &Comp_ig)
Called when we get attached to a CompositePerturbation.
void add_builder(const boost::shared_ptr< PerturbationBuilder > &B)
Add a builder to the build list.
A common way to create a perturbation is to have other classes responsible for portions of the state ...
virtual int number_element() const =0
Number of elements we will be adding to the perturbation.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1
This gets the perturbation to use with a finite difference Jacobian.
Definition: perturbation.h:10
Class that builds a perturbation to use for a finite difference Jacobian.

Copyright © 2017, California Institute of Technology.
ALL RIGHTS RESERVED.
U.S. Government Sponsorship acknowledged.
Generated Fri Aug 24 2018 15:44:08