1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
4 #pragma once
6 #include <cstddef>
7 #include <vector>
11 /// \cond
12 namespace domain {
13 class BlockId;
14 } // namespace domain
15 class DataVector;
16 template <size_t VolumeDim, typename TargetFrame>
17 class Domain;
18 template <typename IdType, typename DataType>
19 class IdPair;
20 /// \endcond
22 /// \ingroup ComputationalDomainGroup
23 ///
24 /// Computes the block logical coordinates and the containing `BlockId`
25 /// of a set of points, given coordinates in the `Frame` frame.
26 ///
27 /// \details Returns a std::vector<IdPair<BlockId,coords>>, where the
28 /// vector runs over the points and is indexed in the same order as
29 /// the input coordinates `x`. For each point, the `IdPair` holds the
30 /// block logical coords of that point and the `BlockId` of the `Block` that
31 /// contains that point.
32 /// If a point is on a shared boundary of two or more `Block`s, it is
33 /// returned only once, and is considered to belong to the `Block`
34 /// with the smaller `BlockId`.
35 template <size_t Dim, typename Frame>
38  const tnsr::I<DataVector, Dim, Frame>& x) noexcept
40  tnsr::I<double, Dim, typename ::Frame::Logical>>>;
A data structure that contains an ID and data associated with that ID.
Definition: IdPair.hpp:16
Index a block of the computational domain.
Definition: BlockId.hpp:21
Definition: BlockId.hpp:16
auto block_logical_coordinates(const Domain< Dim, Frame > &domain, const tnsr::I< DataVector, Dim, Frame > &x) noexcept -> std::vector< IdPair< domain::BlockId, tnsr::I< double, Dim, typename ::Frame::Logical >>>
Computes the block logical coordinates and the containing BlockId of a set of points, given coordinates in the Frame frame.
Definition: BlockLogicalCoordinates.cpp:25
Defines a list of useful type aliases for tensors.
A wrapper around a vector of Blocks that represent the computational domain.
Definition: Domain.hpp:38
Stores a collection of function values.
Definition: DataVector.hpp:46