Line data Source code
1 1 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : /// \file 5 : /// Defines functions logical_coordinates and interface_logical_coordinates 6 : 7 : #pragma once 8 : 9 : #include <cstddef> 10 : 11 : #include "DataStructures/DataBox/Tag.hpp" 12 : #include "DataStructures/Tensor/TypeAliases.hpp" 13 : #include "Utilities/TMPL.hpp" 14 : 15 : /// \cond 16 : namespace domain { 17 : namespace Tags { 18 : template<size_t Dim> 19 : struct Mesh; 20 : template <size_t, typename> 21 : struct Coordinates; // IWYU pragma: keep 22 : } // namespace Tags 23 : } // namespace domain 24 : 25 : template <size_t Dim> 26 : class Mesh; 27 : class DataVector; 28 : template <size_t Dim> 29 : class Direction; 30 : 31 : namespace gsl { 32 : template <typename> 33 : struct not_null; 34 : } // namespace gsl 35 : /// \endcond 36 : 37 : /// @{ 38 : /*! 39 : * \ingroup ComputationalDomainGroup 40 : * \brief Compute the logical coordinates in an Element. 41 : * 42 : * \details The logical coordinates are the collocation points associated to the 43 : * spectral basis functions and quadrature of the \p mesh. 44 : * 45 : * \example 46 : * \snippet Test_LogicalCoordinates.cpp logical_coordinates_example 47 : */ 48 : template <size_t VolumeDim> 49 1 : void logical_coordinates( 50 : gsl::not_null<tnsr::I<DataVector, VolumeDim, Frame::ElementLogical>*> 51 : logical_coords, 52 : const Mesh<VolumeDim>& mesh); 53 : 54 : template <size_t VolumeDim> 55 1 : tnsr::I<DataVector, VolumeDim, Frame::ElementLogical> logical_coordinates( 56 : const Mesh<VolumeDim>& mesh); 57 : /// @} 58 : 59 : namespace domain { 60 : namespace Tags { 61 : /// \ingroup DataBoxTagsGroup 62 : /// \ingroup ComputationalDomainGroup 63 : /// The logical coordinates in the Element 64 : template <size_t VolumeDim> 65 1 : struct LogicalCoordinates : Coordinates<VolumeDim, Frame::ElementLogical>, 66 : db::ComputeTag { 67 0 : using base = Coordinates<VolumeDim, Frame::ElementLogical>; 68 0 : using return_type = typename base::type; 69 0 : using argument_tags = tmpl::list<Mesh<VolumeDim>>; 70 0 : static constexpr auto function = static_cast<void (*)( 71 : gsl::not_null<return_type*>, const ::Mesh<VolumeDim>&)>( 72 : &logical_coordinates<VolumeDim>); 73 : }; 74 : } // namespace Tags 75 : } // namespace domain