SpECTRE Documentation Coverage Report
Current view: top level - PointwiseFunctions/Elasticity/ConstitutiveRelations - ConstitutiveRelation.hpp Hit Total Coverage
Commit: 882fd8fb9335daabe644ea24b30d08dbbe561435 Lines: 2 13 15.4 %
Date: 2021-03-05 02:32:17
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/Tensor/TypeAliases.hpp"
      10             : #include "Parallel/CharmPupable.hpp"
      11             : #include "Utilities/Gsl.hpp"
      12             : #include "Utilities/TMPL.hpp"
      13             : 
      14             : /// \cond
      15             : class DataVector;
      16             : namespace Elasticity {
      17             : namespace ConstitutiveRelations {
      18             : 
      19             : struct CubicCrystal;  // IWYU pragma: keep
      20             : 
      21             : template <size_t Dim>
      22             : struct IsotropicHomogeneous;  // IWYU pragma: keep
      23             : }  // namespace ConstitutiveRelations
      24             : }  // namespace Elasticity
      25             : /// \endcond
      26             : 
      27             : namespace Elasticity {
      28             : /*!
      29             :  * \brief Constitutive (stress-strain) relations that characterize the elastic
      30             :  * properties of a material
      31             :  */
      32             : namespace ConstitutiveRelations {
      33             : 
      34             : /*!
      35             :  * \brief Base class for constitutive (stress-strain) relations that
      36             :  * characterize the elastic properties of a material
      37             :  *
      38             :  * \details A constitutive relation, in the context of elasticity, relates the
      39             :  * Stress \f$T^{ij}\f$ and Strain \f$S_{ij}=\nabla_{(i}u_{j)}\f$ within an
      40             :  * elastic material (see \ref Elasticity). For small stresses it is approximated
      41             :  * by the linear relation
      42             :  *
      43             :  * \f[
      44             :  * T^{ij} = -Y^{ijkl}S_{kl}
      45             :  * \f]
      46             :  *
      47             :  * (Eq. 11.17 in \cite ThorneBlandford2017) that is referred to as _Hooke's
      48             :  * law_. The constitutive relation in this linear approximation is determined by
      49             :  * the elasticity (or _Young's_) tensor \f$Y^{ijkl}=Y^{(ij)(kl)}=Y^{klij}\f$
      50             :  * that generalizes a simple proportionality to a three-dimensional and
      51             :  * (possibly) anisotropic material.
      52             :  *
      53             :  * \note We assume a Euclidean metric in Cartesian coordinates here (for now).
      54             :  */
      55             : template <size_t Dim>
      56           1 : class ConstitutiveRelation : public PUP::able {
      57             :  public:
      58           0 :   static constexpr size_t volume_dim = Dim;
      59             : 
      60           0 :   using creatable_classes = tmpl::list<CubicCrystal, IsotropicHomogeneous<Dim>>;
      61             : 
      62           0 :   ConstitutiveRelation() = default;
      63           0 :   ConstitutiveRelation(const ConstitutiveRelation&) = default;
      64           0 :   ConstitutiveRelation& operator=(const ConstitutiveRelation&) = default;
      65           0 :   ConstitutiveRelation(ConstitutiveRelation&&) = default;
      66           0 :   ConstitutiveRelation& operator=(ConstitutiveRelation&&) = default;
      67           0 :   ~ConstitutiveRelation() override = default;
      68             : 
      69           0 :   WRAPPED_PUPable_abstract(ConstitutiveRelation);  // NOLINT
      70             : 
      71             :   // @{
      72             :   /// The constitutive relation that characterizes the elastic properties of a
      73             :   /// material
      74           1 :   virtual void stress(gsl::not_null<tnsr::II<DataVector, Dim>*> stress,
      75             :                       const tnsr::ii<DataVector, Dim>& strain,
      76             :                       const tnsr::I<DataVector, Dim>& x) const noexcept = 0;
      77             : 
      78             :   // This overload is provided for the situation where the `stress` variable
      79             :   // holds a non-symmetric tensor, as is currently the case when it is held in a
      80             :   // `Tags::Flux`. The overload can be removed once it is no longer used.
      81           0 :   void stress(gsl::not_null<tnsr::IJ<DataVector, Dim>*> stress,
      82             :               const tnsr::ii<DataVector, Dim>& strain,
      83             :               const tnsr::I<DataVector, Dim>& x) const noexcept;
      84             :   // @}
      85             : };
      86             : 
      87             : }  // namespace ConstitutiveRelations
      88             : }  // namespace Elasticity
      89             : 
      90             : #include "PointwiseFunctions/Elasticity/ConstitutiveRelations/CubicCrystal.hpp"  // IWYU pragma: keep
      91             : #include "PointwiseFunctions/Elasticity/ConstitutiveRelations/IsotropicHomogeneous.hpp"  // IWYU pragma: keep

Generated by: LCOV version 1.14