Skip to content

Commit

Permalink
Doxygen fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
anthony-walker committed Dec 22, 2023
1 parent 8d9f506 commit 1cfecb1
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 90 deletions.
55 changes: 31 additions & 24 deletions include/cantera/zeroD/FlowDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<Eigen::Triplet<double>>& 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<Eigen::Triplet<double>>& 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:
Expand Down
5 changes: 2 additions & 3 deletions include/cantera/zeroD/Reactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -244,7 +243,7 @@ class Reactor : public ReactorBase
virtual void buildWallJacobian(vector<Eigen::Triplet<double>>& 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.
Expand Down
62 changes: 32 additions & 30 deletions include/cantera/zeroD/ReactorBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
3 changes: 1 addition & 2 deletions include/cantera/zeroD/ReactorNet.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
60 changes: 32 additions & 28 deletions include/cantera/zeroD/Wall.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<Eigen::Triplet<double>>& 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<Eigen::Triplet<double>>& 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:
Expand Down
6 changes: 3 additions & 3 deletions src/zeroD/ReactorNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Eigen::Triplet<double>> jac_vector;
buildJacobian(jac_vector);
vector<Eigen::Triplet<double>> 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
Expand Down

0 comments on commit 1cfecb1

Please sign in to comment.