1#ifndef DUNE_FEM_THREADITERATORSTORAGE_HH
2#define DUNE_FEM_THREADITERATORSTORAGE_HH
6#include <dune/common/exceptions.hh>
11#ifdef USE_SMP_PARALLEL
20 template <
class ThreadIterator >
28 typedef typename ThreadIteratorType :: FilterType
FilterType ;
33 static const PartitionIteratorType
pitype = ThreadIteratorType :: pitype ;
36 struct IteratorFactory
59 inline static ObjectType *createObject (
const KeyType &key )
61 return new ObjectType( key.
gridPart() );
64 inline static void deleteObject ( ObjectType *
object )
71 typedef typename IteratorFactory :: KeyType KeyType;
72 typedef SingletonList< KeyType,
76 std::unique_ptr< ThreadIteratorType, typename IteratorProviderType::Deleter>
iterators_;
Definition: bindguard.hh:11
Definition: domainfilter.hh:55
Thread iterators.
Definition: threaditerator.hh:22
int thread(const EntityType &entity) const
return thread number this entity belongs to
Definition: threaditerator.hh:242
IteratorType end() const
return end iterator for current thread
Definition: threaditerator.hh:210
void update()
update internal list of iterators
Definition: threaditerator.hh:88
void setMasterRatio(const double ratio)
set ratio between master thread and other threads in comp time
Definition: threaditerator.hh:251
IteratorType begin() const
return begin iterator for current thread
Definition: threaditerator.hh:191
const FilterType & filter(const unsigned int thread) const
return filter for given thread
Definition: threaditerator.hh:81
int index(const EntityType &entity) const
return thread number this entity belongs to
Definition: threaditerator.hh:229
Storage of thread iterators using domain decomposition.
Definition: threaditeratorstorage.hh:22
ThreadIteratorType & iterators() const
Definition: threaditeratorstorage.hh:86
static const PartitionIteratorType pitype
Definition: threaditeratorstorage.hh:33
void setMasterRatio(const double ratio)
set ratio between master thread and other threads in comp time
Definition: threaditeratorstorage.hh:101
int thread(const EntityType &entity) const
return thread number this entity belongs to
Definition: threaditeratorstorage.hh:125
IteratorType end() const
return end iterator for current thread
Definition: threaditeratorstorage.hh:113
int index(const EntityType &entity) const
return thread number this entity belongs to
Definition: threaditeratorstorage.hh:119
const FilterType & filter(const int thread) const
return filter for given thread
Definition: threaditeratorstorage.hh:89
ThreadIteratorType::FilterType FilterType
Definition: threaditeratorstorage.hh:28
ThreadIteratorType::IteratorType IteratorType
Definition: threaditeratorstorage.hh:29
void update()
update internal list of iterators
Definition: threaditeratorstorage.hh:95
std::unique_ptr< ThreadIteratorType, typename IteratorProviderType::Deleter > iterators_
Definition: threaditeratorstorage.hh:76
ThreadIteratorStorageBase(const GridPartType &gridPart)
contructor creating thread iterators
Definition: threaditeratorstorage.hh:80
IteratorType begin() const
return begin iterator for current thread
Definition: threaditeratorstorage.hh:107
IteratorType::Entity EntityType
Definition: threaditeratorstorage.hh:31
ThreadIterator ThreadIteratorType
Definition: threaditeratorstorage.hh:24
ThreadIterator::GridPartType GridPartType
Definition: threaditeratorstorage.hh:25
GridPartType::IndexSetType IndexSetType
Definition: threaditeratorstorage.hh:26
Definition: threaditeratorstorage.hh:39
const GridPartType & gridPart_
Definition: threaditeratorstorage.hh:40
bool operator==(const Key &other) const
Definition: threaditeratorstorage.hh:48
static const PartitionIteratorType ptype
Definition: threaditeratorstorage.hh:42
const GridPartType & gridPart() const
Definition: threaditeratorstorage.hh:53
const IndexSetType & indexSet_
Definition: threaditeratorstorage.hh:41
Key(const GridPartType &gridPart)
Definition: threaditeratorstorage.hh:43
Singleton list for key/object pairs.
Definition: singletonlist.hh:53