MUQ  0.4.3
ODEData.h
Go to the documentation of this file.
1 #ifndef ODEDATA_H_
2 #define ODEDATA_H_
3 
4 #include "MUQ/config.h"
5 
6 #if MUQ_HAS_PARCER==1
7 #include <parcer/Communicator.h>
8 #endif
9 
10 #include "MUQ/Modeling/ModPiece.h"
11 
12 namespace muq {
13  namespace Modeling {
15 
18  class ODEData {
19  public:
20 
22 
28  ODEData(std::shared_ptr<ModPiece> const& rhs,
29  ref_vector<Eigen::VectorXd> const& refinputs,
30  bool const autonomous,
31  int const wrtIn,
32  Eigen::VectorXd const& actionVec = Eigen::VectorXd());
33 
34 
36 
43  ODEData(std::shared_ptr<ModPiece> const& rhs,
44  std::shared_ptr<ModPiece> const& root,
45  ref_vector<Eigen::VectorXd> const& refinputs,
46  bool const autonomous,
47  int const wrtIn,
48  Eigen::VectorXd const& actionVec = Eigen::VectorXd());
49 
50  virtual ~ODEData() = default;
51 
53  void UpdateInputs(Eigen::Ref<const Eigen::VectorXd> const& newState, double const time);
54 
56  std::shared_ptr<ModPiece> rhs;
57 
59  std::shared_ptr<ModPiece> root;
60 
62  Eigen::VectorXd time;
63  Eigen::VectorXd state;
65 
67  const bool autonomous;
68 
70  const int wrtIn = -1;
71 
72  Eigen::VectorXd actionVec; // <- used to store the vector when ApplyJacobian is called
73  const bool isAction;
74 
75  private:
76  };
77  } // namespace Modeling
78 } // namespace muq
79 
80 #endif
A helper class for Sundial's time integration.
Definition: ODEData.h:18
std::shared_ptr< ModPiece > root
A function we are trying to find the root of along an orbit of the ODE (nullptr if we are not doing a...
Definition: ODEData.h:59
Eigen::VectorXd time
The inputs to the rhs — the first is the state, the rest are constant in time.
Definition: ODEData.h:62
const bool autonomous
Is the RHS autonomous?
Definition: ODEData.h:67
const bool isAction
Definition: ODEData.h:73
virtual ~ODEData()=default
ref_vector< Eigen::VectorXd > inputs
Definition: ODEData.h:64
ODEData(std::shared_ptr< ModPiece > const &rhs, ref_vector< Eigen::VectorXd > const &refinputs, bool const autonomous, int const wrtIn, Eigen::VectorXd const &actionVec=Eigen::VectorXd())
Construct basic ode data.
Definition: ODEData.cpp:8
Eigen::VectorXd actionVec
Definition: ODEData.h:72
void UpdateInputs(Eigen::Ref< const Eigen::VectorXd > const &newState, double const time)
Update the time and state inputs.
Definition: ODEData.cpp:47
const int wrtIn
The input we are computing the derivative wrt — negative indicates no derivative is being computed.
Definition: ODEData.h:70
std::shared_ptr< ModPiece > rhs
The right hand side of the ODE.
Definition: ODEData.h:56
Eigen::VectorXd state
Definition: ODEData.h:63
std::vector< std::reference_wrapper< const T > > ref_vector
A vector of references to something ...
Definition: WorkPiece.h:37