teqp 0.22.0
Loading...
Searching...
No Matches
teqp::cppinterface::adapter::DerivativeAdapter< ModelPack > Class Template Reference

#include <deriv_adapter.hpp>

Inheritance diagram for teqp::cppinterface::adapter::DerivativeAdapter< ModelPack >:
teqp::cppinterface::AbstractModel

Public Member Functions

auto & get_ModelPack_ref ()
 
const auto & get_ModelPack_cref () const
 
template<typename T >
 DerivativeAdapter (internal::tag< T >, const T &&mp)
 
const std::type_index & get_type_index () const override
 
virtual double get_R (const EArrayd &molefrac) const override
 
virtual double get_Arxy (const int NT, const int ND, const double T, const double rhomolar, const EArrayd &molefrac) const override
 
virtual ARN0_args double get_Ar01ep (const double T, const double rho, const EArrayd &molefrac) const override
 
virtual double get_Ar02ep (const double T, const double rho, const EArrayd &molefrac) const override
 
virtual double get_Ar03ep (const double T, const double rho, const EArrayd &molefrac) const override
 
virtual double get_B2vir (const double T, const EArrayd &z) const override
 
virtual std::map< int, double > get_Bnvir (const int Nderiv, const double T, const EArrayd &z) const override
 
virtual double get_B12vir (const double T, const EArrayd &z) const override
 
virtual double get_dmBnvirdTm (const int Nderiv, const int NTderiv, const double T, const EArrayd &molefrac) const override
 
virtual double get_ATrhoXi (const double T, const int NT, const double rhomolar, const int ND, const EArrayd &molefrac, const int i, const int NXi) const override
 
virtual double get_ATrhoXiXj (const double T, const int NT, const double rhomolar, const int ND, const EArrayd &molefrac, const int i, const int NXi, const int j, const int NXj) const override
 
virtual double get_ATrhoXiXjXk (const double T, const int NT, const double rhomolar, const int ND, const EArrayd &molefrac, const int i, const int NXi, const int j, const int NXj, const int k, const int NXk) const override
 
virtual double get_AtaudeltaXi (const double tau, const int NT, const double delta, const int ND, const EArrayd &molefrac, const int i, const int NXi) const override
 
virtual double get_AtaudeltaXiXj (const double tau, const int NT, const double delta, const int ND, const EArrayd &molefrac, const int i, const int NXi, const int j, const int NXj) const override
 
virtual double get_AtaudeltaXiXjXk (const double tau, const int NT, const double delta, const int ND, const EArrayd &molefrac, const int i, const int NXi, const int j, const int NXj, const int k, const int NXk) const override
 
virtual ISOCHORIC_multimatrix_args Eigen::ArrayXd get_Psir_sigma_derivs (const double T, const EArrayd &rhovec, const EArrayd &v) const override
 
virtual EArray33d get_deriv_mat2 (const double T, double rho, const EArrayd &z) const override
 
- Public Member Functions inherited from teqp::cppinterface::AbstractModel
virtual ~AbstractModel ()=default
 
double R (const EArrayd &x) const
 
virtual double get_Ar00 (const double T, const double rho, const REArrayd &molefrac) const =0
 
virtual double get_Ar01 (const double T, const double rho, const REArrayd &molefrac) const =0
 
virtual double get_Ar02 (const double T, const double rho, const REArrayd &molefrac) const =0
 
virtual double get_Ar03 (const double T, const double rho, const REArrayd &molefrac) const =0
 
virtual double get_Ar04 (const double T, const double rho, const REArrayd &molefrac) const =0
 
virtual double get_Ar10 (const double T, const double rho, const REArrayd &molefrac) const =0
 
virtual double get_Ar11 (const double T, const double rho, const REArrayd &molefrac) const =0
 
virtual double get_Ar12 (const double T, const double rho, const REArrayd &molefrac) const =0
 
virtual double get_Ar13 (const double T, const double rho, const REArrayd &molefrac) const =0
 
virtual double get_Ar14 (const double T, const double rho, const REArrayd &molefrac) const =0
 
