TransFlow  0.1.0
A transient pipeline flow simulation library
equationofstate.hpp
1 #pragma once
2 
3 #include <vector>
4 #include <memory>
5 #include <armadillo>
6 
7 class Pipeline;
9 
16 {
17 public:
20 
27  EquationOfState(const Pipeline& pipeline, const std::string& type);
28 
37  arma::mat evaluate(const Pipeline& state);
38 
40  const EquationOfStateBase& at(std::size_t pos) const { return *m_eos->at(pos); }
41 
43  auto size() const { return m_eos->size(); }
44 
45 private:
47  std::unique_ptr<std::vector<std::unique_ptr<EquationOfStateBase>>> m_eos;
48 };
Pipeline
Definition: pipeline.hpp:16
EquationOfState::EquationOfState
EquationOfState(const Pipeline &pipeline, const std::string &type)
Construct from pipeline and string to determine the type of equation of state.
EquationOfState::evaluate
arma::mat evaluate(const Pipeline &state)
This is a wrapper around EquationOfStateBase::evaluate() that calls that function for each grid point...
EquationOfStateBase
The EquationOfStateBase is an abstract class, the base class for different equations of state.
Definition: equationofstatebase.hpp:20
EquationOfState::~EquationOfState
~EquationOfState()
Declared to avoid the inline compiler-generated default destructor.
EquationOfState::at
const EquationOfStateBase & at(std::size_t pos) const
std::vector-like at(i) getter
Definition: equationofstate.hpp:40
EquationOfState
The EquationOfState class is a wrapper around EquationOfStateBase that has one equation of state inst...
Definition: equationofstate.hpp:15
EquationOfState::size
auto size() const
std::vector-like size() operator
Definition: equationofstate.hpp:43
EquationOfState::m_eos
std::unique_ptr< std::vector< std::unique_ptr< EquationOfStateBase > > > m_eos
Vector of EquationOfStateBase instances, one for each grid point.
Definition: equationofstate.hpp:47