SPH
Classes | Functions
Iterate.h File Reference

Functions for iterating over individual quantities in Storage. More...

#include "objects/utility/IteratorAdapters.h"
#include "quantities/Quantity.h"
#include "quantities/Storage.h"

Go to the source code of this file.

Classes

struct  StorageVisitor< VisitorEnum::ALL_VALUES >
 Iterator over all quantities, executes given functor with buffer of quantity values. More...
 
struct  StoragePairVisitor< VisitorEnum::ALL_VALUES >
 
struct  StorageVisitor< VisitorEnum::ALL_BUFFERS >
 Iterator over all buffers. More...
 
struct  StoragePairVisitor< VisitorEnum::ALL_BUFFERS >
 
struct  StorageVisitor< VisitorEnum::ZERO_ORDER >
 Iterator over all zero-order quantities. More...
 
struct  StoragePairVisitor< VisitorEnum::ZERO_ORDER >
 
struct  StorageVisitor< VisitorEnum::FIRST_ORDER >
 Iterator over all first-order quantities. More...
 
struct  StoragePairVisitor< VisitorEnum::FIRST_ORDER >
 
struct  StorageVisitor< VisitorEnum::SECOND_ORDER >
 
struct  StoragePairVisitor< VisitorEnum::SECOND_ORDER >
 
struct  StorageVisitor< VisitorEnum::HIGHEST_DERIVATIVES >
 Iterator over all highest-order derivatives of quantities. More...
 
struct  StoragePairVisitor< VisitorEnum::HIGHEST_DERIVATIVES >
 
struct  StorageVisitorWithPositions
 

Functions

template<VisitorEnum Type, typename TFunctor >
void iterate (Storage &storage, TFunctor &&functor)
 Iterate over given type of quantities and executes functor for each. More...
 
template<VisitorEnum Type, typename TFunctor >
void iterate (const Storage &storage, TFunctor &&functor)
 
template<typename TFunctor >
void iterateWithPositions (Storage &storage, TFunctor &&functor)
 Iterate over all quantities and execute a functor, passing quantity buffers together with particle positions as arguments. More...
 
template<VisitorEnum Type, typename TFunctor >
void iteratePair (Storage &storage1, Storage &storage2, TFunctor &&functor)
 Iterate over given type of quantities in two storage views and executes functor for each pair. More...
 
template<VisitorEnum Type, typename TFunctor >
void iteratePair (const Storage &storage1, const Storage &storage2, TFunctor &&functor)
 

Detailed Description

Functions for iterating over individual quantities in Storage.

Author
Pavel Sevecek
Date
2016-2021

Definition in file Iterate.h.

Function Documentation

◆ iterate() [1/2]

template<VisitorEnum Type, typename TFunctor >
void iterate ( const Storage storage,
TFunctor &&  functor 
)

Definition at line 275 of file Iterate.h.

◆ iterate() [2/2]

template<VisitorEnum Type, typename TFunctor >
void iterate ( Storage storage,
TFunctor &&  functor 
)

Iterate over given type of quantities and executes functor for each.

The functor is used for scalars, vectors and tensors, so it must be a generic lambda or a class with overloaded operator() for each value type.

Template Parameters
TypeSubset of visited quantities, also defines parameters of the functor, see VisitorEnum.
Parameters
storageStorage containing visited quantities
functorFunctor executed for every quantity or buffer matching the specified criterion

Definition at line 266 of file Iterate.h.

◆ iteratePair() [1/2]

template<VisitorEnum Type, typename TFunctor >
void iteratePair ( const Storage storage1,
const Storage storage2,
TFunctor &&  functor 
)

Definition at line 337 of file Iterate.h.

◆ iteratePair() [2/2]

template<VisitorEnum Type, typename TFunctor >
void iteratePair ( Storage storage1,
Storage storage2,
TFunctor &&  functor 
)

Iterate over given type of quantities in two storage views and executes functor for each pair.

Definition at line 316 of file Iterate.h.

◆ iterateWithPositions()

template<typename TFunctor >
void iterateWithPositions ( Storage storage,
TFunctor &&  functor 
)

Iterate over all quantities and execute a functor, passing quantity buffers together with particle positions as arguments.

Storage must already contain positions, checked by assert.

Definition at line 306 of file Iterate.h.