Go to the documentation of this file.
21 #ifndef THUNDEREGG_GMG_DRCTINTP_H
22 #define THUNDEREGG_GMG_DRCTINTP_H
61 const std::vector<std::pair<
int, std::reference_wrapper<
const PatchInfo<D>>>>& patches,
65 for (
auto pair : patches) {
72 std::array<int, D> starts;
73 for (
size_t i = 0; i < D; i++) {
74 starts[i] = orth.isLowerOnAxis(i) ? 0 : (coarse_view.
getEnd()[i] + 1);
77 Loop::OverInteriorIndexes<D + 1>(fine_view, [&](
const std::array<int, D + 1>& coord) {
78 std::array<int, D + 1> coarse_coord;
79 for (
size_t x = 0; x < D; x++) {
80 coarse_coord[x] = (coord[x] + starts[x]) / 2;
82 coarse_coord[D] = coord[D];
83 fine_view[coord] += coarse_view[coarse_coord];
86 Loop::OverInteriorIndexes<D + 1>(fine_view, [&](
const std::array<int, D + 1>& coord) {
87 fine_view[coord] += coarse_view[coord];
93 extern template class DirectInterpolator<2>;
94 extern template class DirectInterpolator<3>;
An enum-style class that represents the octants of a cube.
Definition: Orthant.h:43
Orthant< D > orth_on_parent
The orthant of the parent that this parent resides on.
Definition: PatchInfo.h:113
DirectInterpolator< D > * clone() const override
Clone this interpolator.
Definition: DirectInterpolator.h:59
Uses a collection of PatchInfo objects to represent the domain of the problem.
Definition: Domain.h:50
int local_index
The local index of the patch in the Domain.
Definition: PatchInfo.h:69
DirectInterpolator(const Domain< D > &coarse_domain, const Domain< D > &fine_domain)
Create new DirectInterpolator object.
Definition: DirectInterpolator.h:51
View for accessing data of a patch. It supports variable striding.
Definition: PatchView.h:37
void interpolatePatches(const std::vector< std::pair< int, std::reference_wrapper< const PatchInfo< D >>>> &patches, const Vector< D > &coarser_vector, Vector< D > &finer_vector) const override
Interpolate values from coarse vector to the finer vector.
Definition: DirectInterpolator.h:60
const std::array< int, D > & getEnd() const
Get the coordinate of the last element.
Definition: View.h:211
Contains metadata for a patch.
Definition: PatchInfo.h:51
Directly places values from coarse cell into the corresponding fine cells.
Definition: DirectInterpolator.h:41
Base class that makes the necessary mpi calls, derived classes only have to implement interpolatePatc...
Definition: MPIInterpolator.h:38
PatchView< double, D > getPatchView(int patch_local_index)
Get the View objects for the specified patch index of View object will correspond to component index.
Definition: Vector.h:358
Vector class for use in thunderegg.
Definition: Vector.h:42
Geometric-Multigrid classes.
Definition: Cycle.h:33
bool hasCoarseParent() const
Return whether the patch has a coarser parent.
Definition: PatchInfo.h:303