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 : 8 : #include "DataStructures/DataBox/Tag.hpp" 9 : #include "PointwiseFunctions/Elasticity/ConstitutiveRelations/ConstitutiveRelation.hpp" 10 : 11 : namespace Elasticity { 12 : namespace Tags { 13 : 14 : /*! 15 : * \brief The elastic material's constitutive relation. 16 : * 17 : * \see `Elasticity::ConstitutiveRelations::ConstitutiveRelation` 18 : */ 19 : template <size_t Dim> 20 1 : struct ConstitutiveRelation : db::SimpleTag { 21 0 : using type = 22 : std::unique_ptr<ConstitutiveRelations::ConstitutiveRelation<Dim>>; 23 : }; 24 : 25 : /*! 26 : * \brief Reference the constitutive relation provided by the `ProviderTag` 27 : * 28 : * \see `Elasticity::Tags::ConstitutiveRelation` 29 : */ 30 : template <size_t Dim, typename ProviderTag> 31 : struct ConstitutiveRelationReference : ConstitutiveRelation<Dim>, 32 1 : db::ReferenceTag { 33 0 : using base = ConstitutiveRelation<Dim>; 34 0 : using parent_tag = ProviderTag; 35 0 : using argument_tags = tmpl::list<ProviderTag>; 36 : template <typename Provider> 37 0 : static const ConstitutiveRelations::ConstitutiveRelation<Dim>& get( 38 : const Provider& provider) noexcept { 39 : return provider.constitutive_relation(); 40 : } 41 : }; 42 : 43 : } // namespace Tags 44 : } // namespace Elasticity