SpECTRE Documentation Coverage Report
 Current view: top level - Domain - SizeOfElement.hpp Hit Total Coverage Commit: 9f349d3c09e1c03107f00c2135ca40e209d3b84c Lines: 3 10 30.0 % Date: 2023-06-09 21:05:06 Legend: Lines: hit not hit
 ` Line data Source code` ``` 1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include 7 : #include 8 : #include 9 : #include 10 : #include 11 : 12 : #include "DataStructures/DataBox/Tag.hpp" 13 : #include "DataStructures/Tensor/TypeAliases.hpp" // IWYU pragma: keep 14 : #include "Domain/CoordinateMaps/Tags.hpp" 15 : #include "Domain/Tags.hpp" 16 : #include "Domain/TagsTimeDependent.hpp" 17 : #include "Time/Tags.hpp" 18 : #include "Utilities/TMPL.hpp" 19 : 20 : /// \cond 21 : namespace domain { 22 : template 23 : class CoordinateMapBase; 24 : namespace FunctionsOfTime { 25 : class FunctionOfTime; 26 : } // namespace FunctionsOfTime 27 : } // namespace domain 28 : template 29 : class ElementMap; 30 : namespace domain { 31 : namespace Tags { 32 : template 33 : struct ElementMap; 34 : } // namespace Tags 35 : } // namespace domain 36 : /// \endcond 37 : 38 : /// @{ 39 : /*! 40 : * \ingroup ComputationalDomainGroup 41 : * \brief Compute the inertial-coordinate size of an element along each of its 42 : * logical directions. 43 : * 44 : * For each logical direction, compute the distance (in inertial coordinates) 45 : * between the element's lower and upper faces in that logical direction. 46 : * The distance is measured between centers of the faces, with the centers 47 : * defined in the logical coordinates. 48 : * Note that for curved elements, this is an approximate measurement of size. 49 : * 50 : * \details 51 : * Because this quantity is defined in terms of specific coordinates, it is 52 : * not well represented by a `Tensor`, so we use a `std::array`. 53 : */ 54 : template 55 1 : std::array size_of_element( 56 : const ElementMap& logical_to_inertial_map); 57 : 58 : template 59 1 : std::array size_of_element( 60 : const ElementMap& logical_to_grid_map, 61 : const domain::CoordinateMapBase& 62 : grid_to_inertial_map, 63 : double time, 64 : const std::unordered_map< 65 : std::string, std::unique_ptr>& 66 : functions_of_time); 67 : /// @} 68 : 69 : namespace domain { 70 : namespace Tags { 71 : /// \ingroup DataBoxTagsGroup 72 : /// \ingroup ComputationalDomainGroup 73 : /// The inertial-coordinate size of an element along each of its logical 74 : /// directions. 75 : template 76 1 : struct SizeOfElement : db::SimpleTag { 77 0 : using type = std::array; 78 : }; 79 : 80 : template 81 0 : struct SizeOfElementCompute : db::ComputeTag, SizeOfElement { 82 0 : using base = SizeOfElement; 83 0 : using argument_tags = 84 : tmpl::list, 85 : CoordinateMaps::Tags::CoordinateMap, 87 : ::Tags::Time, domain::Tags::FunctionsOfTime>; 88 0 : using return_type = typename base::type; 89 : 90 0 : static constexpr void function( 91 : gsl::not_null*> result, 92 : const ::ElementMap& logical_to_grid_map, 93 : const domain::CoordinateMapBase& 94 : grid_to_inertial_map, 95 : const double time, 96 : const std::unordered_map< 97 : std::string, 98 : std::unique_ptr>& 99 : functions_of_time) { 100 : *result = size_of_element(logical_to_grid_map, grid_to_inertial_map, time, 101 : functions_of_time); 102 : } 103 : }; 104 : } // namespace Tags 105 : } // namespace domain ```

 Generated by: LCOV version 1.14