MinimumGridSpacing.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 #include <string>
8 
11 #include "Domain/Tags.hpp" // IWYU pragma: keep
12 #include "Utilities/TMPL.hpp"
13 
14 /// \cond
15 class DataVector;
16 template <size_t Dim>
17 class Index;
18 template <size_t Dim>
19 class Mesh;
20 /// \endcond
21 
22 /// \ingroup ComputationalDomainGroup
23 /// Finds the minimum coordinate distance between grid points.
24 template <size_t Dim, typename Frame>
26  const Index<Dim>& extents,
27  const tnsr::I<DataVector, Dim, Frame>& coords) noexcept;
28 
29 namespace Tags {
30 /// \ingroup ComputationalDomainGroup
31 /// \ingroup DataBoxTagsGroup
32 /// The minimum coordinate distance between grid points.
33 template <size_t Dim, typename Frame>
35  static std::string name() noexcept { return "MinimumGridSpacing"; }
36  static auto function(
37  const ::Mesh<Dim>& mesh,
38  const tnsr::I<DataVector, Dim, Frame>& coordinates) noexcept {
39  return minimum_grid_spacing(mesh.extents(), coordinates);
40  }
41  using argument_tags = tmpl::list<Mesh<Dim>, Coordinates<Dim, Frame>>;
42 };
43 } // namespace Tags
double minimum_grid_spacing(const Index< Dim > &extents, const tnsr::I< DataVector, Dim, Frame > &coords) noexcept
Finds the minimum coordinate distance between grid points.
Definition: MinimumGridSpacing.cpp:33
Marks a DataBoxTag as being a compute item that executes a function.
Definition: DataBoxTag.hpp:155
Holds the number of grid points, basis, and quadrature in each direction of the computational grid...
Definition: Mesh.hpp:49
The minimum coordinate distance between grid points.
Definition: MinimumGridSpacing.hpp:34
Definition: DataBoxTag.hpp:29
Defines a list of useful type aliases for tensors.
The coordinates in a given frame.
Definition: Tags.hpp:95
const Index< Dim > & extents() const noexcept
The number of grid points in each dimension of the grid.
Definition: Mesh.hpp:107
Stores a collection of function values.
Definition: DataVector.hpp:46
Wraps the template metaprogramming library used (brigand)
An integer multi-index.
Definition: Index.hpp:28
Defines tags related to domain quantities.
Defines classes SimpleTag, PrefixTag, ComputeTag and several functions for retrieving tag info...