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-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 <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 -> const Matrix&;
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
Eigen::MatrixXd Matrix
Define an alias to the matrix type of the Eigen library.
Definition: Matrix.hpp:387
A class to represent a system and its attributes and properties.
Definition: ChemicalSystem.hpp:47
A class that defines the mass balance conditions for equilibrium calculations.
Definition: EquilibriumBalance.hpp:34
auto regularizedMatrix() const -> const Matrix &
Return the regularized mass balance matrix.
Definition: EquilibriumBalance.cpp:123
Eigen::VectorXd Vector
Define an alias to the vector type of the Eigen library.
Definition: Matrix.hpp:384
EquilibriumBalance(const ChemicalSystem &system)
Construct an EquilibriumBalance instance with given chemical system.
Definition: EquilibriumBalance.cpp:93
virtual ~EquilibriumBalance()
Destroy this EquilibriumBalance instance.
Definition: EquilibriumBalance.cpp:113
Provide a computational representation of the Partition of a chemical system.
Definition: Partition.hpp:55
A class that generates a system of equilibrium reactions written in terms of master and secondary spe...
Definition: EquilibriumReactions.hpp:38
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 operator=(EquilibriumBalance other) -> EquilibriumBalance &
Assign other EquilibriumBalance instance into this.
Definition: EquilibriumBalance.cpp:117