Reaktoro 
A unified framework for modeling chemically reactive systems
EquilibriumPath.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 #include <string>
23 #include <vector>
24 
25 // Reaktoro includes
26 #include <Reaktoro/Equilibrium/EquilibriumOptions.hpp>
27 #include <Reaktoro/Equilibrium/EquilibriumResult.hpp>
28 #include <Reaktoro/Math/ODE.hpp>
29 
30 namespace Reaktoro {
31 
32 // Forward declarations
33 class ChemicalOutput;
34 class ChemicalPlot;
35 class ChemicalSystem;
36 class ChemicalState;
37 class Partition;
38 
41 {
44 
47 
49  double maxstep = 0.1;
50 };
51 
54 {
57 };
58 
61 {
62 public:
64  explicit EquilibriumPath(const ChemicalSystem& system);
65 
67  EquilibriumPath(const EquilibriumPath& other);
68 
70  virtual ~EquilibriumPath();
71 
73  auto operator=(EquilibriumPath other) -> EquilibriumPath&;
74 
76  auto setOptions(const EquilibriumPathOptions& options) -> void;
77 
79  auto setPartition(const Partition& partition) -> void;
80 
82  auto solve(const ChemicalState& state_i, const ChemicalState& state_f) -> EquilibriumPathResult;
83 
89  auto output() -> ChemicalOutput;
90 
96  auto plot() -> ChemicalPlot;
97 
103  auto plots(unsigned num) -> std::vector<ChemicalPlot>;
104 
106  auto system() const -> const ChemicalSystem&;
107 
109  auto partition() const -> const Partition&;
110 
111 private:
112  struct Impl;
113 
114  std::unique_ptr<Impl> pimpl;
115 };
116 
117 } // namespace Reaktoro
A struct that describes the options from an equilibrium path calculation.
Definition: EquilibriumPath.hpp:40
A struct that defines the options for the ODESolver.
Definition: ODE.hpp:43
A class to represent a system and its attributes and properties.
Definition: ChemicalSystem.hpp:47
A class that describes a path of equilibrium states.
Definition: EquilibriumPath.hpp:60
The options for the equilibrium calculations.
Definition: EquilibriumOptions.hpp:44
A struct that describes the result of an equilibrium path calculation.
Definition: EquilibriumPath.hpp:53
EquilibriumOptions equilibrium
The options for the chemical equilibrium calculations.
Definition: EquilibriumPath.hpp:43
A class used to create plots from sequence of chemical states.
Definition: ChemicalPlot.hpp:35
double maxstep
The maximum step length during the equilibrium path calculation.
Definition: EquilibriumPath.hpp:49
ODEOptions ode
The options for the ODE solver.
Definition: EquilibriumPath.hpp:46
A type used to describe the result of an equilibrium calculation.
Definition: EquilibriumResult.hpp:27
Provide a computational representation of the Partition of a chemical system.
Definition: Partition.hpp:55
EquilibriumResult equilibrium
The accumulated result of the equilibrium calculations.
Definition: EquilibriumPath.hpp:56
Provides a computational representation of the state of a multiphase chemical system.
Definition: ChemicalState.hpp:60
A type used to output sequence of chemical states to a file or terminal.
Definition: ChemicalOutput.hpp:35
The namespace containing all components of the Reaktoro library.
Definition: ChemicalScalar.hpp:24