Line data Source code
1 0 : // Distributed under the MIT License.
2 : // See LICENSE.txt for details.
3 :
4 : #pragma once
5 :
6 : #include <cstdint>
7 : #include <iosfwd>
8 :
9 : namespace evolution::dg {
10 : /// \brief Label for a neighboring Element (or Block) that determines how
11 : /// information is exchanged between neighboring Elements
12 : ///
13 : /// \details The specific label is determined by the relationship between the
14 : /// block logical coordinates of the neighboring Elements (Blocks) for the
15 : /// points on the interface between them. In two cases there is a simple
16 : /// relationship between the coordinates:
17 : /// - CopyProject: in this case the block logical coordinates are identical.
18 : /// Therefore a DataVector can be either copied (if the Mesh on each side of
19 : /// the interface are at the same points) or projected to the Mesh of the
20 : /// neighbor.
21 : /// - OrientCopyProject: in this case the block logical coordinates are related
22 : /// by a discrete rotation (represented by an OrientationMap). Therefore a
23 : /// DataVector can be reoriented (with the OrientationMap), and then either
24 : /// copied or projected to the Mesh of the neighbor.
25 : ///
26 : /// In the following cases, there is no simple relationship between the block
27 : /// logical coordinates. Therefore a DataVector must be interpolated to the
28 : /// points of the neighboring Mesh. The cases differ in which Element does the
29 : /// interpolation:
30 : /// - NonconformingBothInterpolate: in this case both the Element and its
31 : /// neighbor interpolate data to the grid points of each others Mesh.
32 : /// - NonconformingSelfInterpolates: in this case the Element will receive the
33 : /// neighbor's boundary data and will interpolate it to the Mesh of the
34 : /// Element. The Element will then need to send boundary correction data to
35 : /// the neighbor.
36 : /// - NonconformingNeighborInterpolates: in this case the Element send its
37 : /// boundary data to the neighbor who will then interpolate it to its own
38 : /// Mesh. The neighbor will need to send boundary correction data back to the
39 : /// Element.
40 : ///
41 : /// The Element and its neighbor will need to use consistent values of this
42 : /// enum:
43 : /// - In the cases CopyProject, OrientCopyProject, and
44 : /// NonconformingBothInterpolate, neighboring elements should agree on the
45 : /// values.
46 : /// - For NonconformingSelfInterpolates and NonconformingNeighborInterpolates
47 : /// neighboring elements should have different values. These cases should be
48 : /// used when one Element has many neighboring Elements (e.g. when a single
49 : /// spherical shell abuts a cubes sphere). In this case it should be more
50 : /// efficient for the single element to send its boundary data to its
51 : /// neighbors which then do the interpolation to their meshes.
52 1 : enum class InterfaceDataPolicy : uint8_t {
53 : /// default value is uninitialized
54 : Uninitialized = 0,
55 : /// Boundary data can be copied or projected to Mesh of neighbor
56 : CopyProject = 1,
57 : /// Boundary data should be reoriented, and then copied or projected to Mesh
58 : /// of neighbor
59 : OrientCopyProject = 2,
60 : /// Boundary data should be interpolated to Mesh of neighbor
61 : NonconformingBothInterpolate = 3,
62 : /// Neighbor will send boundary data to be interpolated onto the Mesh of this
63 : /// Element. Boundary correction data will then need to be sent to the
64 : /// neighbor.
65 : NonconformingSelfInterpolates = 4,
66 : /// Boundary data should be sent to the neighbor, who will interpolate the
67 : /// data to its own Mesh. The neighbor will send boundary correction data
68 : /// back.
69 : NonconformingNeighborInterpolates = 5
70 : };
71 :
72 : /// Output operator for a InterfaceDataPolicy.
73 1 : std::ostream& operator<<(std::ostream& os, InterfaceDataPolicy value);
74 : } // namespace evolution::dg
|