Reaktoro
A unified framework for modeling chemically reactive systems
ChemicalVectorBase< V, T, P, N > Class Template Reference

A template base class to represent a vector of chemical properties and their partial derivatives. More...

#include <ChemicalVector.hpp>

Collaboration diagram for ChemicalVectorBase< V, T, P, N >:
[legend]

Public Member Functions

 ChemicalVectorBase ()
 Construct a default ChemicalVectorBase instance.
 
 ChemicalVectorBase (Index nspecies)
 Construct a ChemicalVectorBase instance with number of rows equal to given number of species. More...
 
 ChemicalVectorBase (Index nrows, Index nspecies)
 Construct a ChemicalVectorBase instance with given number of rows and species. More...
 
 ChemicalVectorBase (Index nrows, Index nspecies, double val)
 Construct a ChemicalVectorBase instance with given number of rows and species, and a constant value. More...
 
 ChemicalVectorBase (const V &val, const T &ddT, const P &ddP, const N &ddn)
 Construct a ChemicalVectorBase instance with given values and derivatives. More...
 
template<typename VR , typename TR , typename PR , typename NR >
 ChemicalVectorBase (ChemicalVectorBase< VR, TR, PR, NR > &other)
 Construct a ChemicalVectorBase instance from another.
 
template<typename VR , typename TR , typename PR , typename NR >
 ChemicalVectorBase (const ChemicalVectorBase< VR, TR, PR, NR > &other)
 Construct a ChemicalVectorBase instance from another.
 
auto size () const -> Index
 Return the number of rows in this ChemicalVectorBase instance.
 
auto resize (Index nrows, Index nspecies) -> void
 Resize this ChemicalVectorBase instance with new number of rows and number of species. More...
 
auto resize (Index nspecies) -> void
 Resize this ChemicalVectorBase instance with number of rows equal the number of species. More...
 
template<typename VR , typename NR >
auto fill (const ChemicalScalarBase< VR, NR > &other) -> void
 Assign a ChemicalScalarBase instance to this.
 
template<typename VR >
auto fill (const ThermoScalarBase< VR > &other) -> void
 Assign a ThermoScalarBase instance to this.
 
auto fill (double value) -> void
 Assign a scalarsto this.
 
template<typename VR , typename TR , typename PR , typename NR >
auto operator= (const ChemicalVectorBase< VR, TR, PR, NR > &other) -> ChemicalVectorBase &
 Assign another ChemicalVectorBase instance to this.
 
template<typename VR , typename NR >
auto operator= (const ChemicalScalarBase< VR, NR > &other) -> ChemicalVectorBase &
 Assign a ChemicalScalarBase instance to this.
 
template<typename VR >
auto operator= (const ThermoScalarBase< VR > &other) -> ChemicalVectorBase &
 Assign a ThermoScalarBase instance to this.
 
auto operator= (double other) -> ChemicalVectorBase &
 Assign a scalar to this.
 
template<typename VR , typename TR , typename PR , typename NR >
auto operator+= (const ChemicalVectorBase< VR, TR, PR, NR > &other) -> ChemicalVectorBase &
 Assign-addition of a ChemicalVectorBase instance to this.
 
template<typename VR , typename TR , typename PR >
auto operator+= (const ThermoVectorBase< VR, TR, PR > &other) -> ChemicalVectorBase &
 Assign-addition of a ThermoVectorBase instance to this.
 
template<typename VR >
auto operator+= (const ThermoScalarBase< VR > &other) -> ChemicalVectorBase &
 Assign-addition of a ThermoScalarBase instance to this.
 
auto operator+= (double other) -> ChemicalVectorBase &
 Assign-addition of a scalar to this.
 
template<typename VR , typename TR , typename PR , typename NR >
auto operator-= (const ChemicalVectorBase< VR, TR, PR, NR > &other) -> ChemicalVectorBase &
 Assign-subtraction of a ChemicalVectorBase instance to this.
 
template<typename VR , typename TR , typename PR >
auto operator-= (const ThermoVectorBase< VR, TR, PR > &other) -> ChemicalVectorBase &
 Assign-subtraction of a ThermoVectorBase instance to this.
 
template<typename VR >
auto operator-= (const ThermoScalarBase< VR > &other) -> ChemicalVectorBase &
 Assign-subtraction of a ThermoScalarBase instance to this.
 
auto operator-= (double other) -> ChemicalVectorBase &
 Assign-subtraction of a scalar to this.
 
template<typename VR , typename TR , typename PR , typename NR >
auto operator*= (const ChemicalVectorBase< VR, TR, PR, NR > &other) -> ChemicalVectorBase &
 Assign-multiplication of a ChemicalVectorBase instance to this.
 
auto operator*= (double other) -> ChemicalVectorBase &
 Assign-multiplication of a scalar to this.
 
auto operator/= (double other) -> ChemicalVectorBase &
 Assign-division of a scalar to this.
 
