SpECTRE Documentation Coverage Report
Current view: top level - PointwiseFunctions/MathFunctions - TensorProduct.hpp Hit Total Coverage
Commit: 2ae2b99409ac582030d56a4560a92a3e066a7e54 Lines: 5 13 38.5 %
Date: 2022-01-15 08:40:38
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 a tensor product of one-dimensional MathFunctions
       6             : 
       7             : #pragma once
       8             : 
       9             : #include <array>
      10             : #include <cstddef>
      11             : #include <memory>
      12             : 
      13             : #include "DataStructures/Tensor/TypeAliases.hpp"
      14             : #include "PointwiseFunctions/MathFunctions/MathFunction.hpp"
      15             : 
      16             : namespace MathFunctions {
      17             : 
      18             : /// \ingroup MathFunctionsGroup
      19             : /// \brief a tensor product of one-dimensional MathFunctions
      20             : template <size_t Dim>
      21           1 : class TensorProduct {
      22             :  public:
      23           0 :   TensorProduct(double scale,
      24             :                 std::array<std::unique_ptr<MathFunction<1, Frame::Inertial>>,
      25             :                            Dim>&& functions);
      26             : 
      27           0 :   TensorProduct(const TensorProduct&) = delete;
      28           0 :   TensorProduct(TensorProduct&&) = default;
      29           0 :   TensorProduct& operator=(const TensorProduct&) = delete;
      30           0 :   TensorProduct& operator=(TensorProduct&&) = default;
      31           0 :   ~TensorProduct() = default;
      32             : 
      33             :   /// The value of the function
      34             :   template <typename T>
      35           1 :   Scalar<T> operator()(const tnsr::I<T, Dim>& x) const;
      36             : 
      37             :   /// The partial derivatives of the function
      38             :   template <typename T>
      39           1 :   tnsr::i<T, Dim> first_derivatives(const tnsr::I<T, Dim>& x) const;
      40             : 
      41             :   /// The second partial derivatives of the function
      42             :   template <typename T>
      43           1 :   tnsr::ii<T, Dim> second_derivatives(const tnsr::I<T, Dim>& x) const;
      44             : 
      45             :  private:
      46           0 :   double scale_{1.0};
      47           0 :   std::array<std::unique_ptr<MathFunction<1, Frame::Inertial>>, Dim> functions_;
      48             : };
      49             : }  // namespace MathFunctions

Generated by: LCOV version 1.14