SpECTRE Documentation Coverage Report
Current view: top level - NumericalAlgorithms/LinearOperators - DefiniteIntegral.hpp Hit Total Coverage
Commit: 1f2210958b4f38fdc0400907ee7c6d5af5111418 Lines: 2 2 100.0 %
Date: 2025-12-05 05:03:31
Legend: Lines: hit not hit

          Line data    Source code
       1           1 : // Distributed under the MIT License.
       2             : // See LICENSE.txt for details.
       3             : 
       4             : /// \file
       5             : /// Defines function definite_integral.
       6             : 
       7             : #pragma once
       8             : 
       9             : #include <cstddef>
      10             : 
      11             : /// \cond
      12             : class DataVector;
      13             : template <size_t>
      14             : class Mesh;
      15             : /// \endcond
      16             : 
      17             : /*!
      18             :  * \ingroup NumericalAlgorithmsGroup
      19             :  * \brief Compute the definite integral of a function over a manifold.
      20             :  *
      21             :  * Given a function \f$f\f$, compute its integral \f$I\f$ with respect to
      22             :  * the logical coordinates \f$\boldsymbol{\xi} = (\xi, \eta, \zeta)\f$.
      23             :  * E.g., in 1 dimension, \f$I = \int_{-1}^1 f d\xi\f$.
      24             :  *
      25             :  * The integral w.r.t. a different set of coordinates
      26             :  * \f$\boldsymbol{x} = \boldsymbol{x}(\boldsymbol{\xi})\f$ can be computed
      27             :  * by pre-multiplying \f$f\f$ by the Jacobian determinant
      28             :  * \f$J = \det d\boldsymbol{x}/d\boldsymbol{\xi}\f$ of the mapping
      29             :  * \f$\boldsymbol{x}(\boldsymbol{\xi})\f$. Note that, in the
      30             :  * \f$\boldsymbol{x}\f$ coordinates, the domain of integration is the image of
      31             :  * the logical cube (square in 2D, interval in 1D) under the mapping.
      32             :  *
      33             :  * The integral is computed by quadrature, using the quadrature rule for the
      34             :  * basis associated with the collocation points.
      35             :  *
      36             :  * If the mesh uses a Cartoon basis, the passed integrand must already be
      37             :  * multiplied by the appropriate Jacobian determinants (i.e. both the
      38             :  * \f$\boldsymbol{x}(\boldsymbol{\xi})\f$ and the cartesian to spherical/polar
      39             :  * coordinates mappings, the latter being either
      40             :  * \f$x^2\f$ or \f$x\f$, respectively).
      41             :  *
      42             :  * \param integrand the function to integrate.
      43             :  * \param mesh the Mesh defining the grid points on the manifold.
      44             :  */
      45             : template <size_t Dim>
      46           1 : double definite_integral(const DataVector& integrand, const Mesh<Dim>& mesh);

Generated by: LCOV version 1.14