Skip to content

Commit

Permalink
[docs] Update doxygen numerics groupings
Browse files Browse the repository at this point in the history
  • Loading branch information
ischoegl committed Jul 7, 2023
1 parent df29cfc commit f64c9db
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 12 deletions.
2 changes: 2 additions & 0 deletions include/cantera/base/Array.h
Expand Up @@ -25,6 +25,8 @@ namespace Cantera
* J(i,j) = data_start + index
* i = row
* j = column
*
* @ingroup matrices
*/
class Array2D
{
Expand Down
2 changes: 0 additions & 2 deletions include/cantera/base/global.h
Expand Up @@ -4,8 +4,6 @@
* inputfiles, logs, textlogs, (see \ref inputfiles, \ref logs, and
* \ref textlogs).
*
* @ingroup utils
*
* These functions store some parameters in global storage that are accessible
* at all times from the calling application. Contains module definitions for
* - inputfiles (see \ref inputfiles)
Expand Down
18 changes: 15 additions & 3 deletions include/cantera/base/utilities.h
@@ -1,17 +1,19 @@
/**
* @file utilities.h
* Various templated functions that carry out common vector
* operations (see \ref utils).
* Various templated functions that carry out common vector and polynomial operations
* (see \ref mathTemplates).
*/

// This file is part of Cantera. See License.txt in the top-level directory or
// at https://cantera.org/license.txt for license and copyright information.

/**
* @defgroup utils Templated Utility Functions
* @defgroup mathTemplates Templated Array and Polynomial Operations
*
* These are templates to perform various simple operations on arrays. Note that
* the compiler will inline these, so using them carries no performance penalty.
*
* @ingroup numerics
*/

#ifndef CT_UTILITIES_H
Expand All @@ -30,6 +32,7 @@ namespace Cantera
* @param x first reference to the templated class V
* @param y second reference to the templated class V
* @return This class returns a hard-coded type, doublereal.
* @ingroup mathTemplates
*/
template<class V>
inline doublereal dot4(const V& x, const V& y)
Expand All @@ -45,6 +48,7 @@ inline doublereal dot4(const V& x, const V& y)
* @param x first reference to the templated class V
* @param y second reference to the templated class V
* @return This class returns a hard-coded type, doublereal.
* @ingroup mathTemplates
*/
template<class V>
inline doublereal dot5(const V& x, const V& y)
Expand Down Expand Up @@ -72,6 +76,7 @@ inline doublereal dot5(const V& x, const V& y)
* @param y_begin Iterator pointing to the beginning of y, belonging to the
* iterator class InputIter2.
* @return The return is hard-coded to return a double.
* @ingroup mathTemplates
*/
template<class InputIter, class InputIter2>
inline doublereal dot(InputIter x_begin, InputIter x_end,
Expand All @@ -95,6 +100,7 @@ inline doublereal dot(InputIter x_begin, InputIter x_end,
* iterator class OutputIter. This is the output variable
* for this routine.
* @param scale_factor input scale factor belonging to the class S.
* @ingroup mathTemplates
*/
template<class InputIter, class OutputIter, class S>
inline void scale(InputIter begin, InputIter end,
Expand All @@ -108,6 +114,7 @@ inline void scale(InputIter begin, InputIter end,
/*!
* @param x Value of the independent variable - First template parameter
* @param c Pointer to the polynomial - Second template parameter
* @ingroup mathTemplates
*/
template<class D, class R>
R poly6(D x, R* c)
Expand All @@ -120,6 +127,7 @@ R poly6(D x, R* c)
/*!
* @param x Value of the independent variable - First template parameter
* @param c Pointer to the polynomial - Second template parameter
* @ingroup mathTemplates
*/
template<class D, class R>
R poly8(D x, R* c)
Expand All @@ -132,6 +140,7 @@ R poly8(D x, R* c)
/*!
* @param x Value of the independent variable - First template parameter
* @param c Pointer to the polynomial - Second template parameter
* @ingroup mathTemplates
*/
template<class D, class R>
R poly5(D x, R* c)
Expand All @@ -144,6 +153,7 @@ R poly5(D x, R* c)
/*!
* @param x Value of the independent variable.
* @param c Pointer to the polynomial coefficient array.
* @ingroup mathTemplates
*/
template<class D, class R>
R poly4(D x, R* c)
Expand All @@ -156,6 +166,7 @@ R poly4(D x, R* c)
/*!
* @param x Value of the independent variable - First template parameter
* @param c Pointer to the polynomial - Second template parameter
* @ingroup mathTemplates
*/
template<class D, class R>
R poly3(D x, R* c)
Expand Down Expand Up @@ -187,6 +198,7 @@ const U& getValue(const std::map<T, U>& m, const T& key, const U& default_val) {
}

//! Get the size of a container, cast to a signed integer type
//! @ingroup mathTemplates
template <class T, class U=int>
U len(const T& container) {
return static_cast<U>(container.size());
Expand Down
2 changes: 2 additions & 0 deletions include/cantera/numerics/BandMatrix.h
Expand Up @@ -30,6 +30,8 @@ namespace Cantera
* This class is a derived class of the base class GeneralMatrix. However,
* within the oneD directory, the class is used as is, without reference to the
* GeneralMatrix base type.
*
* @ingroup matrices
*/
class BandMatrix : public GeneralMatrix
{
Expand Down
16 changes: 10 additions & 6 deletions include/cantera/numerics/DenseMatrix.h
Expand Up @@ -18,12 +18,16 @@
namespace Cantera
{
/**
* @defgroup numerics Numerical Utilities within Cantera
*
* Cantera contains some capabilities for solving nonlinear equations and
* integrating both ODE and DAE equation systems in time. This section describes
* these capabilities.
* @defgroup numerics Numerical Utilities
*
* @details Cantera contains some capabilities for solving nonlinear equations and
* integrating both ODE and DAE equation systems in time.
*/

/**
* @defgroup matrices Matrix Handling
* Classes and methods implementing matrix operations.
* @ingroup numerics
*/

//! A class for full (non-sparse) matrices with Fortran-compatible data storage,
Expand All @@ -45,7 +49,7 @@ namespace Cantera
* m_printLevel. The default is for no reporting. If m_printLevel is nonzero,
* the error condition is reported to Cantera's log file.
*
* @ingroup numerics
* @ingroup matrices
*/
class DenseMatrix : public Array2D
{
Expand Down
1 change: 1 addition & 0 deletions include/cantera/numerics/Func1.h
Expand Up @@ -43,6 +43,7 @@ class TimesConstant1;
//! Functors implement functions of a single variable \f$ f(x) \f$.
//! Functor objects can be combined to form compound expressions, which allows for
//! the implementation of generic mathematical expressions.
//! @ingroup numerics

//! @defgroup func1simple Simple Functors
//! Simple functors implement standard mathematical expressions with a single
Expand Down
4 changes: 4 additions & 0 deletions include/cantera/numerics/FuncEval.h
Expand Up @@ -15,6 +15,10 @@
namespace Cantera
{

/**
* @defgroup odeGroup ODE and DAE Function Utilities
*/

/**
* Virtual base class for ODE/DAE right-hand-side function evaluators.
* Classes derived from FuncEval evaluate the right-hand-side function
Expand Down
3 changes: 2 additions & 1 deletion include/cantera/numerics/GeneralMatrix.h
@@ -1,7 +1,7 @@
/**
* @file GeneralMatrix.h
* Declarations for the class GeneralMatrix which is a virtual base class for matrices handled by solvers
* (see class \ref numerics and \link Cantera::GeneralMatrix GeneralMatrix\endlink).
* (see class \ref matrices and \link Cantera::GeneralMatrix GeneralMatrix\endlink).
*/

// This file is part of Cantera. See License.txt in the top-level directory or
Expand All @@ -18,6 +18,7 @@ namespace Cantera
{

//! Generic matrix
//! @ingroup matrices
class GeneralMatrix
{
public:
Expand Down
11 changes: 11 additions & 0 deletions include/cantera/numerics/eigen_dense.h
Expand Up @@ -18,11 +18,22 @@
namespace Cantera
{

//! @ingroup matrices
typedef Eigen::Map<Eigen::MatrixXd> MappedMatrix;

//! @ingroup matrices
typedef Eigen::Map<const Eigen::MatrixXd> ConstMappedMatrix;

//! @ingroup matrices
typedef Eigen::Map<Eigen::VectorXd> MappedVector;

//! @ingroup matrices
typedef Eigen::Map<const Eigen::VectorXd> ConstMappedVector;

//! @ingroup matrices
typedef Eigen::Map<Eigen::RowVectorXd> MappedRowVector;

//! @ingroup matrices
typedef Eigen::Map<const Eigen::RowVectorXd> ConstMappedRowVector;
}

Expand Down
1 change: 1 addition & 0 deletions include/cantera/numerics/eigen_sparse.h
Expand Up @@ -17,6 +17,7 @@

namespace Cantera
{
//! @ingroup matrices
typedef std::vector<Eigen::Triplet<double>> SparseTriplets;
}

Expand Down
11 changes: 11 additions & 0 deletions include/cantera/numerics/funcs.h
Expand Up @@ -15,6 +15,13 @@
namespace Cantera
{

/**
* @defgroup mathUtils Numerical Integration and Interpolation
* Collection of numerical utility functions for integration, interpolation and data
* fitting.
* @ingroup numerics
*/

//! Linearly interpolate a function defined on a discrete grid.
/*!
* Vector xpts contains a monotonic sequence of grid points, and vector fpts
Expand All @@ -26,6 +33,7 @@ namespace Cantera
* @param xpts value of the grid points
* @param fpts value of the interpolant at the grid points
* @returns the value of of the interpolated function at x.
* @ingroup mathUtils
*/
doublereal linearInterp(doublereal x, const vector_fp& xpts,
const vector_fp& fpts);
Expand All @@ -38,6 +46,7 @@ doublereal linearInterp(doublereal x, const vector_fp& xpts,
*
* @param f vector of function value
* @param x vector of function coordinate
* @ingroup mathUtils
*/
double trapezoidal(const Eigen::ArrayXd& f, const Eigen::ArrayXd& x);

Expand All @@ -52,6 +61,7 @@ double trapezoidal(const Eigen::ArrayXd& f, const Eigen::ArrayXd& x);
*
* @param f vector of function value
* @param x vector of function coordinate
* @ingroup mathUtils
*/
double simpson(const Eigen::ArrayXd& f, const Eigen::ArrayXd& x);

Expand All @@ -64,6 +74,7 @@ double simpson(const Eigen::ArrayXd& f, const Eigen::ArrayXd& x);
* @param method method name
* @param f vector of function value
* @param x vector of function coordinate
* @ingroup mathUtils
*/
double numericalQuadrature(const std::string& method,
const Eigen::ArrayXd& f,
Expand Down
1 change: 1 addition & 0 deletions include/cantera/numerics/polyfit.h
Expand Up @@ -28,6 +28,7 @@ namespace Cantera
* @param[out] p Array of polynomial coefficients, starting with the constant
* term. Length *deg+1*.
* @returns the root mean squared error of the fit at the input points.
* @ingroup mathUtils
*/
double polyfit(size_t n, size_t deg, const double* x, const double* y,
const double* w, double* p);
Expand Down

0 comments on commit f64c9db

Please sign in to comment.