Finite Volume Solver  prototype
A framework to build finite volume solvers for the AG Klein at the Freie Universität Berlin.
For Each Loops

This group contains all functions that help to iterate over some range. More...

template<typename Extents , typename Function >
Function fub::ForEachIndex (const layout_left::mapping< Extents > &mapping, Function function)
 Iterate through the multi-dimensional index space descibed by mapping and invoke function for each such indices. More...
 
template<typename Extents , typename Function >
Function fub::ForEachIndex (const layout_stride::mapping< Extents > &mapping, Function function)
 Iterate through the multi-dimensional index space descibed by mapping and invoke function for each such indices. More...
 
template<typename Tag , typename F >
void fub::amrex::ForEachFab (Tag, const ::amrex::FabArrayBase &fabarray, F function)
 Iterate through all local FArrayBox objects in a MultiFab. More...
 
template<typename Tag , typename F >
void fub::amrex::ForEachFab (Tag, const ::amrex::BoxArray &ba, const ::amrex::DistributionMapping &dm, F function)
 Iterate through all local FArrayBox objects in a MultiFab. More...
 
template<typename F >
void fub::amrex::ForEachFab (execution::OpenMpTag, const ::amrex::FabArrayBase &fabarray, F function)
 Iterate through all local FArrayBox objects in a MultiFab. More...
 
template<typename F >
void fub::amrex::ForEachFab (execution::OpenMpTag, const ::amrex::BoxArray &ba, const ::amrex::DistributionMapping &dm, F function)
 Iterate through all local FArrayBox objects in a MultiFab. More...
 
template<typename F >
void fub::amrex::ForEachFab (execution::OpenMpSimdTag, const ::amrex::FabArrayBase &fabarray, F function)
 Iterate through all local FArrayBox objects in a MultiFab. More...
 
template<typename F >
void fub::amrex::ForEachFab (const ::amrex::FabArrayBase &fabarray, F function)
 Iterate through all local FArrayBox objects in a MultiFab. More...
 
template<typename F >
void fub::amrex::ForEachFab (execution::OpenMpSimdTag, const ::amrex::BoxArray &ba, const ::amrex::DistributionMapping &dm, F function)
 Iterate through all local FArrayBox objects in a MultiFab. More...
 
template<typename F >
void fub::amrex::ForEachFab (const ::amrex::BoxArray &ba, const ::amrex::DistributionMapping &dm, F function)
 Iterate through all local FArrayBox objects in a MultiFab. More...
 

Detailed Description

This group contains all functions that help to iterate over some range.

Function Documentation

◆ ForEachFab() [1/8]

template<typename F >
void fub::amrex::ForEachFab ( const ::amrex::BoxArray &  ba,
const ::amrex::DistributionMapping &  dm,
function 
)

#include <ForEachFab.hpp>

Iterate through all local FArrayBox objects in a MultiFab.

◆ ForEachFab() [2/8]

template<typename F >
void fub::amrex::ForEachFab ( const ::amrex::FabArrayBase &  fabarray,
function 
)

#include <ForEachFab.hpp>

Iterate through all local FArrayBox objects in a MultiFab.

◆ ForEachFab() [3/8]

template<typename F >
void fub::amrex::ForEachFab ( execution::OpenMpSimdTag  ,
const ::amrex::BoxArray &  ba,
const ::amrex::DistributionMapping &  dm,
function 
)

#include <ForEachFab.hpp>

Iterate through all local FArrayBox objects in a MultiFab.

◆ ForEachFab() [4/8]

template<typename F >
void fub::amrex::ForEachFab ( execution::OpenMpSimdTag  ,
const ::amrex::FabArrayBase &  fabarray,
function 
)

#include <ForEachFab.hpp>

Iterate through all local FArrayBox objects in a MultiFab.

◆ ForEachFab() [5/8]

