Equations.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/Elasticity/ConstitutiveRelations/Tags.hpp"
12 #include "Utilities/Gsl.hpp"
14 #include "Utilities/TMPL.hpp"
15 
16 /// \cond
17 class DataVector;
18 namespace PUP {
19 class er;
20 } // namespace PUP
21 namespace Elasticity {
22 namespace ConstitutiveRelations {
23 template <size_t Dim>
24 class ConstitutiveRelation;
25 } // namespace ConstitutiveRelations
26 } // namespace Elasticity
27 /// \endcond
28 
29 namespace Elasticity {
30 
31 /*!
32  * \brief Compute the fluxes \f$F^{ij}=Y^{ijkl}(x) S_{kl}(x)=-T^{ij}\f$ for
33  * the Elasticity equation.
34  */
35 template <size_t Dim>
36 void primal_fluxes(
37  gsl::not_null<tnsr::II<DataVector, Dim>*> flux_for_displacement,
38  const tnsr::ii<DataVector, Dim>& strain,
39  const ConstitutiveRelations::ConstitutiveRelation<Dim>&
40  constitutive_relation,
41  const tnsr::I<DataVector, Dim>& coordinates) noexcept;
42 
43 /*!
44  * \brief Add the contribution \f$-\Gamma^i_{ik}T^{kj} - \Gamma^j_{ik}T^{ik}\f$
45  * to the displacement source for the curved-space elasticity equations on a
46  * metric \f$\gamma_{ij}\f$.
47  *
48  * These sources arise from the non-principal part of the divergence on a
49  * curved background.
50  */
51 template <size_t Dim>
53  gsl::not_null<tnsr::I<DataVector, Dim>*> source_for_displacement,
54  const tnsr::Ijj<DataVector, Dim>& christoffel_second_kind,
55  const tnsr::i<DataVector, Dim>& christoffel_contracted,
56  const tnsr::II<DataVector, Dim>& stress) noexcept;
57 
58 /*!
59  * \brief Compute the fluxes \f$F^i_{jk}=\delta^{i}_{(j} \xi_{k)}\f$ for the
60  * auxiliary (strain) field in the first-order formulation of the Elasticity
61  * equation.
62  *
63  * \see Elasticity::FirstOrderSystem
64  */
65 template <size_t Dim>
66 void auxiliary_fluxes(
67  gsl::not_null<tnsr::Ijj<DataVector, Dim>*> flux_for_strain,
68  const tnsr::I<DataVector, Dim>& displacement) noexcept;
69 
70 /*!
71  * \brief Compute the fluxes \f$F^i_{jk}=\delta^{i}_{(j}\gamma_{k)l}\xi^l\f$
72  * for the auxiliary (strain) field in the first-order formulation of the
73  * curved-space elasticity equations on a metric \f$\gamma_{ij}\f$.
74  *
75  * \see Elasticity::FirstOrderSystem
76  */
77 template <size_t Dim>
79  gsl::not_null<tnsr::Ijj<DataVector, Dim>*> flux_for_strain,
80  const tnsr::ii<DataVector, Dim>& metric,
81  const tnsr::I<DataVector, Dim>& displacement) noexcept;
82 
83 /*!
84  * \brief Add the contribution \f$\Gamma_{ijk}\xi^i\f$ to the strain source for
85  * the curved-space elasticity equations on a metric \f$\gamma_{ij}\f$.
86  *
87  * These sources arise from the non-principal part of the divergence on a
88  * curved background.
89  */
90 template <size_t Dim>
92  gsl::not_null<tnsr::ii<DataVector, Dim>*> source_for_strain,
93  const tnsr::ijj<DataVector, Dim>& christoffel_first_kind,
94  const tnsr::I<DataVector, Dim>& displacement) noexcept;
95 
96 /*!
97  * \brief Compute the fluxes \f$F^i_A\f$ for the Elasticity equation on a flat
98  * metric in Cartesian coordinates.
99  *
100  * \see Elasticity::FirstOrderSystem
101  */
102 template <size_t Dim>
103 struct Fluxes {
104  using argument_tags =
105  tmpl::list<Tags::ConstitutiveRelation<Dim>,
107  using volume_tags = tmpl::list<Tags::ConstitutiveRelation<Dim>>;
108  static void apply(
109  gsl::not_null<tnsr::II<DataVector, Dim>*> flux_for_displacement,
111  constitutive_relation,
112  const tnsr::I<DataVector, Dim>& coordinates,
113  const tnsr::ii<DataVector, Dim>& strain) noexcept;
114  static void apply(gsl::not_null<tnsr::Ijj<DataVector, Dim>*> flux_for_strain,
116  constitutive_relation,
117  const tnsr::I<DataVector, Dim>& coordinates,
118  const tnsr::I<DataVector, Dim>& displacement) noexcept;
119  // clang-tidy: no runtime references
120  void pup(PUP::er& /*p*/) noexcept {} // NOLINT
121 };
122 
123 /*!
124  * \brief Add the sources \f$S_A\f$ for the Elasticity equation.
125  *
126  * \see Elasticity::FirstOrderSystem
127  */
128 template <size_t Dim>
129 struct Sources {
130  using argument_tags = tmpl::list<>;
131  static void apply(
132  gsl::not_null<tnsr::I<DataVector, Dim>*> equation_for_displacement,
133  const tnsr::I<DataVector, Dim>& displacement,
134  const tnsr::II<DataVector, Dim>& minus_stress) noexcept;
135  static void apply(
136  gsl::not_null<tnsr::ii<DataVector, Dim>*> equation_for_strain,
137  const tnsr::I<DataVector, Dim>& displacement) noexcept;
138 };
139 
140 } // namespace Elasticity
gr::christoffel_first_kind
void christoffel_first_kind(gsl::not_null< tnsr::abb< DataType, SpatialDim, Frame, Index > * > christoffel, const tnsr::abb< DataType, SpatialDim, Frame, Index > &d_metric) noexcept
Computes Christoffel symbol of the first kind from derivative of metric.
domain::Tags::Coordinates< Dim, Frame::Inertial >
Elasticity::Fluxes
Compute the fluxes for the Elasticity equation on a flat metric in Cartesian coordinates.
Definition: Equations.hpp:103
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
MakeWithValue.hpp
Elasticity::add_curved_auxiliary_sources
void add_curved_auxiliary_sources(gsl::not_null< tnsr::ii< DataVector, Dim > * > source_for_strain, const tnsr::ijj< DataVector, Dim > &christoffel_first_kind, const tnsr::I< DataVector, Dim > &displacement) noexcept
Add the contribution to the strain source for the curved-space elasticity equations on a metric .
DataVector
Stores a collection of function values.
Definition: DataVector.hpp:46
gr::christoffel_second_kind
void christoffel_second_kind(const gsl::not_null< tnsr::Abb< DataType, SpatialDim, Frame, Index > * > christoffel, const tnsr::abb< DataType, SpatialDim, Frame, Index > &d_metric, const tnsr::AA< DataType, SpatialDim, Frame, Index > &inverse_metric) noexcept
Computes Christoffel symbol of the second kind from derivative of metric and the inverse metric.
Elasticity::primal_fluxes
void primal_fluxes(gsl::not_null< tnsr::II< DataVector, Dim > * > flux_for_displacement, const tnsr::ii< DataVector, Dim > &strain, const ConstitutiveRelations::ConstitutiveRelation< Dim > &constitutive_relation, const tnsr::I< DataVector, Dim > &coordinates) noexcept
Compute the fluxes for the Elasticity equation.
Gsl.hpp
Elasticity::auxiliary_fluxes
void auxiliary_fluxes(gsl::not_null< tnsr::Ijj< DataVector, Dim > * > flux_for_strain, const tnsr::I< DataVector, Dim > &displacement) noexcept
Compute the fluxes for the auxiliary (strain) field in the first-order formulation of the Elasticity...
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::Sources
Add the sources for the Elasticity equation.
Definition: Equations.hpp:129
Elasticity::curved_auxiliary_fluxes
void curved_auxiliary_fluxes(gsl::not_null< tnsr::Ijj< DataVector, Dim > * > flux_for_strain, const tnsr::ii< DataVector, Dim > &metric, const tnsr::I< DataVector, Dim > &displacement) noexcept
Compute the fluxes for the auxiliary (strain) field in the first-order formulation of the curved-spa...
Elasticity::add_curved_sources
void add_curved_sources(gsl::not_null< tnsr::I< DataVector, Dim > * > source_for_displacement, const tnsr::Ijj< DataVector, Dim > &christoffel_second_kind, const tnsr::i< DataVector, Dim > &christoffel_contracted, const tnsr::II< DataVector, Dim > &stress) noexcept
Add the contribution to the displacement source for the curved-space elasticity equations on a metri...
TMPL.hpp
gsl::not_null
Require a pointer to not be a nullptr
Definition: ReadSpecPiecewisePolynomial.hpp:13