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>
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>
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
Mark a struct as a compute tag by inheriting from this.
Definition: Tag.hpp:157
domain::Tags::Coordinates< Dim, Frame::Inertial >
Elasticity::strain
void strain(gsl::not_null< tnsr::ii< DataType, Dim > * > strain, const tnsr::iJ< DataType, Dim > &deriv_displacement) noexcept
The symmetric strain on a flat background in Cartesian coordinates.
Tags.hpp
Elasticity
Items related to solving elasticity problems.
Definition: LaserBeam.hpp:25
cstddef
Elasticity::potential_energy_density
void potential_energy_density(gsl::not_null< Scalar< DataVector > * > potential_energy_density, const tnsr::ii< DataVector, Dim > &strain, const tnsr::I< DataVector, Dim > &coordinates, const ConstitutiveRelations::ConstitutiveRelation< Dim > &constitutive_relation) noexcept
The potential energy density stored in the deformation of the elastic material (see Eq....
Elasticity::Tags::ConstitutiveRelation
The elastic material's constitutive relation.
Definition: Tags.hpp:20
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:75
Tensor.hpp
Elasticity::ConstitutiveRelations::ConstitutiveRelation
Base class for constitutive (stress-strain) relations that characterize the elastic properties of a m...
Definition: ConstitutiveRelation.hpp:56
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: ReadSpecThirdOrderPiecewisePolynomial.hpp:13