virtual double get_Ar20 (const double T, const double rho, const REArrayd &molefrac) const =0
 
virtual double get_Ar21 (const double T, const double rho, const REArrayd &molefrac) const =0
 
virtual double get_Ar22 (const double T, const double rho, const REArrayd &molefrac) const =0
 
virtual double get_Ar23 (const double T, const double rho, const REArrayd &molefrac) const =0
 
virtual double get_Ar24 (const double T, const double rho, const REArrayd &molefrac) const =0
 
virtual EArrayd get_Ar01n (const double T, const double rho, const REArrayd &molefrac) const =0
 
virtual EArrayd get_Ar02n (const double T, const double rho, const REArrayd &molefrac) const =0
 
virtual EArrayd get_Ar03n (const double T, const double rho, const REArrayd &molefrac) const =0
 
virtual EArrayd get_Ar04n (const double T, const double rho, const REArrayd &molefrac) const =0
 
virtual EArrayd get_Ar05n (const double T, const double rho, const REArrayd &molefrac) const =0
 
virtual EArrayd get_Ar06n (const double T, const double rho, const REArrayd &molefrac) const =0
 
virtual EArrayd get_Ar10n (const double T, const double rho, const REArrayd &molefrac) const =0
 
virtual EArrayd get_Ar20n (const double T, const double rho, const REArrayd &molefrac) const =0
 
virtual EArrayd get_Ar30n (const double T, const double rho, const REArrayd &molefrac) const =0
 
virtual EArrayd get_Ar40n (const double T, const double rho, const REArrayd &molefrac) const =0
 
virtual double get_pr (const double T, const EArrayd &rhovec) const =0
 
virtual double get_splus (const double T, const EArrayd &rhovec) const =0
 
virtual double get_dpdT_constrhovec (const double T, const EArrayd &rhovec) const =0
 
virtual EArrayd build_Psir_gradient_autodiff (const double T, const EArrayd &rhovec) const =0
 
virtual EArrayd get_chempotVLE_autodiff (const double T, const EArrayd &rhovec) const =0
 
virtual EArrayd get_dchempotdT_autodiff (const double T, const EArrayd &rhovec) const =0
 
virtual EArrayd get_fugacity_coefficients (const double T, const EArrayd &rhovec) const =0
 
virtual EArrayd get_partial_molar_volumes (const double T, const EArrayd &rhovec) const =0
 
virtual EArrayd build_d2PsirdTdrhoi_autodiff (const double T, const EArrayd &rhovec) const =0
 
virtual EArrayd get_dpdrhovec_constT (const double T, const EArrayd &rhovec) const =0
 
virtual EMatrixd build_Psir_Hessian_autodiff (const double T, const EArrayd &rhovec) const =0
 
virtual EMatrixd build_Psi_Hessian_autodiff (const double T, const EArrayd &rhovec) const =0
 
virtual std::tuple< double, Eigen::ArrayXd, Eigen::MatrixXd > build_Psir_fgradHessian_autodiff (const double T, const EArrayd &rhovec) const =0
 
double get_neff (const double, const double, const EArrayd &) const
 
std::tuple< double, double > solve_pure_critical (const double T, const double rho, const std::optional< nlohmann::json > &=std::nullopt) const
 
EArray2 extrapolate_from_critical (const double Tc, const double rhoc, const double Tgiven, const std::optional< Eigen::ArrayXd > &molefracs=std::nullopt) const
 
std::tuple< EArrayd, EMatrixdget_pure_critical_conditions_Jacobian (const double T, const double rho, const std::optional< std::size_t > &alternative_pure_index, const std::optional< std::size_t > &alternative_length) const
 
EArray2 pure_VLE_T (const double T, const double rhoL, const double rhoV, int maxiter, const std::optional< Eigen::ArrayXd > &molefracs=std::nullopt) const
 
double dpsatdT_pure (const double T, const double rhoL, const double rhoV) const
 
virtual std::tuple< EArrayd, EArraydget_drhovecdp_Tsat (const double T, const REArrayd &rhovecL, const REArrayd &rhovecV) const
 
