Reaktoro
A unified framework for modeling chemically reactive systems
EquilibriumInverseSolver.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 EquilibriumInverseProblem;
31 class ChemicalState;
32 class Partition;
33 struct EquilibriumOptions;
34 struct EquilibriumResult;
35 struct EquilibriumSensitivity;
36 
39 {
40 public:
42  explicit EquilibriumInverseSolver(const ChemicalSystem& system);
43 
46 
48  virtual ~EquilibriumInverseSolver();
49 
52 
54  auto setOptions(const EquilibriumOptions& options) -> void;
55 
57  auto setPartition(const Partition& partition) -> void;
58 
62  auto solve(ChemicalState& state, const EquilibriumInverseProblem& problem) -> EquilibriumResult;
63 
69 
70 private:
71  struct Impl;
72 
73  std::unique_ptr<Impl> pimpl;
74 };
75 
76 } // namespace Reaktoro
A class used for solving inverse equilibrium problems.
Definition: EquilibriumInverseSolver.hpp:39
The options for the equilibrium calculations.
Definition: EquilibriumOptions.hpp:55
A class to represent a system and its attributes and properties.
Definition: ChemicalSystem.hpp:38
Provides a computational representation of the state of a multiphase chemical system.
Definition: ChemicalState.hpp:61
EquilibriumInverseSolver(const ChemicalSystem &system)
Construct an EquilibriumInverseSolver instance.
Definition: EquilibriumInverseSolver.cpp:164
auto solve(ChemicalState &state, const EquilibriumInverseProblem &problem) -> EquilibriumResult
Solve an inverse equilibrium problem.
Definition: EquilibriumInverseSolver.cpp:191
A class used for defining an inverse equilibrium problem.
Definition: EquilibriumInverseProblem.hpp:57
auto sensitivity() -> EquilibriumSensitivity
Return the sensitivity of the equilibrium state.
Definition: EquilibriumInverseSolver.cpp:196
The namespace containing all components of the Reaktoro library.
Definition: ChemicalScalar.hpp:24
auto operator=(EquilibriumInverseSolver other) -> EquilibriumInverseSolver &
Assign a copy of an EquilibriumInverseSolver instance.
Definition: EquilibriumInverseSolver.cpp:175
A type that contains the sensitivity data of the equilibrium state.
Definition: EquilibriumSensitivity.hpp:31
auto setPartition(const Partition &partition) -> void
Set the partition of the chemical system.
Definition: EquilibriumInverseSolver.cpp:186
auto setOptions(const EquilibriumOptions &options) -> void
Set the options of the equilibrium solver.
Definition: EquilibriumInverseSolver.cpp:181
Provide a computational representation of the Partition of a chemical system.
Definition: Partition.hpp:56
A type used to describe the result of an equilibrium calculation.
Definition: EquilibriumResult.hpp:35
virtual ~EquilibriumInverseSolver()
Destroy this EquilibriumInverseSolver instance.
Definition: EquilibriumInverseSolver.cpp:172