PotentialEnergy.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 
9 #include "Domain/Tags.hpp"
10 #include "Elliptic/Systems/Elasticity/Tags.hpp"
11 #include "PointwiseFunctions/AnalyticSolutions/Tags.hpp"
12 #include "PointwiseFunctions/Elasticity/ConstitutiveRelations/ConstitutiveRelation.hpp"
13 #include "PointwiseFunctions/Elasticity/ConstitutiveRelations/Tags.hpp"
14 
15 namespace Elasticity {
16 
17 // @{
18 /*!
19  * \brief The potential energy density \f$U=-\frac{1}{2}S_{ij}T^{ij}\f$ stored
20  * in the deformation of the elastic material (see Eq. (11.25) in
21  * \cite ThorneBlandford2017)
22  *
23  * Note that the two-dimensional instantiation of this function assumes that
24  * only the terms of \f$S_{ij}T^{ij}\f$ where both \f$i\f$ and \f$j\f$
25  * correspond to one of the computational dimensions contribute to the sum. This
26  * is the case for the plane-stress approximation employed in the
27  * two-dimensional `Elasticity::ConstitutiveRelations::IsotropicHomogeneous`,
28  * for example, where \f$T^{i3}=0=T^{3i}\f$.
29  */
30 template <size_t Dim>
31 void potential_energy_density(
32  gsl::not_null<Scalar<DataVector>*> potential_energy_density,
33  const tnsr::ii<DataVector, Dim>& strain,
34  const tnsr::I<DataVector, Dim>& coordinates,
35  const ConstitutiveRelations::ConstitutiveRelation<Dim>&
36  constitutive_relation) noexcept;
37 
38 template <size_t Dim>
39 Scalar<DataVector> potential_energy_density(
40  const tnsr::ii<DataVector, Dim>& strain,
41  const tnsr::I<DataVector, Dim>& coordinates,
42  const ConstitutiveRelations::ConstitutiveRelation<Dim>&
43  constitutive_relation) noexcept;
44 // @}
45 
46 namespace Tags {
47 
48 /// \brief Computes the energy density stored in the deformation of the elastic
49 /// material.
50 /// \see `Elasticity::Tags::PotentialEnergyDensity`
51 template <size_t Dim>
56  using return_type = Scalar<DataVector>;
57  using argument_tags =
58  tmpl::list<Elasticity::Tags::Strain<Dim>,
61  static constexpr auto function = static_cast<void (*)(
62  gsl::not_null<Scalar<DataVector>*>, const tnsr::ii<DataVector, Dim>&,
63  const tnsr::I<DataVector, Dim>&,
65  &potential_energy_density<Dim>);
66 };
67 
68 } // namespace Tags
69 } // namespace Elasticity
db::ComputeTag
Marks a DataBoxTag as being a compute item that executes a function.
Definition: Tag.hpp:109
domain::Tags::Coordinates< Dim, Frame::Inertial >
Tags.hpp
Elasticity
Items related to solving elasticity problems.
Definition: Equations.cpp:19
Elasticity::Tags::ConstitutiveRelationBase
Base tag for the constitutive relation.
Definition: Tags.hpp:13
cstddef
Scalar
Tensor< T, Symmetry<>, index_list<> > Scalar
Definition: TypeAliases.hpp:21
Elasticity::Tags::PotentialEnergyDensity
The energy density stored in the deformation of the elastic material.
Definition: Tags.hpp:74
Tensor.hpp
Elasticity::ConstitutiveRelations::ConstitutiveRelation
Base class for constitutive (stress-strain) relations that characterize the elastic properties of a m...
Definition: ConstitutiveRelation.hpp:52
Elasticity::Tags::PotentialEnergyDensityCompute
Computes the energy density stored in the deformation of the elastic material.
Definition: PotentialEnergy.hpp:52
gsl::not_null
Require a pointer to not be a nullptr
Definition: Gsl.hpp:183