Reaktoro 
A unified framework for modeling chemically reactive systems
Utils.hpp
1 // Reaktoro is a unified framework for modeling chemically reactive systems.
2 //
3 // Copyright (C) 2014-2015 Allan Leal
4 //
5 // This program is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18 #pragma once
19 
20 // C++ includes
21 #include <string>
22 #include <vector>
23 
24 // Reaktoro includes
25 #include <Reaktoro/Common/ChemicalScalar.hpp>
26 #include <Reaktoro/Common/ChemicalVector.hpp>
27 #include <Reaktoro/Common/Index.hpp>
28 #include <Reaktoro/Math/Matrix.hpp>
29 
30 namespace Reaktoro {
31 
33 template<typename NamedValues>
34 auto names(const NamedValues& values) -> std::vector<std::string>;
35 
37 template<typename ChargedValues>
38 auto charges(const ChargedValues& values) -> Vector;
39 
41 template<typename SpeciesValues>
42 auto molarMasses(const SpeciesValues& species) -> Vector;
43 
45 template<typename Derived>
46 auto molarFractions(const Eigen::MatrixBase<Derived>& n) -> ChemicalVector;
47 
48 } // namespace Reaktoro
49 
50 #include "Utils.hxx"
auto names(const NamedValues &values) -> std::vector< std::string >
Return the names of the entries in a container.
Definition: Utils.hxx:22
Eigen::VectorXd Vector
Define an alias to the vector type of the Eigen library.
Definition: Matrix.hpp:384
auto molarFractions(const Eigen::MatrixBase< Derived > &n) -> ChemicalVector
Return the molar fractions of the species.
Definition: Utils.hxx:50
auto molarMasses(const SpeciesValues &species) -> Vector
Return the molar masses of all species in a list of species (in units of kg/mol)
Definition: Utils.hxx:41
ChemicalVectorBase< Vector, Vector, Vector, Matrix > ChemicalVector
A type that represents a vector of chemical scalars and their derivatives.
Definition: ChemicalVector.hpp:39
auto charges(const ChargedValues &values) -> Vector
Return the electrical charges of all species in a list of species.
The namespace containing all components of the Reaktoro library.
Definition: ChemicalScalar.hpp:24