Reaktoro
A unified framework for modeling chemically reactive systems
EquilibriumBalance.hpp
1 // Reaktoro is a unified framework for modeling chemically reactive systems.
2 //
3 // Copyright (C) 2014-2018 Allan Leal
4 //
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
9 //
10 // This library 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 GNU
13 // Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library. If not, see <http://www.gnu.org/licenses/>.
17 
18 #pragma once
19 
20 // C++ includes
21 #include <memory>
22 
23 // Reaktoro includes
24 #include <Reaktoro/Math/Matrix.hpp>
25 
26 namespace Reaktoro {
27 
28 // Forward declarations
29 class ChemicalSystem;
30 class Partition;
31 class EquilibriumReactions;
32 
35 {
36 public:
38  EquilibriumBalance(const ChemicalSystem& system);
39 
41  EquilibriumBalance(const ChemicalSystem& system, const Partition& partition);
42 
44  EquilibriumBalance(const EquilibriumReactions& reactions);
45 
48 
50  virtual ~EquilibriumBalance();
51 
54 
59  auto regularizedMatrix() const -> MatrixConstRef;
60 
66  auto regularizedVector(Vector b) const -> Vector;
67 
68 private:
69  struct Impl;
70 
71  std::unique_ptr<Impl> pimpl;
72 };
73 
74 
75 } // namespace Reaktoro
A class to represent a system and its attributes and properties.
Definition: ChemicalSystem.hpp:38
auto operator=(EquilibriumBalance other) -> EquilibriumBalance &
Assign other EquilibriumBalance instance into this.
Definition: EquilibriumBalance.cpp:117
auto regularizedVector(Vector b) const -> Vector
Return the regularized mass balance vector.
Definition: EquilibriumBalance.cpp:128
The namespace containing all components of the Reaktoro library.
Definition: ChemicalScalar.hpp:24
auto regularizedMatrix() const -> MatrixConstRef
Return the regularized mass balance matrix.
Definition: EquilibriumBalance.cpp:123
A class that defines the mass balance conditions for equilibrium calculations.
Definition: EquilibriumBalance.hpp:35
EquilibriumBalance(const ChemicalSystem &system)
Construct an EquilibriumBalance instance with given chemical system.
Definition: EquilibriumBalance.cpp:93
A class that generates a system of equilibrium reactions written in terms of master and secondary spe...
Definition: EquilibriumReactions.hpp:39
Provide a computational representation of the Partition of a chemical system.
Definition: Partition.hpp:56
Eigen::Ref< const Eigen::MatrixXd > MatrixConstRef
Alias to Eigen type Ref<const MatrixXd>.
Definition: Matrix.hpp:44
virtual ~EquilibriumBalance()
Destroy this EquilibriumBalance instance.
Definition: EquilibriumBalance.cpp:113