auto operator[] (Index irow) -> ChemicalScalarBase< decltype(val[irow]), decltype(ddn.row(irow))>
 Return a ChemicalScalarBase with reference to the chemical scalar in a given row.
 
auto operator[] (Index irow) const -> ChemicalScalarBase< decltype(val[irow]), decltype(ddn.row(irow))>
 Return a ChemicalScalarBase with const reference to the chemical scalar in a given row.
 
auto view (Index irow, Index nrows) -> ChemicalVectorRef
 Return a view of an interval of the ChemicalVectorBase instance. More...
 
auto view (Index irow, Index nrows) const -> ChemicalVectorConstRef
 Return a view of an interval of the ChemicalVectorBase instance. More...
 
auto view (Index irow, Index icol, Index nrows, Index ncols) -> ChemicalVectorRef
 Return a view of an interval of the ChemicalVectorBase instance. More...
 
auto view (Index irow, Index icol, Index nrows, Index ncols) const -> ChemicalVectorConstRef
 Return a view of an interval of the ChemicalVectorBase instance. More...
 
 operator Vector () const
 Explicitly converts this ChemicalVector instance into a Vector.
 

Public Attributes

val
 The vector of chemical scalars.
 
ddT
 The vector of partial temperature derivatives of the chemical scalars.
 
ddP
 The vector of partial pressure derivatives of the chemical scalars.
 
ddn
 The matrix of partial mole derivatives of the chemical scalars.
 

Detailed Description

template<typename V, typename T, typename P, typename N>
class Reaktoro::ChemicalVectorBase< V, T, P, N >

A template base class to represent a vector of chemical properties and their partial derivatives.

See also
ThermoScalar, ThermoVector, ChemicalScalar, ChemicalVector

Constructor & Destructor Documentation

◆ ChemicalVectorBase() [1/4]

ChemicalVectorBase ( Index  nspecies)
inlineexplicit

Construct a ChemicalVectorBase instance with number of rows equal to given number of species.

Parameters
nspeciesThe number of nspecies in the chemical vector.

◆ ChemicalVectorBase() [2/4]

ChemicalVectorBase ( Index  nrows,
Index  nspecies 
)
inline

Construct a ChemicalVectorBase instance with given number of rows and species.

Parameters
nrowsThe number of rows in the chemical vector
nspeciesThe number of species for the molar derivatives

◆ ChemicalVectorBase() [3/4]

ChemicalVectorBase ( Index  nrows,
Index  nspecies,
double  val 
)
inline

Construct a ChemicalVectorBase instance with given number of rows and species, and a constant value.

Parameters
nrowsThe number of rows in the chemical vector
nspeciesThe number of species for the molar derivatives
valThe constant value

◆ ChemicalVectorBase() [4/4]

ChemicalVectorBase ( const V &  val,
const T &  ddT,
const P &  ddP,
const N &  ddn 
)
inline

Construct a ChemicalVectorBase instance with given values and derivatives.

Parameters
valThe vector of values of the chemical scalars
ddTThe vector of partial temperature derivatives of the chemical scalars
ddPThe vector of partial pressure derivatives of the chemical scalars
ddnThe matrix of partial mole derivatives of the chemical scalars

Member Function Documentation

◆ resize() [1/2]

auto resize ( Index  nrows,
Index  nspecies 
) -> void
inline

Resize this ChemicalVectorBase instance with new number of rows and number of species.

Parameters
nrowsThe new number of rows
nspeciesThe new number of species for the molar derivatives

◆ resize() [2/2]

auto resize ( Index  nspecies) -> void
inline

Resize this ChemicalVectorBase instance with number of rows equal the number of species.

Parameters
nspeciesThe new number of species for the molar derivatives

◆ view() [1/4]

auto view ( Index  irow,
Index  nrows 
) -> ChemicalVectorRef
inline

Return a view of an interval of the ChemicalVectorBase instance.

Parameters
irowThe index of the row starting the view.
nrowsThe number of rows in the view.

◆ view() [2/4]

auto view ( Index  irow,
Index  nrows 
) const -> ChemicalVectorConstRef
inline

Return a view of an interval of the ChemicalVectorBase instance.

Parameters
irowThe index of the row starting the view.
nrowsThe number of rows in the view.

◆ view() [3/4]

auto view ( Index  irow,
Index  icol,
Index  nrows,
Index  ncols 
) -> ChemicalVectorRef
inline

Return a view of an interval of the ChemicalVectorBase instance.

Parameters
irowThe index of the row starting the view.
icolThe index of the col starting the view of the ddn derivatives.
nrowsThe number of rows in the view.
ncolsThe number of columns of the view of the ddn derivatives.

◆ view() [4/4]

auto view ( Index  irow,
Index  icol,
Index  nrows,
Index  ncols 
) const -> ChemicalVectorConstRef
inline

Return a view of an interval of the ChemicalVectorBase instance.

Parameters
irowThe index of the row starting the view.
icolThe index of the col starting the view of the ddn derivatives.
nrowsThe number of rows in the view.
ncolsThe number of columns of the view of the ddn derivatives.

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