template<typename F >
void fub::amrex::ForEachFab ( execution::OpenMpTag  ,
const ::amrex::BoxArray &  ba,
const ::amrex::DistributionMapping &  dm,
function 
)

#include <ForEachFab.hpp>

Iterate through all local FArrayBox objects in a MultiFab.

◆ ForEachFab() [6/8]

template<typename F >
void fub::amrex::ForEachFab ( execution::OpenMpTag  ,
const ::amrex::FabArrayBase &  fabarray,
function 
)

#include <ForEachFab.hpp>

Iterate through all local FArrayBox objects in a MultiFab.

◆ ForEachFab() [7/8]

template<typename Tag , typename F >
void fub::amrex::ForEachFab ( Tag  ,
const ::amrex::BoxArray &  ba,
const ::amrex::DistributionMapping &  dm,
function 
)

#include <ForEachFab.hpp>

Iterate through all local FArrayBox objects in a MultiFab.

◆ ForEachFab() [8/8]

template<typename Tag , typename F >
void fub::amrex::ForEachFab ( Tag  ,
const ::amrex::FabArrayBase &  fabarray,
function 
)

#include <ForEachFab.hpp>

Iterate through all local FArrayBox objects in a MultiFab.

◆ ForEachIndex() [1/2]

template<typename Extents , typename Function >
Function fub::ForEachIndex ( const layout_left::mapping< Extents > &  mapping,
Function  function 
)

#include <ForEach.hpp>

Iterate through the multi-dimensional index space descibed by mapping and invoke function for each such indices.

Parameters
[in]mappingDescribes how a multi dimensional index is mapped into a linear space.
[in]functionThe callback object which is being invoked by this function.
Returns
Returns the callback function obect.

The following example shows how to use this function.

// Invoke a function in two one-dimensional index space
mdspan<double, 2> array;
ForEachIndex(array.mapping(), [&](int i, int j) {
std::cout << fmt::format("array({}, {}) = {}\n", i, j, array(i, j));
});
// Invoke a function in three one-dimensional index space
mdspan<double, 3> array;
ForEachIndex(array.mapping(), [](int i, int j, int k) {
std::cout << fmt::format("array({}, {}, {}) = \n", i, j, k, array(i, j,
k));
});
// Invoke a function where dimension is generic
mdspan<double, Rank> array;
ForEachIndex(array.mapping(), [](auto... is) {
std::array<int, Rank> index{is...};
std::cout << fmt::format("array({}) = \n", index, array(index));
});
Function ForEachIndex(const layout_left::mapping< Extents > &mapping, Function function)
Iterate through the multi-dimensional index space descibed by mapping and invoke function for each su...
Definition: ForEach.hpp:74
std::ptrdiff_t index
Definition: type_traits.hpp:179

◆ ForEachIndex() [2/2]

template<typename Extents , typename Function >
Function fub::ForEachIndex ( const layout_stride::mapping< Extents > &  mapping,
Function  function 
)

#include <ForEach.hpp>

Iterate through the multi-dimensional index space descibed by mapping and invoke function for each such indices.

Parameters
[in]mappingDescribes how a multi dimensional index is mapped into a linear space.
[in]functionThe callback object which is being invoked by this function.
Returns
Returns the callback function obect.

The following example shows how to use this function.

// Invoke a function in two one-dimensional index space
mdspan<double, 2> array;
ForEachIndex(array.mapping(), [&](int i, int j) {
std::cout << fmt::format("array({}, {}) = {}\n", i, j, array(i, j));
});
// Invoke a function in three one-dimensional index space
mdspan<double, 3> array;
ForEachIndex(array.mapping(), [](int i, int j, int k) {
std::cout << fmt::format("array({}, {}, {}) = \n", i, j, k, array(i, j,
k));
});
// Invoke a function where dimension is generic
mdspan<double, Rank> array;
ForEachIndex(array.mapping(), [](auto... is) {
std::array<int, Rank> index{is...};
std::cout << fmt::format("array({}) = \n", index, array(index));
});