Reaktoro  v2.11.0
A unified framework for modeling chemically reactive systems
EquilibriumHessian.hpp
1 // Reaktoro is a unified framework for modeling chemically reactive systems.
2 //
3 // Copyright © 2014-2024 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 // Reaktoro includes
21 #include <Reaktoro/Common/Matrix.hpp>
22 #include <Reaktoro/Common/Types.hpp>
23 
24 namespace Reaktoro {
25 
26 // Forward declarations
27 class ChemicalSystem;
28 
31 {
32 public:
34  explicit EquilibriumHessian(ChemicalSystem const& system);
35 
38 
41 
44 
48  auto exact(real const& T, real const& P, VectorXrConstRef const& n) -> MatrixXdConstRef;
49 
59  auto partiallyExact(real const& T, real const& P, VectorXrConstRef const& n, VectorXlConstRef const& idxs) -> MatrixXdConstRef;
60 
67 
72 
73 private:
74  struct Impl;
75 
76  Ptr<Impl> pimpl;
77 };
78 
79 } // namespace Reaktoro
The class used to represent a chemical system and its attributes and properties.
Definition: ChemicalSystem.hpp:70
Used to compute the Hessian matrix of the Gibbs energy function.
Definition: EquilibriumHessian.hpp:31
auto diagonal(VectorXrConstRef const &n) -> MatrixXdConstRef
Evaluate the Hessian matrix ∂(µ/RT)/∂n as a diagonal matrix using approximate derivatives.
auto operator=(EquilibriumHessian other) -> EquilibriumHessian &
Assign a copy of an EquilibriumHessian object to this.
auto approximate(VectorXrConstRef const &n) -> MatrixXdConstRef
Evaluate the Hessian matrix ∂(µ/RT)/∂n with approximate derivatives.
auto exact(real const &T, real const &P, VectorXrConstRef const &n) -> MatrixXdConstRef
Evaluate the Hessian matrix ∂(µ/RT)/∂n with exact derivatives.
auto partiallyExact(real const &T, real const &P, VectorXrConstRef const &n, VectorXlConstRef const &idxs) -> MatrixXdConstRef
Evaluate the Hessian matrix ∂(µ/RT)/∂n with exact derivatives for selected species.
EquilibriumHessian(EquilibriumHessian const &other)
Construct a copy of an EquilibriumHessian object.
~EquilibriumHessian()
Destroy this EquilibriumHessian object.
EquilibriumHessian(ChemicalSystem const &system)
Construct an EquilibriumHessian object with given specifications.
The namespace containing all components of the Reaktoro library.
Definition: Algorithms.hpp:29
Eigen::Ref< const VectorXl > VectorXlConstRef
Convenient alias to Eigen type.
Definition: Matrix.hpp:68
Eigen::Ref< const VectorXr > VectorXrConstRef
Convenient alias to Eigen type.
Definition: Matrix.hpp:60
autodiff::real real
The number type used throughout the library.
Definition: Real.hpp:26
std::unique_ptr< T > Ptr
Convenient alias for std::unique_ptr<T>.
Definition: Types.hpp:102
Eigen::Ref< const MatrixXd > MatrixXdConstRef
Convenient alias to Eigen type.
Definition: Matrix.hpp:139