virtual std::tuple< EArrayd, EArraydget_drhovecdT_psat (const double T, const REArrayd &rhovecL, const REArrayd &rhovecV) const
 
virtual double get_dpsat_dTsat_isopleth (const double T, const REArrayd &rhovecL, const REArrayd &rhovecV) const
 
virtual nlohmann::json trace_VLE_isotherm_binary (const double T0, const EArrayd &rhovec0, const EArrayd &rhovecV0, const std::optional< TVLEOptions > &=std::nullopt) const
 
virtual nlohmann::json trace_VLE_isobar_binary (const double p, const double T0, const EArrayd &rhovecL0, const EArrayd &rhovecV0, const std::optional< PVLEOptions > &=std::nullopt) const
 
virtual std::tuple< VLE_return_code, EArrayd, EArraydmix_VLE_Tx (const double T, const REArrayd &rhovecL0, const REArrayd &rhovecV0, const REArrayd &xspec, const double atol, const double reltol, const double axtol, const double relxtol, const int maxiter) const
 
virtual MixVLEReturn mix_VLE_Tp (const double T, const double pgiven, const REArrayd &rhovecL0, const REArrayd &rhovecV0, const std::optional< MixVLETpFlags > &flags=std::nullopt) const
 
virtual std::tuple< VLE_return_code, double, EArrayd, EArraydmixture_VLE_px (const double p_spec, const REArrayd &xmolar_spec, const double T0, const REArrayd &rhovecL0, const REArrayd &rhovecV0, const std::optional< MixVLEpxFlags > &flags=std::nullopt) const
 
std::tuple< VLLE::VLLE_return_code, EArrayd, EArrayd, EArraydmix_VLLE_T (const double T, const REArrayd &rhovecVinit, const REArrayd &rhovecL1init, const REArrayd &rhovecL2init, const double atol, const double reltol, const double axtol, const double relxtol, const int maxiter) const
 
std::vector< nlohmann::json > find_VLLE_T_binary (const std::vector< nlohmann::json > &traces, const std::optional< VLLE::VLLEFinderOptions > options=std::nullopt) const
 
std::vector< nlohmann::json > find_VLLE_p_binary (const std::vector< nlohmann::json > &traces, const std::optional< VLLE::VLLEFinderOptions > options=std::nullopt) const
 
nlohmann::json trace_VLLE_binary (const double T, const REArrayd &rhovecV, const REArrayd &rhovecL1, const REArrayd &rhovecL2, const std::optional< VLLE::VLLETracerOptions > options) const
 
virtual nlohmann::json trace_critical_arclength_binary (const double T0, const EArrayd &rhovec0, const std::optional< std::string > &=std::nullopt, const std::optional< TCABOptions > &=std::nullopt) const
 
virtual EArrayd get_drhovec_dT_crit (const double T, const REArrayd &rhovec) const
 
virtual double get_dp_dT_crit (const double T, const REArrayd &rhovec) const
 
virtual EArray2 get_criticality_conditions (const double T, const REArrayd &rhovec) const
 
virtual EigenData eigen_problem (const double T, const REArrayd &rhovec, const std::optional< REArrayd > &=std::nullopt) const
 
virtual double get_minimum_eigenvalue_Psi_Hessian (const double T, const REArrayd &rhovec) const
 

Detailed Description

template<typename ModelPack>
class teqp::cppinterface::adapter::DerivativeAdapter< ModelPack >

This class holds a const reference to a class, and exposes an interface that matches that used in AbstractModel

The exposed methods cover all the derivative methods that are obtained by derivatives of the model, other methods in the AbstractModel implementation can then call methods implemented in this class

Note
This technique is known as type-erasure in C++

Definition at line 97 of file deriv_adapter.hpp.

Constructor & Destructor Documentation

◆ DerivativeAdapter()

template<typename ModelPack >
template<typename T >
teqp::cppinterface::adapter::DerivativeAdapter< ModelPack >::DerivativeAdapter ( internal::tag< T > ,
const T && mp )
inline

