BentBeam.hpp
2 // See LICENSE.txt for details.
3
4 #pragma once
5
6 #include <limits>
7
8 #include "DataStructures/DataBox/Prefixes.hpp" // IWYU pragma: keep
9 #include "DataStructures/Tensor/Tensor.hpp" // IWYU pragma: keep
10 #include "Elliptic/Systems/Elasticity/Tags.hpp" // IWYU pragma: keep
11 #include "Options/Options.hpp"
12 #include "PointwiseFunctions/Elasticity/ConstitutiveRelations/IsotropicHomogeneous.hpp"
13 #include "PointwiseFunctions/Elasticity/ConstitutiveRelations/Tags.hpp" // IWYU pragma: keep
14 #include "Utilities/TMPL.hpp"
16
17 // IWYU pragma: no_forward_declare Tensor
18
19 /// \cond
20 class DataVector;
21 namespace PUP {
22 class er;
23 } // namespace PUP
24 /// \endcond
25
26 namespace Elasticity {
27 namespace Solutions {
28 /*!
29  * \brief A state of pure bending of an elastic beam in 2D
30  *
31  * \details This solution describes a 2D slice through an elastic beam of length
32  * \f$L\f$ and height \f$H\f$ that is subject to a bending moment \f$M=\int 33 * T^{xx}y\mathrm{d}y\f$ (see e.g. \cite ThorneBlandford2017, Eq. 11.41c for a
34  * bending moment in 1D). The beam material is characterized by an isotropic and
35  * homogeneous constitutive relation \f$Y^{ijkl}\f$ in the plane-stress
36  * approximation (see
37  * Elasticity::ConstitutiveRelations::IsotropicHomogeneous). In this scenario,
38  * no body-forces \f$f_\mathrm{ext}^j\f$ act on the material, so the
39  * \ref Elasticity equations reduce to \f$\nabla_i T^{ij}=0\f$, but the bending
40  * moment \f$M\f$ generates the stress
41  *
42  * \f[
43  * T^{xx} = \frac{12 M}{H^3} y \\
44  * T^{xy} = 0 = T^{yy} \text{.}
45  * \f]
46  *
47  * By fixing the rigid-body motions to
48  *
49  * \f[
50  * u^x(0,y)=0 \quad \text{and} \quad u^y\left(\pm \frac{L}{2},0\right)=0
51  * \f]
52  *
53  * we find that this stress is produced by the displacement field
54  *
55  * \f{align}
56  * u^x&=-\frac{12 M}{EH^3}xy \\
57  * u^y&=\frac{6 M}{EH^3}\left(x^2+\nu y^2-\frac{L^2}{4}\right)
58  * \f}
59  *
60  * in terms of the Young's modulus \f$E\f$ and the Poisson ration \f$\nu\f$ of
61  * the material.
62  */
63 class BentBeam {
64  public:
67
68  struct Length {
69  using type = double;
70  static constexpr OptionString help{"The beam length"};
71  static type lower_bound() noexcept { return 0.0; }
72  };
73  struct Height {
74  using type = double;
75  static constexpr OptionString help{"The beam height"};
76  static type lower_bound() noexcept { return 0.0; }
77  };
78  struct BendingMoment {
79  using type = double;
80  static constexpr OptionString help{
81  "The bending moment applied to the beam"};
82  static type lower_bound() noexcept { return 0.0; }
83  };
84
85  using options = tmpl::list<
88  static constexpr OptionString help{
89  "A 2D slice through an elastic beam which is subject to a bending "
90  "moment. The bending moment is applied along the length of the beam, "
91  "i.e. the x-axis, so that the beam's left and right ends are bent "
92  "towards the positive y-axis. It is measured in units of force."};
93
94  BentBeam() = default;
95  BentBeam(const BentBeam&) noexcept = delete;
96  BentBeam& operator=(const BentBeam&) noexcept = delete;
97  BentBeam(BentBeam&&) noexcept = default;
98  BentBeam& operator=(BentBeam&&) noexcept = default;
99  ~BentBeam() noexcept = default;
100
101  BentBeam(double length, double height, double bending_moment,
102  constitutive_relation_type constitutive_relation) noexcept;
103
104  const constitutive_relation_type& constitutive_relation() const noexcept {
105  return constitutive_relation_;
106  }
107
108  // @{
109  /// Retrieve variable at coordinates x
110  auto variables(const tnsr::I<DataVector, 2>& x,
111  tmpl::list<Tags::Displacement<2>> /*meta*/) const noexcept
113
114  auto variables(const tnsr::I<DataVector, 2>& x,
115  tmpl::list<Tags::Stress<2>> /*meta*/) const noexcept
117
118  auto variables(
119  const tnsr::I<DataVector, 2>& x,
120  tmpl::list<::Tags::Source<Tags::Displacement<2>>> /*meta*/) const noexcept
122
123  auto variables(const tnsr::I<DataVector, 2>& x,
124  tmpl::list<::Tags::Source<Tags::Stress<2>>> /*meta*/) const
126  // @}
127
128  /// Retrieve a collection of variables at coordinates x
129  template <typename... Tags>
130  tuples::TaggedTuple<Tags...> variables(const tnsr::I<DataVector, 2>& x,
131  tmpl::list<Tags...> /*meta*/) const
132  noexcept {
133  static_assert(sizeof...(Tags) > 1,
134  "The generic template will recurse infinitely if only one "
135  "tag is being retrieved.");
136  return {tuples::get<Tags>(variables(x, tmpl::list<Tags>{}))...};
137  }
138
139  // clang-tidy: no pass by reference
140  void pup(PUP::er& p) noexcept; // NOLINT
141
142  private:
143  friend bool operator==(const BentBeam& lhs, const BentBeam& rhs) noexcept;
144
147  double bending_moment_{std::numeric_limits<double>::signaling_NaN()};
148  constitutive_relation_type constitutive_relation_{};
149 };
150
151 bool operator!=(const BentBeam& lhs, const BentBeam& rhs) noexcept;
152
153 } // namespace Solutions
154 } // namespace Elasticity
Prefix indicating a source term.
Definition: Prefixes.hpp:66
Definition: Strahlkorper.hpp:14
Defines class tuples::TaggedTuple.
T signaling_NaN(T... args)
The material displacement field .
Definition: Tags.hpp:41
Defines classes and functions for making classes creatable from input files.
Define prefixes for DataBox tags.
Items related to solving elasticity problems.
Definition: Tags.hpp:34
const char *const OptionString
The string used in option structs.
Definition: Options.hpp:29
An associative container that is indexed by structs.
Definition: TaggedTuple.hpp:272
tuples::TaggedTuple< Tags... > variables(const tnsr::I< DataVector, 2 > &x, tmpl::list< Tags... >) const noexcept
Retrieve a collection of variables at coordinates x
Definition: BentBeam.hpp:130
Definition: BentBeam.hpp:68
A state of pure bending of an elastic beam in 2D.
Definition: BentBeam.hpp:63
Definition: DataBoxTag.hpp:29
Definition: BentBeam.hpp:73
Defines classes for Tensor.
Stores a collection of function values.
Definition: DataVector.hpp:42
Wraps the template metaprogramming library used (brigand)
The symmetric stress , describing pressure within the elastic material.
Definition: Tags.hpp:61