SpECTRE Documentation Coverage Report
Current view: top level - PointwiseFunctions/AnalyticSolutions/Elasticity - Zero.hpp Hit Total Coverage
Commit: ecb8a275e1aebab77dcce48a5e098ed4e486ab4b Lines: 2 15 13.3 %
Date: 2026-08-22 01:05:40
Legend: Lines: hit not hit

          Line data    Source code
       1           0 : // Distributed under the MIT License.
       2             : // See LICENSE.txt for details.
       3             : 
       4             : #pragma once
       5             : 
       6             : #include <cstddef>
       7             : #include <pup.h>
       8             : 
       9             : #include "DataStructures/DataBox/Prefixes.hpp"
      10             : #include "DataStructures/DataVector.hpp"
      11             : #include "DataStructures/TaggedTuple.hpp"
      12             : #include "DataStructures/Tensor/Tensor.hpp"
      13             : #include "Elliptic/Systems/Elasticity/Tags.hpp"
      14             : #include "NumericalAlgorithms/LinearOperators/PartialDerivatives.hpp"
      15             : #include "NumericalAlgorithms/Spectral/Mesh.hpp"
      16             : #include "Options/String.hpp"
      17             : #include "PointwiseFunctions/InitialDataUtilities/AnalyticSolution.hpp"
      18             : #include "Utilities/MakeWithValue.hpp"
      19             : #include "Utilities/Serialization/CharmPupable.hpp"
      20             : #include "Utilities/TMPL.hpp"
      21             : 
      22             : namespace Elasticity::Solutions {
      23             : 
      24             : /*!
      25             :  * \brief The trivial solution \f$\xi^i(x)=0\f$ of the Elasticity equations.
      26             :  * Useful as initial guess.
      27             :  */
      28             : template <size_t Dim>
      29           1 : class Zero : public elliptic::analytic_data::AnalyticSolution {
      30             :  public:
      31           0 :   using options = tmpl::list<>;
      32           0 :   static constexpr Options::String help{
      33             :       "The trivial solution, useful as initial guess."};
      34             : 
      35           0 :   Zero() = default;
      36           0 :   Zero(const Zero&) = default;
      37           0 :   Zero& operator=(const Zero&) = default;
      38           0 :   Zero(Zero&&) = default;
      39           0 :   Zero& operator=(Zero&&) = default;
      40           0 :   ~Zero() override = default;
      41           0 :   std::unique_ptr<elliptic::analytic_data::AnalyticSolution> get_clone()
      42             :       const override {
      43             :     return std::make_unique<Zero>(*this);
      44             :   }
      45             : 
      46             :   /// \cond
      47             :   explicit Zero(CkMigrateMessage* m)
      48             :       : elliptic::analytic_data::AnalyticSolution(m) {}
      49             :   using PUP::able::register_constructor;
      50             :   WRAPPED_PUPable_decl_template(Zero);  // NOLINT
      51             :   /// \endcond
      52             : 
      53             :   /// Retrieve a collection of variables at coordinates `x`
      54             :   template <typename DataType, typename... RequestedTags>
      55           1 :   tuples::TaggedTuple<RequestedTags...> variables(
      56             :       const tnsr::I<DataType, Dim>& x,
      57             :       tmpl::list<RequestedTags...> /*meta*/) const {
      58             :     using supported_tags =
      59             :         tmpl::list<Tags::Displacement<Dim>,
      60             :                    ::Tags::deriv<Tags::Displacement<Dim>, tmpl::size_t<Dim>,
      61             :                                  Frame::Inertial>,
      62             :                    Tags::Strain<Dim>, Tags::MinusStress<Dim>,
      63             :                    Tags::PotentialEnergyDensity<Dim>,
      64             :                    ::Tags::FixedSource<Tags::Displacement<Dim>>>;
      65             :     static_assert(tmpl::size<tmpl::list_difference<tmpl::list<RequestedTags...>,
      66             :                                                    supported_tags>>::value == 0,
      67             :                   "The requested tag is not supported");
      68             :     return {make_with_value<typename RequestedTags::type>(x, 0.)...};
      69             :   }
      70             : 
      71             :   template <typename... RequestedTags>
      72           0 :   tuples::TaggedTuple<RequestedTags...> variables(
      73             :       const tnsr::I<DataVector, Dim>& x, const Mesh<Dim>& /*mesh*/,
      74             :       const InverseJacobian<DataVector, Dim, Frame::ElementLogical,
      75             :                             Frame::Inertial>& /*inv_jacobian*/,
      76             :       tmpl::list<RequestedTags...> meta) const {
      77             :     return variables(x, meta);
      78             :   }
      79             : };
      80             : 
      81             : /// \cond
      82             : template <size_t Dim>
      83             : PUP::able::PUP_ID Zero<Dim>::my_PUP_ID = 0;  // NOLINT
      84             : /// \endcond
      85             : 
      86             : template <size_t Dim>
      87           0 : bool operator==(const Zero<Dim>& /*lhs*/, const Zero<Dim>& /*rhs*/) {
      88             :   return true;
      89             : }
      90             : 
      91             : template <size_t Dim>
      92           0 : bool operator!=(const Zero<Dim>& /*lhs*/, const Zero<Dim>& /*rhs*/) {
      93             :   return false;
      94             : }
      95             : }  // namespace Elasticity::Solutions

Generated by: LCOV version 1.14