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 <limits> 8 : #include <pup.h> 9 : 10 : #include "DataStructures/Tensor/TypeAliases.hpp" 11 : #include "Options/Options.hpp" 12 : #include "Parallel/CharmPupable.hpp" 13 : #include "PointwiseFunctions/Elasticity/ConstitutiveRelations/ConstitutiveRelation.hpp" // IWYU pragma: keep 14 : #include "Utilities/TMPL.hpp" 15 : 16 : /// \cond 17 : class DataVector; 18 : /// \endcond 19 : 20 : namespace Elasticity::ConstitutiveRelations { 21 : 22 : /*! 23 : * \brief A cubic crystalline material 24 : * 25 : * \details For a cubic crystalline material the Elasticity tensor in the linear 26 : * constitutive relation \f$T^{ij}=-Y^{ijkl}S_{kl}\f$ reduces to 27 : * 28 : * \f[ 29 : * Y^{ijkl} = 30 : * \begin{cases} 31 : * c_{11} & \mathrm{for}\; i=j=k=l \\ 32 : * c_{12} & \mathrm{for}\; i=j,k=l,i \neq k \\ 33 : * c_{44} & \mathrm{for}\; i=k,j=l,i \neq j \;\mathrm{or}\; i=l,j=k,i\neq j \\ 34 : * \end{cases} 35 : * \f] 36 : * 37 : * with the three independent parameters: the \f$\mathrm{Lam\acute{e}}\f$ 38 : * parameter \f$\lambda\f$, the Shear modulus \f$\mu\f$ and the %Poisson 39 : * ratio \f$\nu\f$. In the parametrization chosen in this implementation we use 40 : * the experimental group parameters \f$c_{11}\f$, \f$c_{12}\f$ and 41 : * \f$c_{44}\f$, related by; 42 : * 43 : * \f[ 44 : * c_{11} = \frac{1 - \nu}{\nu} \lambda = \frac{(1 - \nu)E}{(1 + \nu)(1 - 45 : * 2\nu)}, \quad 46 : * c_{12} = \lambda = \frac{E\nu}{(1 + \nu)(1 - 2\nu)}, \quad 47 : * c_{44} = \mu 48 : * \f] 49 : * 50 : * and inversely; 51 : * 52 : * \f[ 53 : * E = \frac{(c_{11} + 2c_{12})(c_{11} - c_{12})}{c_{11} + c_{12}}, \quad 54 : * \nu = \left(1 + \frac{c_{11}}{c_{12}}\right)^{-1}, \quad 55 : * \mu = c_{44} 56 : * \f] 57 : * 58 : * The stress-strain relation then reduces to 59 : * 60 : * \f[ 61 : * T^{ij} = 62 : * \begin{cases} 63 : * -(c_{11} - c_{12}) S^{ij} - c_{12} \mathrm{Tr}(S) & \mathrm{for}\; i=j \\ 64 : * -2 c_{44} S^{ij} & \mathrm{for}\; i \neq j \\ 65 : * \end{cases} 66 : * \f] 67 : * 68 : * In the case where the shear modulus satisfies \f$c_{44} = 69 : * \frac{c_{11}-c_{12}}{2}\f$ the constitutive relation is that of an isotropic 70 : * material (see `Elasticity::ConstitutiveRelations::IsotropicHomogeneous`). 71 : */ 72 : 73 1 : class CubicCrystal : public ConstitutiveRelation<3> { 74 : public: 75 0 : static constexpr size_t volume_dim = 3; 76 : 77 0 : struct C_11 { 78 0 : using type = double; 79 0 : static constexpr Options::String help = { 80 : "c_11 parameter for a cubic crystal"}; 81 0 : static type lower_bound() noexcept { return 0.0; } 82 : }; 83 : 84 0 : struct C_12 { 85 0 : using type = double; 86 0 : static constexpr Options::String help = { 87 : "c_12 parameter for a cubic crystal"}; 88 0 : static type lower_bound() noexcept { return 0.0; } 89 : }; 90 : 91 0 : struct C_44 { 92 0 : using type = double; 93 0 : static constexpr Options::String help = { 94 : "c_44 parameter for a cubic crystal"}; 95 0 : static type lower_bound() noexcept { return 0.0; } 96 : }; 97 : 98 0 : using options = tmpl::list<C_11, C_12, C_44>; 99 : 100 0 : static constexpr Options::String help = { 101 : "A constitutive relation that describes a cubic, crystalline material in " 102 : "terms of the three independent group paremeters. The parameters " 103 : "are measured in units of stress, typically Pascals."}; 104 : 105 0 : CubicCrystal() = default; 106 0 : CubicCrystal(const CubicCrystal&) = default; 107 0 : CubicCrystal& operator=(const CubicCrystal&) = default; 108 0 : CubicCrystal(CubicCrystal&&) = default; 109 0 : CubicCrystal& operator=(CubicCrystal&&) = default; 110 0 : ~CubicCrystal() override = default; 111 : 112 0 : CubicCrystal(double c_11, double c_12, double c_44) noexcept; 113 : 114 : /// The constitutive relation that characterizes the elastic properties of a 115 : /// material 116 1 : void stress(gsl::not_null<tnsr::II<DataVector, 3>*> stress, 117 : const tnsr::ii<DataVector, 3>& strain, 118 : const tnsr::I<DataVector, 3>& x) const noexcept override; 119 : 120 : /// The 1st group parameter \f$c_{11} = \frac{1 - \nu}{\nu} \lambda\f$ 121 1 : double c_11() const noexcept; 122 : /// The 2nd group parameter; the \f$\mathrm{Lam\acute{e}}\f$ parameter 123 : /// \f$c_{12} = \lambda\f$ 124 1 : double c_12() const noexcept; 125 : /// The 3rd group parameter; the shear modulus (rigidity) \f$c_{44} = \mu\f$ 126 1 : double c_44() const noexcept; 127 : /// The Young's modulus \f$E\f$ 128 1 : double youngs_modulus() const noexcept; 129 : /// The %Poisson ratio \f$\nu\f$ 130 1 : double poisson_ratio() const noexcept; 131 : 132 : // clang-tidy: no runtime references 133 0 : void pup(PUP::er& /*p*/) noexcept override; // NOLINT 134 : 135 0 : explicit CubicCrystal(CkMigrateMessage* /*unused*/) noexcept {} 136 : 137 0 : WRAPPED_PUPable_decl_base_template( // NOLINT 138 : SINGLE_ARG(ConstitutiveRelation<3>), CubicCrystal); 139 : 140 : private: 141 0 : double c_11_ = std::numeric_limits<double>::signaling_NaN(); 142 0 : double c_12_ = std::numeric_limits<double>::signaling_NaN(); 143 0 : double c_44_ = std::numeric_limits<double>::signaling_NaN(); 144 : }; // namespace ConstitutiveRelations 145 : 146 : bool operator==(const CubicCrystal& lhs, const CubicCrystal& rhs) noexcept; 147 : bool operator!=(const CubicCrystal& lhs, const CubicCrystal& rhs) noexcept; 148 : 149 : } // namespace Elasticity::ConstitutiveRelations