teqp 0.22.0
Loading...
Searching...
No Matches
teqp::iteration::NRIterator Class Reference

#include <iteration.hpp>

Public Member Functions

 NRIterator (const AlphaModel &alphamodel, const std::vector< char > &vars, const Eigen::Array2d &vals, double T, double rho, const Eigen::Ref< const Eigen::ArrayXd > &z, const std::tuple< bool, bool > &relative_error, const std::vector< std::shared_ptr< StoppingCondition > > stopping_conditions)
 
std::vector< char > get_vars () const
 Return the variables that are being used in the iteration.
 
Eigen::Array2d get_vals () const
 Return the target values to be obtained.
 
auto get_T () const
 Return the current temperature.
 
auto get_rho () const
 Return the current molar density.
 
Eigen::ArrayXd get_molefrac () const
 Return the current mole fractions.
 
int get_step_count () const
 Return the current step counter.
 
std::string get_message () const
 Return the current message relaying information about success or failure of the iteration.
 
auto get_nonconstant_indices () const
 Get the indices of the nonconstant variables.
 
void reset (double T, double rho)
 
auto calc_matrices (double T, double rho) const
 
auto calc_step (double T, double rho) const
 
auto calc_just_step (double T, double rho) const
 
auto calc_vals (double T, double rho) const
 
auto calc_r (double T, double rho) const
 
auto calc_J (double T, double rho) const
 
auto calc_maxabsr (double T, double rho) const
 Calculate the maximum absolute value of the values in r.
 
auto take_steps (int N)
 
auto take_steps_logrho (int N)
 
auto path_integration (double T, double rho, std::size_t N)
 

Public Attributes

bool verbose = false
 

Detailed Description

A class for doing Newton-Raphson steps to solve for two unknown thermodynamic variables

Definition at line 228 of file iteration.hpp.

Constructor & Destructor Documentation

◆ NRIterator()

teqp::iteration::NRIterator::NRIterator ( const AlphaModel & alphamodel,
const std::vector< char > & vars,
const Eigen::Array2d & vals,
double T,
double rho,
const Eigen::Ref< const Eigen::ArrayXd > & z,
const std::tuple< bool, bool > & relative_error,
const std::vector< std::shared_ptr< StoppingCondition > > stopping_conditions )
inline

Definition at line 247 of file iteration.hpp.

Member Function Documentation

◆ calc_J()

auto teqp::iteration::NRIterator::calc_J ( double T,
double rho ) const
inline

Definition at line 302 of file iteration.hpp.

◆ calc_just_step()

auto teqp::iteration::NRIterator::calc_just_step ( double T,
double rho ) const
inline

Definition at line 289 of file iteration.hpp.

◆ calc_matrices()

auto teqp::iteration::NRIterator::calc_matrices ( double T,
double rho ) const
inline

Do the calculations needed for the step and return the step and the other data In C++, the copy will be elided (the return value will be moved)

Parameters
TTemperature
rhoMolar density

Definition at line 281 of file iteration.hpp.

◆ calc_maxabsr()

auto teqp::iteration::NRIterator::calc_maxabsr ( double T,
double rho ) const
inline

Calculate the maximum absolute value of the values in r.

Definition at line 309 of file iteration.hpp.

◆ calc_r()

auto teqp::iteration::NRIterator::calc_r ( double T,
double rho ) const
inline

Definition at line 295 of file iteration.hpp.

◆ calc_step()

auto teqp::iteration::NRIterator::calc_step ( double T,
double rho ) const
inline

Definition at line 285 of file iteration.hpp.

◆ calc_vals()

auto teqp::iteration::NRIterator::calc_vals ( double T,
double rho ) const
inline

Definition at line 292 of file iteration.hpp.

◆ get_message()

std::string teqp::iteration::NRIterator::get_message ( ) const
inline

Return the current message relaying information about success or failure of the iteration.

Definition at line 267 of file iteration.hpp.

◆ get_molefrac()

Eigen::ArrayXd teqp::iteration::NRIterator::get_molefrac ( ) const
inline

Return the current mole fractions.

Definition at line 263 of file iteration.hpp.

◆ get_nonconstant_indices()

auto teqp::iteration::NRIterator::get_nonconstant_indices ( ) const
inline

Get the indices of the nonconstant variables.

Definition at line 269 of file iteration.hpp.

◆ get_rho()

auto teqp::iteration::NRIterator::get_rho ( ) const
inline

Return the current molar density.

Definition at line 261 of file iteration.hpp.

◆ get_step_count()

int teqp::iteration::NRIterator::get_step_count ( ) const
inline

Return the current step counter.

Definition at line 265 of file iteration.hpp.

◆ get_T()

auto teqp::iteration::NRIterator::get_T ( ) const
inline

Return the current temperature.

Definition at line 259 of file iteration.hpp.

◆ get_vals()

Eigen::Array2d teqp::iteration::NRIterator::get_vals ( ) const
inline

Return the target values to be obtained.

Definition at line 257 of file iteration.hpp.

◆ get_vars()

std::vector< char > teqp::iteration::NRIterator::get_vars ( ) const
inline

Return the variables that are being used in the iteration.

Definition at line 255 of file iteration.hpp.

◆ path_integration()

auto teqp::iteration::NRIterator::path_integration ( double T,
double rho,
std::size_t N )
inline

Definition at line 448 of file iteration.hpp.

◆ reset()

void teqp::iteration::NRIterator::reset ( double T,
double rho )
inline

Definition at line 271 of file iteration.hpp.

◆ take_steps()

auto teqp::iteration::NRIterator::take_steps ( int N)
inline

Take a given number of steps

Parameters
NThe number of steps to take

Definition at line 319 of file iteration.hpp.

◆ take_steps_logrho()

auto teqp::iteration::NRIterator::take_steps_logrho ( int N)
inline

Take a given number of steps

Parameters
NThe number of steps to take

Definition at line 367 of file iteration.hpp.

Member Data Documentation

◆ verbose

bool teqp::iteration::NRIterator::verbose = false

Definition at line 252 of file iteration.hpp.


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