Definition at line 105 of file deriv_adapter.hpp.

Member Function Documentation

◆ get_Ar01ep()

template<typename ModelPack >
virtual ARN0_args double teqp::cppinterface::adapter::DerivativeAdapter< ModelPack >::get_Ar01ep ( const double T,
const double rho,
const EArrayd & molefrac ) const
inlineoverridevirtual

Implements teqp::cppinterface::AbstractModel.

Definition at line 138 of file deriv_adapter.hpp.

◆ get_Ar02ep()

template<typename ModelPack >
virtual double teqp::cppinterface::adapter::DerivativeAdapter< ModelPack >::get_Ar02ep ( const double T,
const double rho,
const EArrayd & molefrac ) const
inlineoverridevirtual

Implements teqp::cppinterface::AbstractModel.

Definition at line 146 of file deriv_adapter.hpp.

◆ get_Ar03ep()

template<typename ModelPack >
virtual double teqp::cppinterface::adapter::DerivativeAdapter< ModelPack >::get_Ar03ep ( const double T,
const double rho,
const EArrayd & molefrac ) const
inlineoverridevirtual

Implements teqp::cppinterface::AbstractModel.

Definition at line 154 of file deriv_adapter.hpp.

◆ get_Arxy()

template<typename ModelPack >
virtual double teqp::cppinterface::adapter::DerivativeAdapter< ModelPack >::get_Arxy ( const int NT,
const int ND,
const double T,
const double rhomolar,
const EArrayd & molefrac ) const
inlineoverridevirtual

Implements teqp::cppinterface::AbstractModel.

Definition at line 121 of file deriv_adapter.hpp.

◆ get_AtaudeltaXi()

template<typename ModelPack >
virtual double teqp::cppinterface::adapter::DerivativeAdapter< ModelPack >::get_AtaudeltaXi ( const double tau,
const int NT,
const double delta,
const int ND,
const EArrayd & molefrac,
const int i,
const int NXi ) const
inlineoverridevirtual

Implements teqp::cppinterface::AbstractModel.

Definition at line 189 of file deriv_adapter.hpp.

◆ get_AtaudeltaXiXj()

template<typename ModelPack >
virtual double teqp::cppinterface::adapter::DerivativeAdapter< ModelPack >::get_AtaudeltaXiXj ( const double tau,
const int NT,
const double delta,
const int ND,
const EArrayd & molefrac,
const int i,
const int NXi,
const int j,
const int NXj ) const
inlineoverridevirtual

Implements teqp::cppinterface::AbstractModel.

Definition at line 192 of file deriv_adapter.hpp.

◆ get_AtaudeltaXiXjXk()

template<typename ModelPack >
virtual double teqp::cppinterface::adapter::DerivativeAdapter< ModelPack >::get_AtaudeltaXiXjXk ( const double tau,
const int NT,
const double delta,
const int ND,
const EArrayd & molefrac,
const int i,
const int NXi,
const int j,
const int NXj,
const int k,
const int NXk ) const
inlineoverridevirtual

Implements teqp::cppinterface::AbstractModel.

Definition at line 195 of file deriv_adapter.hpp.

◆ get_ATrhoXi()

template<typename ModelPack >
virtual double teqp::cppinterface::adapter::DerivativeAdapter< ModelPack >::get_ATrhoXi ( const double T,
const int NT,
const double rhomolar,
const int ND,
const EArrayd & molefrac,
const int i,
const int NXi ) const
inlineoverridevirtual

Implements teqp::cppinterface::AbstractModel.

Definition at line 178 of file deriv_adapter.hpp.

◆ get_ATrhoXiXj()

template<typename ModelPack >
virtual double teqp::cppinterface::adapter::DerivativeAdapter< ModelPack >::get_ATrhoXiXj ( const double T,
const int NT,
const double rhomolar,
const int ND,
const EArrayd & molefrac,
const int i,
const int NXi,
const int j,
const int NXj ) const
inlineoverridevirtual

Implements teqp::cppinterface::AbstractModel.

Definition at line 181 of file deriv_adapter.hpp.

