1 #ifndef DUNE_FEM_THREADITERATORSTORAGE_HH 2 #define DUNE_FEM_THREADITERATORSTORAGE_HH 6 #include <dune/common/exceptions.hh> 13 #ifdef USE_SMP_PARALLEL 22 template <
class ThreadIterator >
38 struct IteratorFactory
46 : gridPart_( gridPart ),
47 indexSet_( gridPart_.indexSet() )
53 return (&indexSet_) == (& other.
indexSet_ ) && ( ptype == other.
ptype );
61 inline static ObjectType *createObject (
const KeyType &key )
63 return new ObjectType( key.
gridPart() );
66 inline static void deleteObject ( ObjectType *
object )
83 : iterators_( IteratorProviderType::getObject( KeyType( gridPart ) ) )
97 return iterators_.filter( thread );
115 return iterators_.
begin();
121 return iterators_.
end();
125 int index(
const EntityType& entity )
const 127 return iterators_.
index( entity );
131 int thread(
const EntityType& entity )
const 133 return iterators_.
thread( entity );
139 #endif // #ifndef DUNE_FEM_DG_DOMAINTHREADITERATOR_HH
int thread(const EntityType &entity) const
return thread number this entity belongs to
Definition: threaditerator.hh:227
ThreadIteratorType::FilterType FilterType
Definition: threaditeratorstorage.hh:30
GridPartType::IndexSetType IndexSetType
Definition: threaditeratorstorage.hh:28
const FilterType & filter(const int thread) const
return filter for given thread
Definition: threaditeratorstorage.hh:95
IteratorType end() const
return end iterator for current thread
Definition: threaditeratorstorage.hh:119
Thread iterators.
Definition: threaditerator.hh:22
int index(const EntityType &entity) const
return thread number this entity belongs to
Definition: threaditerator.hh:221
static const PartitionIteratorType pitype
Definition: threaditerator.hh:28
void update()
update internal list of iterators
Definition: threaditeratorstorage.hh:101
ThreadIteratorType & iterators_
Definition: threaditeratorstorage.hh:78
ThreadIterator::GridPartType GridPartType
Definition: threaditeratorstorage.hh:27
ThreadIteratorType::IteratorType IteratorType
Definition: threaditeratorstorage.hh:31
IteratorType begin() const
return begin iterator for current thread
Definition: threaditeratorstorage.hh:113
Singleton list for key/object pairs.
Definition: singletonlist.hh:49
static const PartitionIteratorType ptype
Definition: threaditeratorstorage.hh:44
IteratorType end() const
return end iterator for current thread
Definition: threaditerator.hh:211
bool operator==(const Key &other) const
Definition: threaditeratorstorage.hh:50
IteratorType::Entity EntityType
Definition: threaditeratorstorage.hh:33
static const PartitionIteratorType pitype
Definition: threaditeratorstorage.hh:35
ThreadIteratorStorageBase(const GridPartType &gridPart)
contructor creating thread iterators
Definition: threaditeratorstorage.hh:82
int index(const EntityType &entity) const
return thread number this entity belongs to
Definition: threaditeratorstorage.hh:125
int thread(const EntityType &entity) const
return thread number this entity belongs to
Definition: threaditeratorstorage.hh:131
Definition: threaditeratorstorage.hh:40
Definition: coordinate.hh:4
IteratorType begin() const
return begin iterator for current thread
Definition: threaditerator.hh:201
Storage of thread iterators using domain decomposition.
Definition: threaditeratorstorage.hh:23
static void removeObject(const ObjectType &object)
Definition: singletonlist.hh:114
~ThreadIteratorStorageBase()
destructor removing instance of thread iterators
Definition: threaditeratorstorage.hh:89
void update()
update internal list of iterators
Definition: threaditerator.hh:102
GridPartType::template Codim< 0 >::template Partition< pitype >::IteratorType IteratorType
Definition: threaditerator.hh:32
const GridPartType & gridPart_
Definition: threaditeratorstorage.hh:42
Key(const GridPartType &gridPart)
Definition: threaditeratorstorage.hh:45
ThreadIterator ThreadIteratorType
Definition: threaditeratorstorage.hh:26
Definition: threadfilter.hh:20
void setMasterRatio(const double ratio)
set ratio between master thread and other threads in comp time
Definition: threaditerator.hh:240
const GridPartType & gridPart() const
Definition: threaditeratorstorage.hh:55
const IndexSetType & indexSet_
Definition: threaditeratorstorage.hh:43
void setMasterRatio(const double ratio)
set ratio between master thread and other threads in comp time
Definition: threaditeratorstorage.hh:107
GridPart GridPartType
Definition: threaditerator.hh:30