From ab83aa3a2561a84f27d47c1cc076e621f99bb801 Mon Sep 17 00:00:00 2001 From: Anthony Walker Date: Tue, 24 Oct 2023 12:11:50 -0400 Subject: [PATCH] Doxygen fixes --- include/cantera/zeroD/FlowDevice.h | 55 ++++++++++++++----------- include/cantera/zeroD/Reactor.h | 5 +-- include/cantera/zeroD/ReactorBase.h | 62 +++++++++++++++-------------- include/cantera/zeroD/ReactorNet.h | 3 +- include/cantera/zeroD/Wall.h | 60 +++++++++++++++------------- src/zeroD/ReactorNet.cpp | 6 +-- 6 files changed, 101 insertions(+), 90 deletions(-) diff --git a/include/cantera/zeroD/FlowDevice.h b/include/cantera/zeroD/FlowDevice.h index 9590d374988..5bf946261e7 100644 --- a/include/cantera/zeroD/FlowDevice.h +++ b/include/cantera/zeroD/FlowDevice.h @@ -115,40 +115,47 @@ class FlowDevice m_time = time; } - /*! Build the Jacobian terms specific to the flow device for the given connected reactor. - * @param r a pointer to the calling reactor - * @param jacVector a vector of triplets to be added to the jacobian for the reactor - * @warning This function is an experimental part of the %Cantera API and may be changed - * or removed without notice. - * @since New in %Cantera 3.0. - */ + //! Build the Jacobian terms specific to the flow device for the given connected + //! reactor. + //! @param r a pointer to the calling reactor + //! @param jacVector a vector of triplets to be added to the jacobian for the + //! reactor + //! @warning This function is an experimental part of the %Cantera API and may be + //! changed + //! or removed without notice. + //! @since New in %Cantera 3.0. + //! virtual void buildReactorJacobian(ReactorBase* r, vector>& jacVector) { throw NotImplementedError(type() + "::buildReactorJacobian"); } - /*! Build the Jacobian terms specific to the flow device for the network. These terms - * will be adjusted to the networks indexing system outside of the reactor. - * @param jacVector a vector of triplets to be added to the jacobian for the reactor - * @warning This function is an experimental part of the %Cantera API and may be changed - * or removed without notice. - * @since New in %Cantera 3.0. - */ + //! Build the Jacobian terms specific to the flow device for the network. These + //! terms + //! will be adjusted to the networks indexing system outside of the reactor. + //! @param jacVector a vector of triplets to be added to the jacobian for the + //! reactor + //! @warning This function is an experimental part of the %Cantera API and may be + //! changed + //! or removed without notice. + //! @since New in %Cantera 3.0. + //! virtual void buildNetworkJacobian(vector>& jacVector) { throw NotImplementedError(type() + "::buildNetworkJacobian"); } - /*! Specify the jacobian terms have been calculated and should not be recalculated. - * @warning This function is an experimental part of the %Cantera API and may be changed - * or removed without notice. - * @since New in %Cantera 3.0. - */ + //! Specify the jacobian terms have been calculated and should not be recalculated. + //! @warning This function is an experimental part of the %Cantera API and may be + //! changed + //! or removed without notice. + //! @since New in %Cantera 3.0. + //! void jacobianCalculated() { m_jac_calculated = true; }; - /*! Specify that jacobian terms have not been calculated and should be recalculated. - * @warning This function is an experimental part of the %Cantera API and may be changed - * or removed without notice. - * @since New in %Cantera 3.0. - */ + //! Specify that jacobian terms have not been calculated and should be recalculated. + //! @warning This function is an experimental part of the %Cantera API and may be changed + //! or removed without notice. + //! @since New in %Cantera 3.0. + //! void jacobianNotCalculated() { m_jac_calculated = false; }; protected: diff --git a/include/cantera/zeroD/Reactor.h b/include/cantera/zeroD/Reactor.h index b6af3c2ee2a..8099d4a9c54 100644 --- a/include/cantera/zeroD/Reactor.h +++ b/include/cantera/zeroD/Reactor.h @@ -219,8 +219,7 @@ class Reactor : public ReactorBase } //! Calculate the Jacobian of a specific Reactor specialization. - //! @param jac_vector vector where jacobian triplets are added - //! @param offset offset added to the row and col indices of the elements + //! @param jacVector vector where jacobian triplets are added //! @warning Depending on the particular implementation, this may return an //! approximate Jacobian intended only for use in forming a preconditioner for //! iterative solvers. @@ -244,7 +243,7 @@ class Reactor : public ReactorBase virtual void buildWallJacobian(vector>& jacVector); //! Calculate flow contributions to the Jacobian of a Reactor specialization. - //! @param jac_vector vector where jacobian triplets are added + //! @param jacVector vector where jacobian triplets are added //! @warning Depending on the particular implementation, this may return an //! approximate Jacobian intended only for use in forming a preconditioner for //! iterative solvers. diff --git a/include/cantera/zeroD/ReactorBase.h b/include/cantera/zeroD/ReactorBase.h index 43b0165e42a..29b7b495cd0 100644 --- a/include/cantera/zeroD/ReactorBase.h +++ b/include/cantera/zeroD/ReactorBase.h @@ -248,48 +248,50 @@ class ReactorBase //! Set the ReactorNet that this reactor belongs to. void setNetwork(ReactorNet* net); - /*! Calculate the derivative of temperature with respect to the temperature in the - * heat transfer equation based on the reactor specific equation of state. - * This function should also transform the state of the derivative to that - * appropriate for the jacobian's state/ - * @warning This function is an experimental part of the %Cantera API and may be changed - * or removed without notice. - * @since New in %Cantera 3.0. - */ + //! Calculate the derivative of temperature with respect to the temperature in the + //! heat transfer equation based on the reactor specific equation of state. + //! This function should also transform the state of the derivative to that + //! appropriate for the jacobian's state/ + //! @warning This function is an experimental part of the %Cantera API and may be changed + //! or removed without notice. + //! @since New in %Cantera 3.0. + //! virtual double temperatureDerivative() { throw NotImplementedError("Reactor::temperatureDerivative"); } - /*! Calculate the derivative of temperature with respect to the temperature in the - * heat transfer radiation equation based on the reactor specific equation of state. - * This function should also transform the state of the derivative to that - * appropriate for the jacobian's state/ - * @warning This function is an experimental part of the %Cantera API and may be changed - * or removed without notice. - * @since New in %Cantera 3.0. - */ + //! Calculate the derivative of temperature with respect to the temperature in the + //! heat transfer radiation equation based on the reactor specific equation of + //! state. + //! This function should also transform the state of the derivative to that + //! appropriate for the jacobian's state/ + //! @warning This function is an experimental part of the %Cantera API and may be + //! changed + //! or removed without notice. + //! @since New in %Cantera 3.0. + //! virtual double temperatureRadiationDerivative() { throw NotImplementedError("Reactor::temperatureRadiationDerivative"); } - /*! Calculate the derivative of T with respect to the ith species in the heat - * transfer equation based on the reactor specific equation of state. - * @param index index of the species the derivative is with respect too - * @warning This function is an experimental part of the %Cantera API and may be changed - * or removed without notice. - * @since New in %Cantera 3.0. - */ + //! Calculate the derivative of T with respect to the ith species in the heat + //! transfer equation based on the reactor specific equation of state. + //! @param index index of the species the derivative is with respect too + //! @warning This function is an experimental part of the %Cantera API and may be changed + //! or removed without notice. + //! @since New in %Cantera 3.0. + //! virtual double moleDerivative(size_t index) { throw NotImplementedError("Reactor::moleDerivative"); } - /*! Calculate the derivative of T with respect to the ith species in the heat - * transfer radiation equation based on the reactor specific equation of state. - * @param index index of the species the derivative is with respect too - * @warning This function is an experimental part of the %Cantera API and may be changed - * or removed without notice. - * @since New in %Cantera 3.0. - */ + //! Calculate the derivative of T with respect to the ith species in the heat + //! transfer radiation equation based on the reactor specific equation of state. + //! @param index index of the species the derivative is with respect too + //! @warning This function is an experimental part of the %Cantera API and may be changed + //! or removed without notice. + //! @since New in %Cantera 3.0. + //! virtual double moleRadiationDerivative(size_t index) { throw NotImplementedError("Reactor::moleRadiationDerivative"); } diff --git a/include/cantera/zeroD/ReactorNet.h b/include/cantera/zeroD/ReactorNet.h index 14367184805..2b295a85a95 100644 --- a/include/cantera/zeroD/ReactorNet.h +++ b/include/cantera/zeroD/ReactorNet.h @@ -341,8 +341,7 @@ class ReactorNet : public FuncEval protected: //! Calculate the Jacobian of the entire reactor network. - //! @param jac_vector vector where jacobian triplets are added - //! @param offset offset added to the row and col indices of the elements + //! @param jacVector vector where jacobian triplets are added //! @warning Depending on the particular implementation, this may return an //! approximate Jacobian intended only for use in forming a preconditioner for //! iterative solvers. diff --git a/include/cantera/zeroD/Wall.h b/include/cantera/zeroD/Wall.h index d240ff4f7e6..4ebd74aeb5a 100644 --- a/include/cantera/zeroD/Wall.h +++ b/include/cantera/zeroD/Wall.h @@ -116,44 +116,48 @@ class WallBase m_time = time; } - /*! Build the Jacobian terms specific to the flow device for the given connected reactor. - * @param r a pointer to the calling reactor - * @param jacVector a vector of triplets to be added to the jacobian for the reactor - * @warning This function is an experimental part of the %Cantera API and may be - * changed - * or removed without notice. - * @since New in %Cantera 3.0. - */ + //! Build the Jacobian terms specific to the flow device for the given connected + //! reactor. + //! @param r a pointer to the calling reactor + //! @param jacVector a vector of triplets to be added to the jacobian for the + //! reactor + //! @warning This function is an experimental part of the %Cantera API and may be + //! changed + //! or removed without notice. + //! @since New in %Cantera 3.0. + //! virtual void buildReactorJacobian(ReactorBase* r, vector>& jacVector) { throw NotImplementedError("WallBase::buildReactorJacobian"); } - /*! Build the Jacobian terms specific to the flow device for the network. These terms - * will be adjusted to the networks indexing system outside of the reactor. - * @param jacVector a vector of triplets to be added to the jacobian for the reactor - * @warning This function is an experimental part of the %Cantera API and may be - * changed - * or removed without notice. - * @since New in %Cantera 3.0. - */ + //! Build the Jacobian terms specific to the flow device for the network. These + //! terms + //! will be adjusted to the networks indexing system outside of the reactor. + //! @param jacVector a vector of triplets to be added to the jacobian for the + //! reactor + //! @warning This function is an experimental part of the %Cantera API and may be + //! changed + //! or removed without notice. + //! @since New in %Cantera 3.0. + //! virtual void buildNetworkJacobian(vector>& jacVector) { throw NotImplementedError("WallBase::buildNetworkJacobian"); } - /*! Specify the jacobian terms have been calculated and should not be recalculated. - * @warning This function is an experimental part of the %Cantera API and may be - * changed - * or removed without notice. - * @since New in %Cantera 3.0. - */ + //! Specify the jacobian terms have been calculated and should not be recalculated. + //! @warning This function is an experimental part of the %Cantera API and may be + //! changed + //! or removed without notice. + //! @since New in %Cantera 3.0. + //! void jacobianCalculated() { m_jac_calculated = true; }; - /*! Specify that jacobian terms have not been calculated and should be recalculated. - * @warning This function is an experimental part of the %Cantera API and may be - * changed - * or removed without notice. - * @since New in %Cantera 3.0. - */ + //! Specify that jacobian terms have not been calculated and should be recalculated. + //! @warning This function is an experimental part of the %Cantera API and may be + //! changed + //! or removed without notice. + //! @since New in %Cantera 3.0. + //! void jacobianNotCalculated() { m_jac_calculated = false; }; protected: diff --git a/src/zeroD/ReactorNet.cpp b/src/zeroD/ReactorNet.cpp index 4261bfe03c9..a037f9aee76 100644 --- a/src/zeroD/ReactorNet.cpp +++ b/src/zeroD/ReactorNet.cpp @@ -554,10 +554,10 @@ void ReactorNet::preconditionerSetup(double t, double* y, double gamma) // Update network with adjusted state updateState(yCopy.data()); // Create jacobian triplet vector - vector> jac_vector; - buildJacobian(jac_vector); + vector> jacVector; + buildJacobian(jacVector); // Add to preconditioner with offset - for (auto it : jac_vector) { + for (auto it : jacVector) { precon->setValue(it.row(), it.col(), it.value()); } // post reactor setup operations