◆ get_ATrhoXiXjXk()

template<typename ModelPack >
virtual double teqp::cppinterface::adapter::DerivativeAdapter< ModelPack >::get_ATrhoXiXjXk ( const double T,
const int NT,
const double rhomolar,
const int ND,
const EArrayd & molefrac,
const int i,
const int NXi,
const int j,
const int NXj,
const int k,
const int NXk ) const
inlineoverridevirtual

Implements teqp::cppinterface::AbstractModel.

Definition at line 184 of file deriv_adapter.hpp.

◆ get_B12vir()

template<typename ModelPack >
virtual double teqp::cppinterface::adapter::DerivativeAdapter< ModelPack >::get_B12vir ( const double T,
const EArrayd & z ) const
inlineoverridevirtual

Implements teqp::cppinterface::AbstractModel.

Definition at line 170 of file deriv_adapter.hpp.

◆ get_B2vir()

template<typename ModelPack >
virtual double teqp::cppinterface::adapter::DerivativeAdapter< ModelPack >::get_B2vir ( const double T,
const EArrayd & z ) const
inlineoverridevirtual

Implements teqp::cppinterface::AbstractModel.

Definition at line 164 of file deriv_adapter.hpp.

◆ get_Bnvir()

template<typename ModelPack >
virtual std::map< int, double > teqp::cppinterface::adapter::DerivativeAdapter< ModelPack >::get_Bnvir ( const int Nderiv,
const double T,
const EArrayd & z ) const
inlineoverridevirtual

Implements teqp::cppinterface::AbstractModel.

Definition at line 167 of file deriv_adapter.hpp.

◆ get_deriv_mat2()

template<typename ModelPack >
virtual EArray33d teqp::cppinterface::adapter::DerivativeAdapter< ModelPack >::get_deriv_mat2 ( const double T,
double rho,
const EArrayd & z ) const
inlineoverridevirtual

Implements teqp::cppinterface::AbstractModel.

Definition at line 216 of file deriv_adapter.hpp.

◆ get_dmBnvirdTm()

template<typename ModelPack >
virtual double teqp::cppinterface::adapter::DerivativeAdapter< ModelPack >::get_dmBnvirdTm ( const int Nderiv,
const int NTderiv,
const double T,
const EArrayd & molefrac ) const
inlineoverridevirtual

Implements teqp::cppinterface::AbstractModel.

Definition at line 173 of file deriv_adapter.hpp.

◆ get_ModelPack_cref()

template<typename ModelPack >
const auto & teqp::cppinterface::adapter::DerivativeAdapter< ModelPack >::get_ModelPack_cref ( ) const
inline

Definition at line 102 of file deriv_adapter.hpp.

◆ get_ModelPack_ref()

template<typename ModelPack >
auto & teqp::cppinterface::adapter::DerivativeAdapter< ModelPack >::get_ModelPack_ref ( )
inline

Definition at line 101 of file deriv_adapter.hpp.

◆ get_Psir_sigma_derivs()

template<typename ModelPack >
virtual ISOCHORIC_multimatrix_args Eigen::ArrayXd teqp::cppinterface::adapter::DerivativeAdapter< ModelPack >::get_Psir_sigma_derivs ( const double T,
const EArrayd & rhovec,
const EArrayd & v ) const
inlineoverridevirtual

Implements teqp::cppinterface::AbstractModel.

Definition at line 212 of file deriv_adapter.hpp.

◆ get_R()

template<typename ModelPack >
virtual double teqp::cppinterface::adapter::DerivativeAdapter< ModelPack >::get_R ( const EArrayd & molefrac) const
inlineoverridevirtual

Implements teqp::cppinterface::AbstractModel.

Definition at line 117 of file deriv_adapter.hpp.

◆ get_type_index()

template<typename ModelPack >
const std::type_index & teqp::cppinterface::adapter::DerivativeAdapter< ModelPack >::get_type_index ( ) const
inlineoverridevirtual

Implements teqp::cppinterface::AbstractModel.

Definition at line 107 of file deriv_adapter.hpp.


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