From dcaab89ebd6d96b807cca3133fba10878c1a169f Mon Sep 17 00:00:00 2001 From: Markus Blatt <mblatt@dune-project.org> Date: Tue, 4 Oct 2005 15:34:23 +0000 Subject: [PATCH] Renamed IndexSet to ParallelIndexSet because IndexSet is already existant in grid. [[Imported from SVN: r3016]] --- istl/communicator.hh | 6 +-- istl/indexset.hh | 88 ++++++++++++++++---------------- istl/indicessyncer.hh | 20 ++++---- istl/interface.hh | 10 ++-- istl/localindex.hh | 2 +- istl/paamg/globalaggregates.hh | 16 +++--- istl/paamg/hierarchy.hh | 36 ++++++------- istl/paamg/indicescoarsener.hh | 32 ++++++------ istl/paamg/pmatrix.hh | 11 ++-- istl/paamg/test/amgtest.cc | 6 +-- istl/paamg/test/anisotropic.hh | 12 ++--- istl/paamg/test/galerkintest.cc | 24 ++++----- istl/paamg/test/hierarchytest.cc | 6 +-- istl/plocalindex.hh | 2 +- istl/remoteindices.hh | 54 ++++++++++---------- istl/selection.hh | 34 ++++++------ istl/test/indexsettest.cc | 8 +-- istl/test/indicestest.cc | 52 +++++++++---------- istl/test/selectiontest.cc | 2 +- istl/test/syncertest.cc | 10 ++-- 20 files changed, 216 insertions(+), 215 deletions(-) diff --git a/istl/communicator.hh b/istl/communicator.hh index 3fc64a6dc..8804fca42 100644 --- a/istl/communicator.hh +++ b/istl/communicator.hh @@ -121,12 +121,12 @@ namespace Dune /** * @brief Type of the index set. */ - typedef T IndexSet; + typedef T ParallelIndexSet; /** * @brief Type of the underlying remote indices class. */ - typedef RemoteIndices<IndexSet> RemoteIndices; + typedef RemoteIndices<ParallelIndexSet> RemoteIndices; /** * @brief The type of the global index. @@ -146,7 +146,7 @@ namespace Dune /** * @brief The type of the index set we use. */ - typedef typename RemoteIndices::IndexSet IndexSet; + typedef typename RemoteIndices::ParallelIndexSet ParallelIndexSet; /** * @brief Creates a new DatatypeCommunicator. diff --git a/istl/indexset.hh b/istl/indexset.hh index 6b4693486..8a99b2baa 100644 --- a/istl/indexset.hh +++ b/istl/indexset.hh @@ -150,9 +150,9 @@ namespace Dune /** * @brief The states the index set can be in. - * @see IndexSet::state_ + * @see ParallelIndexSet::state_ */ - enum IndexSetState + enum ParallelIndexSetState { /** * @brief The default mode. @@ -189,9 +189,9 @@ namespace Dune * and non persistent while the global id might not be consecutive but definitely is persistent. */ template<typename TG, typename TL, int N=100> - class IndexSet + class ParallelIndexSet { - friend class GlobalLookupIndexSet<IndexSet<TG,TL,N> >; + friend class GlobalLookupIndexSet<ParallelIndexSet<TG,TL,N> >; public: /** @@ -230,9 +230,9 @@ namespace Dune { typedef typename ArrayList<IndexPair<GlobalIndex,LocalIndex>,N>::iterator Father; - friend class IndexSet<GlobalIndex,LocalIndex,N>; + friend class ParallelIndexSet<GlobalIndex,LocalIndex,N>; public: - iterator(IndexSet<TG,TL,N>& indexSet, const Father& father) + iterator(ParallelIndexSet<TG,TL,N>& indexSet, const Father& father) : Father(father), indexSet_(&indexSet) {} @@ -265,7 +265,7 @@ namespace Dune } /** @brief The index set we are an iterator of. */ - IndexSet<TG,TL,N>* indexSet_; + ParallelIndexSet<TG,TL,N>* indexSet_; }; @@ -279,18 +279,18 @@ namespace Dune /** * @brief Constructor. */ - IndexSet(); + ParallelIndexSet(); /** * @brief Get the state the index set is in. * @return The state of the index set. */ - inline const IndexSetState& state(); + inline const ParallelIndexSetState& state(); /** * @brief Indicate that the index set is to be resized. * @exception InvalidState If index set was not in - * IndexSetState::GROUND mode. + * ParallelIndexSetState::GROUND mode. */ void beginResize() throw(InvalidIndexSetState); @@ -300,7 +300,7 @@ namespace Dune * The local index is created by the default constructor. * @param global The globally unique id of the index. * @exception InvalidState If index set is not in - * IndexSetState::RESIZE mode. + * ParallelIndexSetState::RESIZE mode. */ inline void add(const GlobalIndex& global) throw(InvalidIndexSetState); @@ -310,7 +310,7 @@ namespace Dune * @param global The globally unique id of the index. * @param local The local index. * @exception InvalidState If index set is not in - * IndexSetState::RESIZE mode. + * ParallelIndexSetState::RESIZE mode. */ inline void add(const GlobalIndex& global, const LocalIndex& local) throw(InvalidIndexSetState); @@ -320,7 +320,7 @@ namespace Dune * * The index will be deleted during endResize(). * @param position An iterator at the position we want to delete. - * @exception InvalidState If index set is not in IndexSetState::RESIZE mode. + * @exception InvalidState If index set is not in ParallelIndexSetState::RESIZE mode. */ inline void markAsDeleted(const iterator& position) throw(InvalidIndexSetState); @@ -334,7 +334,7 @@ namespace Dune * if and * only if \f$g_i < g_j\f$ for arbitrary \f$i \neq j\f$. * @exception InvalidState If index set was not in - * IndexSetState::RESIZE mode. + * ParallelIndexSetState::RESIZE mode. */ void endResize() throw(InvalidIndexSetState); @@ -418,7 +418,7 @@ namespace Dune /** @brief The new indices for the RESIZE state. */ ArrayList<IndexPair<GlobalIndex,LocalIndex>,N> newIndices_; /** @brief The state of the index set. */ - IndexSetState state_; + ParallelIndexSetState state_; /** @brief Number to keep track of the number of resizes. */ int seqNo_; /** @brief Whether entries were deleted in resize mode. */ @@ -437,7 +437,7 @@ namespace Dune * @param pair The index set to print. */ template<class TG, class TL, int N> - std::ostream& operator<<(std::ostream& os, const IndexSet<TG,TL,N>& indexSet); + std::ostream& operator<<(std::ostream& os, const ParallelIndexSet<TG,TL,N>& indexSet); /** * @brief Decorates an index set with the possibility to find a global index @@ -451,29 +451,29 @@ namespace Dune /** * @brief The type of the index set. */ - typedef I IndexSet; + typedef I ParallelIndexSet; /** * @brief The type of the local index. */ - typedef typename IndexSet::LocalIndex LocalIndex; + typedef typename ParallelIndexSet::LocalIndex LocalIndex; /** * @brief The type of the global index. */ - typedef typename IndexSet::GlobalIndex GlobalIndex; + typedef typename ParallelIndexSet::GlobalIndex GlobalIndex; /** * @brief The iterator over the index pairs. */ - typedef typename IndexSet::const_iterator const_iterator; + typedef typename ParallelIndexSet::const_iterator const_iterator; /** * @brief Constructor. * @param indexset The index set we want to be able to lookup the corresponding * global index of a local index. */ - GlobalLookupIndexSet(const IndexSet& indexset); + GlobalLookupIndexSet(const ParallelIndexSet& indexset); /** * @brief Destructor. @@ -532,7 +532,7 @@ namespace Dune /** * @brief The index set we lookup in. */ - const IndexSet& indexSet_; + const ParallelIndexSet& indexSet_; }; @@ -544,9 +544,9 @@ namespace Dune } template<class TG, class TL, int N> - inline std::ostream& operator<<(std::ostream& os, const IndexSet<TG,TL,N>& indexSet) + inline std::ostream& operator<<(std::ostream& os, const ParallelIndexSet<TG,TL,N>& indexSet) { - typedef typename IndexSet<TG,TL,N>::const_iterator Iterator; + typedef typename ParallelIndexSet<TG,TL,N>::const_iterator Iterator; Iterator end = indexSet.end(); os<<"{"; for(Iterator index = indexSet.begin(); index != end; ++index) @@ -625,12 +625,12 @@ namespace Dune } template<class TG, class TL, int N> - IndexSet<TG,TL,N>::IndexSet() + ParallelIndexSet<TG,TL,N>::ParallelIndexSet() : state_(GROUND), seqNo_(0) {} template<class TG, class TL, int N> - void IndexSet<TG,TL,N>::beginResize() throw(InvalidIndexSetState) + void ParallelIndexSet<TG,TL,N>::beginResize() throw(InvalidIndexSetState) { // Checks in unproductive code @@ -646,7 +646,7 @@ namespace Dune } template<class TG, class TL, int N> - inline void IndexSet<TG,TL,N>::add(const GlobalIndex& global) + inline void ParallelIndexSet<TG,TL,N>::add(const GlobalIndex& global) throw(InvalidIndexSetState) { // Checks in unproductive code @@ -659,7 +659,7 @@ namespace Dune } template<class TG, class TL, int N> - inline void IndexSet<TG,TL,N>::add(const TG& global, const TL& local) + inline void ParallelIndexSet<TG,TL,N>::add(const TG& global, const TL& local) throw(InvalidIndexSetState) { // Checks in unproductive code @@ -672,7 +672,7 @@ namespace Dune } template<class TG, class TL, int N> - inline void IndexSet<TG,TL,N>::markAsDeleted(const iterator& global) + inline void ParallelIndexSet<TG,TL,N>::markAsDeleted(const iterator& global) throw(InvalidIndexSetState){ // Checks in unproductive code #ifndef NDEBUG @@ -686,7 +686,7 @@ namespace Dune } template<class TG, class TL, int N> - void IndexSet<TG,TL,N>::endResize() throw(InvalidIndexSetState){ + void ParallelIndexSet<TG,TL,N>::endResize() throw(InvalidIndexSetState){ // Checks in unproductive code #ifndef NDEBUG if(state_ != RESIZE) @@ -702,7 +702,7 @@ namespace Dune template<class TG, class TL, int N> - inline void IndexSet<TG,TL,N>::merge(){ + inline void ParallelIndexSet<TG,TL,N>::merge(){ if(localIndices_.size()==0) { localIndices_=newIndices_; @@ -761,7 +761,7 @@ namespace Dune template<class TG, class TL, int N> inline const IndexPair<TG,TL>& - IndexSet<TG,TL,N>::operator[](const TG& global) const + ParallelIndexSet<TG,TL,N>::operator[](const TG& global) const { // perform a binary search int low=0, high=localIndices_.size()-1, probe=-1; @@ -788,7 +788,7 @@ namespace Dune template<class TG, class TL, int N> - inline IndexPair<TG,TL>& IndexSet<TG,TL,N>::operator[](const TG& global) + inline IndexPair<TG,TL>& ParallelIndexSet<TG,TL,N>::operator[](const TG& global) { // perform a binary search int low=0, high=localIndices_.size()-1, probe=-1; @@ -814,37 +814,37 @@ namespace Dune } template<class TG, class TL, int N> - inline typename IndexSet<TG,TL,N>::iterator - IndexSet<TG,TL,N>::begin() + inline typename ParallelIndexSet<TG,TL,N>::iterator + ParallelIndexSet<TG,TL,N>::begin() { return iterator(*this, localIndices_.begin()); } template<class TG, class TL, int N> - inline typename IndexSet<TG,TL,N>::iterator - IndexSet<TG,TL,N>::end() + inline typename ParallelIndexSet<TG,TL,N>::iterator + ParallelIndexSet<TG,TL,N>::end() { return iterator(*this,localIndices_.end()); } template<class TG, class TL, int N> - inline typename IndexSet<TG,TL,N>::const_iterator - IndexSet<TG,TL,N>::begin() const + inline typename ParallelIndexSet<TG,TL,N>::const_iterator + ParallelIndexSet<TG,TL,N>::begin() const { return localIndices_.begin(); } template<class TG, class TL, int N> - inline typename IndexSet<TG,TL,N>::const_iterator - IndexSet<TG,TL,N>::end() const + inline typename ParallelIndexSet<TG,TL,N>::const_iterator + ParallelIndexSet<TG,TL,N>::end() const { return localIndices_.end(); } template<class TG, class TL, int N> - void IndexSet<TG,TL,N>::renumberLocal(){ + void ParallelIndexSet<TG,TL,N>::renumberLocal(){ #ifndef NDEBUG if(state_==RESIZE) DUNE_THROW(InvalidIndexSetState, "IndexSet has to be in " @@ -860,13 +860,13 @@ namespace Dune } template<class TG, class TL, int N> - inline int IndexSet<TG,TL,N>::seqNo() const + inline int ParallelIndexSet<TG,TL,N>::seqNo() const { return seqNo_; } template<class TG, class TL, int N> - inline size_t IndexSet<TG,TL,N>::size() const + inline size_t ParallelIndexSet<TG,TL,N>::size() const { return localIndices_.size(); } diff --git a/istl/indicessyncer.hh b/istl/indicessyncer.hh index d06469839..d1668a56d 100644 --- a/istl/indicessyncer.hh +++ b/istl/indicessyncer.hh @@ -36,16 +36,16 @@ namespace Dune public: /** @brief The type of the index set. */ - typedef T IndexSet; + typedef T ParallelIndexSet; - typedef typename IndexSet::GlobalIndex GlobalIndex; + typedef typename ParallelIndexSet::GlobalIndex GlobalIndex; - typedef typename IndexSet::LocalIndex::Attribute Attribute; + typedef typename ParallelIndexSet::LocalIndex::Attribute Attribute; /** * @brief Type of the remote indices. */ - typedef RemoteIndices<IndexSet> RemoteIndices; + typedef RemoteIndices<ParallelIndexSet> RemoteIndices; /** * @brief Constructor. @@ -56,7 +56,7 @@ namespace Dune * of the locally present indices. * @param remoteIndices The remoteIndices. */ - IndicesSyncer(IndexSet& indexSet, + IndicesSyncer(ParallelIndexSet& indexSet, RemoteIndices& remoteIndices); /** @@ -84,7 +84,7 @@ namespace Dune private: /** @brief The set of locally present indices.*/ - IndexSet& indexSet_; + ParallelIndexSet& indexSet_; /** @brief The remote indices. */ RemoteIndices& remoteIndices_; @@ -428,7 +428,7 @@ namespace Dune } template<typename T> - IndicesSyncer<T>::IndicesSyncer(IndexSet& indexSet, + IndicesSyncer<T>::IndicesSyncer(ParallelIndexSet& indexSet, RemoteIndices& remoteIndices) : indexSet_(indexSet), remoteIndices_(remoteIndices) { @@ -536,7 +536,7 @@ namespace Dune template<typename T> void IndicesSyncer<T>::calculateMessageSizes() { - typedef typename IndexSet::const_iterator IndexIterator; + typedef typename ParallelIndexSet::const_iterator IndexIterator; typedef CollectiveIterator<T> CollectiveIterator; IndexIterator iEnd = indexSet_.end(); @@ -729,7 +729,7 @@ namespace Dune template<typename T> void IndicesSyncer<T>::packAndSend(int destination) { - typedef typename IndexSet::const_iterator IndexIterator; + typedef typename ParallelIndexSet::const_iterator IndexIterator; typedef typename RemoteIndexList::const_iterator RemoteIndexIterator; typedef typename GlobalIndexList::const_iterator GlobalIterator; typedef typename BoolList::const_iterator BoolIterator; @@ -856,7 +856,7 @@ namespace Dune template<typename T1> void IndicesSyncer<T>::recvAndUnpack(int source, T1& numberer) { - typedef typename IndexSet::const_iterator IndexIterator; + typedef typename ParallelIndexSet::const_iterator IndexIterator; typedef typename RemoteIndexList::iterator RemoteIndexIterator; typedef typename GlobalIndexList::iterator GlobalIndexIterator; diff --git a/istl/interface.hh b/istl/interface.hh index 6b3cc3bff..c3c6a7be3 100644 --- a/istl/interface.hh +++ b/istl/interface.hh @@ -34,12 +34,12 @@ namespace Dune /** * @brief Type of the index set. */ - typedef T IndexSet; + typedef T ParallelIndexSet; /** * @brief Type of the underlying remote indices class. */ - typedef RemoteIndices<IndexSet> RemoteIndices; + typedef RemoteIndices<ParallelIndexSet> RemoteIndices; /** * @brief The type of the global index. @@ -216,12 +216,12 @@ namespace Dune /** * @brief Type of the index set. */ - typedef T IndexSet; + typedef T ParallelIndexSet; /** * @brief Type of the underlying remote indices class. */ - typedef RemoteIndices<IndexSet> RemoteIndices; + typedef RemoteIndices<ParallelIndexSet> RemoteIndices; /** @@ -338,7 +338,7 @@ namespace Dune { // Allocate the memory for the data type construction. typedef typename RemoteIndices::RemoteIndexMap::const_iterator const_iterator; - typedef typename RemoteIndices::IndexSet::const_iterator LocalIterator; + typedef typename RemoteIndices::ParallelIndexSet::const_iterator LocalIterator; const const_iterator end=remoteIndices.end(); diff --git a/istl/localindex.hh b/istl/localindex.hh index abf8b4cae..2a922db47 100644 --- a/istl/localindex.hh +++ b/istl/localindex.hh @@ -17,7 +17,7 @@ namespace Dune */ /** * @file - * @brief Provides classes for use as the local index in IndexSet. + * @brief Provides classes for use as the local index in ParallelIndexSet. * @author Markus Blatt */ /** diff --git a/istl/paamg/globalaggregates.hh b/istl/paamg/globalaggregates.hh index bf9faaa62..d74d519cb 100644 --- a/istl/paamg/globalaggregates.hh +++ b/istl/paamg/globalaggregates.hh @@ -15,18 +15,18 @@ namespace Dune struct GlobalAggregatesMap { public: - typedef TI IndexSet; + typedef TI ParallelIndexSet; - typedef typename IndexSet::GlobalIndex GlobalIndex; + typedef typename ParallelIndexSet::GlobalIndex GlobalIndex; - typedef typename IndexSet::GlobalIndex IndexedType; + typedef typename ParallelIndexSet::GlobalIndex IndexedType; - typedef typename IndexSet::LocalIndex LocalIndex; + typedef typename ParallelIndexSet::LocalIndex LocalIndex; typedef T Vertex; GlobalAggregatesMap(AggregatesMap<Vertex>& aggregates, - IndexSet& indexset) + ParallelIndexSet& indexset) : aggregates_(aggregates), indexset_(indexset) {} @@ -45,14 +45,14 @@ namespace Dune private: AggregatesMap<Vertex>& aggregates_; - GlobalLookupIndexSet<IndexSet> indexset_; + GlobalLookupIndexSet<ParallelIndexSet> indexset_; }; template<typename T, typename TI> struct AggregatesGatherScatter { - typedef TI IndexSet; - typedef typename IndexSet::GlobalIndex GlobalIndex; + typedef TI ParallelIndexSet; + typedef typename ParallelIndexSet::GlobalIndex GlobalIndex; static const GlobalIndex& gather(const GlobalAggregatesMap<T,TI>& ga, size_t i) { diff --git a/istl/paamg/hierarchy.hh b/istl/paamg/hierarchy.hh index 7a9f8382b..530b4cf8f 100644 --- a/istl/paamg/hierarchy.hh +++ b/istl/paamg/hierarchy.hh @@ -282,15 +282,15 @@ namespace Dune /** @brief The type of the matrix. */ typedef M Matrix; /** @brief The type of the index set. */ - typedef IS IndexSet; + typedef IS ParallelIndexSet; /** @brief The type of the remote indices. */ - typedef RemoteIndices<IndexSet> RemoteIndices; + typedef RemoteIndices<ParallelIndexSet> RemoteIndices; /** @brief The type of the Interface. */ - typedef Interface<IndexSet> Interface; + typedef Interface<ParallelIndexSet> Interface; /** @brief The type of the Communicator. */ - typedef BufferedCommunicator<IndexSet> Communicator; + typedef BufferedCommunicator<ParallelIndexSet> Communicator; /** @brief The type of the parallel matrix. */ - typedef ParallelMatrix<Matrix,IndexSet,RemoteIndices> ParallelMatrix; + typedef ParallelMatrix<Matrix,ParallelIndexSet,RemoteIndices> ParallelMatrix; /** @brief The flags identifying the overlap attributes */ typedef O OverlapFlags; /** @brief The allocator to use. */ @@ -309,7 +309,7 @@ namespace Dune * @param remoteIndices Information about the remote indices. */ MatrixHierarchy(const Matrix& fineMatrix, - const IndexSet& indexSet, + const ParallelIndexSet& indexSet, const RemoteIndices& remoteIndices, Interface& interface); @@ -422,7 +422,7 @@ namespace Dune template<class M, class IS, class O, class A> MatrixHierarchy<M,IS,O,A>::MatrixHierarchy(const Matrix& fineMatrix, - const IndexSet& indexSet, + const ParallelIndexSet& indexSet, const RemoteIndices& remoteIndices, Interface& interface) : matrices_(*new ParallelMatrix(fineMatrix,indexSet,remoteIndices)), @@ -473,7 +473,7 @@ namespace Dune MatrixGraph mg(mlevel->matrix()); std::vector<bool> excluded(mlevel->matrix().N()); - typedef typename IndexSet::const_iterator IndexIterator; + typedef typename ParallelIndexSet::const_iterator IndexIterator; IndexIterator iend = mlevel->indexSet().end(); typename std::vector<bool>::iterator iter=excluded.begin(); @@ -493,20 +493,20 @@ namespace Dune throw "Not implemented!"; } - IndexSet* coarseIndices = new IndexSet(); + ParallelIndexSet* coarseIndices = new ParallelIndexSet(); RemoteIndices* coarseRemote = new RemoteIndices(*coarseIndices, *coarseIndices, mlevel->remoteIndices().communicator()); typename PropertyMapTypeSelector<VertexVisitedTag,PropertiesGraph>::Type visitedMap = get(VertexVisitedTag(), pg); - IndicesCoarsener<OverlapFlags,IndexSet>::coarsen(mlevel->indexSet(), - mlevel->remoteIndices(), - pg, - visitedMap, - *aggregatesMap, - *coarseIndices, - *coarseRemote); + IndicesCoarsener<OverlapFlags,ParallelIndexSet>::coarsen(mlevel->indexSet(), + mlevel->remoteIndices(), + pg, + visitedMap, + *aggregatesMap, + *coarseIndices, + *coarseRemote); const void* args; communicators_.addCoarser(args); @@ -514,11 +514,11 @@ namespace Dune interfaces_.addCoarser(args); ++iflevel; iflevel->build(*coarseRemote, NegateSet<OverlapFlags>(), OverlapFlags()); - typedef Dune::Amg::GlobalAggregatesMap<Vertex,IndexSet> GlobalMap; + typedef Dune::Amg::GlobalAggregatesMap<Vertex,ParallelIndexSet> GlobalMap; GlobalMap gmap(*aggregatesMap, *coarseIndices); commlevel->build<GlobalMap>(*iflevel); - commlevel->template forward<Dune::Amg::AggregatesGatherScatter<Vertex,IndexSet> >(gmap); + commlevel->template forward<Dune::Amg::AggregatesGatherScatter<Vertex,ParallelIndexSet> >(gmap); commlevel->free(); diff --git a/istl/paamg/indicescoarsener.hh b/istl/paamg/indicescoarsener.hh index bf9208d12..df1f82e22 100644 --- a/istl/paamg/indicescoarsener.hh +++ b/istl/paamg/indicescoarsener.hh @@ -34,17 +34,17 @@ namespace Dune /** * @brief The type of the index set. */ - typedef T IndexSet; + typedef T ParallelIndexSet; /** * @brief The type of the global index. */ - typedef typename IndexSet::GlobalIndex GlobalIndex; + typedef typename ParallelIndexSet::GlobalIndex GlobalIndex; /** * @brief The type of the local index. */ - typedef typename IndexSet::LocalIndex LocalIndex; + typedef typename ParallelIndexSet::LocalIndex LocalIndex; /** * @brief The type of the attribute. @@ -57,12 +57,12 @@ namespace Dune typedef RemoteIndices<T> RemoteIndices; template<typename Graph, typename VM> - static void coarsen(const IndexSet& fineIndices, + static void coarsen(const ParallelIndexSet& fineIndices, const RemoteIndices& fineRemote, Graph& fineGraph, VM& visitedMap, AggregatesMap<typename Graph::VertexDescriptor>& aggregates, - IndexSet& coarseIndices, + ParallelIndexSet& coarseIndices, RemoteIndices& coarseRemote); private: @@ -133,16 +133,16 @@ namespace Dune template<typename Graph, typename VM> - static void buildCoarseIndexSet(const IndexSet& fineIndices, + static void buildCoarseIndexSet(const ParallelIndexSet& fineIndices, Graph& fineGraph, VM& visitedMap, AggregatesMap<typename Graph::VertexDescriptor>& aggregates, - IndexSet& coarseIndices, + ParallelIndexSet& coarseIndices, AggregateRenumberer<Graph>& renumberer); template<typename Graph> static void buildCoarseRemoteIndices(const RemoteIndices& fineRemote, const AggregatesMap<typename Graph::VertexDescriptor>& aggregates, - IndexSet& coarseIndices, + ParallelIndexSet& coarseIndices, RemoteIndices& coarseRemote, AggregateRenumberer<Graph>& renumberer); @@ -150,12 +150,12 @@ namespace Dune template<typename E,typename T> template<typename Graph, typename VM> - void IndicesCoarsener<E,T>::coarsen(const IndexSet& fineIndices, + void IndicesCoarsener<E,T>::coarsen(const ParallelIndexSet& fineIndices, const RemoteIndices& fineRemote, Graph& fineGraph, VM& visitedMap, AggregatesMap<typename Graph::VertexDescriptor>& aggregates, - IndexSet& coarseIndices, + ParallelIndexSet& coarseIndices, RemoteIndices& coarseRemote) { AggregateRenumberer<Graph> renumberer(aggregates); @@ -165,14 +165,14 @@ namespace Dune template<typename E,typename T> template<typename Graph, typename VM> - void IndicesCoarsener<E,T>::buildCoarseIndexSet(const IndexSet& fineIndices, + void IndicesCoarsener<E,T>::buildCoarseIndexSet(const ParallelIndexSet& fineIndices, Graph& fineGraph, VM& visitedMap, AggregatesMap<typename Graph::VertexDescriptor>& aggregates, - IndexSet& coarseIndices, + ParallelIndexSet& coarseIndices, AggregateRenumberer<Graph>& renumberer) { - typedef typename IndexSet::const_iterator Iterator; + typedef typename ParallelIndexSet::const_iterator Iterator; typedef typename Graph::VertexDescriptor Vertex; Iterator end = fineIndices.end(); @@ -226,7 +226,7 @@ namespace Dune template<typename Graph> void IndicesCoarsener<E,T>::buildCoarseRemoteIndices(const RemoteIndices& fineRemote, const AggregatesMap<typename Graph::VertexDescriptor>& aggregates, - IndexSet& coarseIndices, + ParallelIndexSet& coarseIndices, RemoteIndices& coarseRemote, AggregateRenumberer<Graph>& renumberer) { @@ -262,7 +262,7 @@ namespace Dune // Build remote index list typedef RemoteIndexListModifier<T,false> Modifier; typedef typename RemoteIndices::RemoteIndex RemoteIndex; - typedef typename IndexSet::const_iterator IndexIterator; + typedef typename ParallelIndexSet::const_iterator IndexIterator; Modifier coarseList = coarseRemote.template getModifier<false,true>(process); @@ -280,7 +280,7 @@ namespace Dune // snyc the index set and the remote indices to recompute missing // indices - IndicesSyncer<IndexSet> syncer(coarseIndices, coarseRemote); + IndicesSyncer<ParallelIndexSet> syncer(coarseIndices, coarseRemote); syncer.sync(renumberer); } diff --git a/istl/paamg/pmatrix.hh b/istl/paamg/pmatrix.hh index cde17ff72..941d322d7 100644 --- a/istl/paamg/pmatrix.hh +++ b/istl/paamg/pmatrix.hh @@ -24,15 +24,16 @@ namespace Dune /** @brief The type of the matrix. */ typedef M Matrix; /** @brief The type of the index set. */ - typedef IS IndexSet; + typedef IS ParallelIndexSet; /** @brief The type of the remote indices. */ typedef RI RemoteIndices; - ParallelMatrix(const Matrix& matrix, const IndexSet& indexSet, + ParallelMatrix(const Matrix& matrix, const ParallelIndexSet& indexSet, const RemoteIndices& rindices) : matrix_(&matrix), indices_(&indexSet), rIndices_(&rindices) { - IsTrue<SameType<IndexSet,typename RemoteIndices::IndexSet>::value>::yes(); + IsTrue<SameType<ParallelIndexSet, + typename RemoteIndices::ParallelIndexSet>::value>::yes(); } @@ -48,7 +49,7 @@ namespace Dune * @brief Get the index set that maps global indices to matrix rows. * @return The index set. */ - const IndexSet& indexSet() const + const ParallelIndexSet& indexSet() const { return *indices_; } @@ -66,7 +67,7 @@ namespace Dune /** @brief The local part of the matrix. */ const Matrix* matrix_; /** @brief The index set. */ - const IndexSet* indices_; + const ParallelIndexSet* indices_; /** @brief Remote index information. */ const RemoteIndices* rIndices_; }; diff --git a/istl/paamg/test/amgtest.cc b/istl/paamg/test/amgtest.cc index d99ada7c5..838ca0744 100644 --- a/istl/paamg/test/amgtest.cc +++ b/istl/paamg/test/amgtest.cc @@ -15,7 +15,7 @@ int main(int argc, char** argv) MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &procs); - IndexSet indices; + ParallelIndexSet indices; typedef Dune::FieldMatrix<double,BS,BS> MatrixBlock; typedef Dune::BCRSMatrix<MatrixBlock> BCRSMat; typedef Dune::FieldVector<double,BS> VectorBlock; @@ -32,12 +32,12 @@ int main(int argc, char** argv) RemoteIndices remoteIndices(indices,indices,MPI_COMM_WORLD); remoteIndices.rebuild<false>(); - typedef Dune::Interface<IndexSet> Interface; + typedef Dune::Interface<ParallelIndexSet> Interface; Interface interface; typedef Dune::EnumItem<GridFlag,overlap> OverlapFlags; - typedef Dune::Amg::MatrixHierarchy<BCRSMat,IndexSet,OverlapFlags> MHierarchy; + typedef Dune::Amg::MatrixHierarchy<BCRSMat,ParallelIndexSet,OverlapFlags> MHierarchy; typedef Dune::Amg::Hierarchy<Vector> VHierarchy; interface.build(remoteIndices, Dune::NegateSet<OverlapFlags>(), OverlapFlags()); diff --git a/istl/paamg/test/anisotropic.hh b/istl/paamg/test/anisotropic.hh index 254dbee37..907c151ce 100644 --- a/istl/paamg/test/anisotropic.hh +++ b/istl/paamg/test/anisotropic.hh @@ -9,13 +9,13 @@ enum GridFlag { owner, overlap }; typedef Dune::ParallelLocalIndex<GridFlag> LocalIndex; -typedef Dune::IndexSet<int,LocalIndex,101> IndexSet; -typedef Dune::RemoteIndices<IndexSet> RemoteIndices; -typedef Dune::Interface<IndexSet> Interface; -typedef Dune::BufferedCommunicator<IndexSet> Communicator; +typedef Dune::ParallelIndexSet<int,LocalIndex,101> ParallelIndexSet; +typedef Dune::RemoteIndices<ParallelIndexSet> RemoteIndices; +typedef Dune::Interface<ParallelIndexSet> Interface; +typedef Dune::BufferedCommunicator<ParallelIndexSet> Communicator; template<int N, class M> -void setupPattern(M& mat, IndexSet& indices, int overlapStart, int overlapEnd, +void setupPattern(M& mat, ParallelIndexSet& indices, int overlapStart, int overlapEnd, int start, int end) { int n = overlapEnd - overlapStart; @@ -116,7 +116,7 @@ void fillValues(M& mat, int overlapStart, int overlapEnd, int start, int end) } template<int N, int BS> -Dune::BCRSMatrix<Dune::FieldMatrix<double,BS,BS> > setupAnisotropic2d(IndexSet& indices, int *nout) +Dune::BCRSMatrix<Dune::FieldMatrix<double,BS,BS> > setupAnisotropic2d(ParallelIndexSet& indices, int *nout) { int procs, rank; MPI_Comm_rank(MPI_COMM_WORLD, &rank); diff --git a/istl/paamg/test/galerkintest.cc b/istl/paamg/test/galerkintest.cc index d8c1d13a0..b29fc321a 100644 --- a/istl/paamg/test/galerkintest.cc +++ b/istl/paamg/test/galerkintest.cc @@ -25,7 +25,7 @@ void testCoarsenIndices() MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &procs); - IndexSet indices; + ParallelIndexSet indices; typedef Dune::FieldMatrix<double,BS,BS> Block; typedef Dune::BCRSMatrix<Block> BCRSMat; int n; @@ -46,7 +46,7 @@ void testCoarsenIndices() MatrixGraph mg(mat); std::vector<bool> excluded(mat.N()); - typedef IndexSet::iterator IndexIterator; + typedef ParallelIndexSet::iterator IndexIterator; IndexIterator iend = indices.end(); typename std::vector<bool>::iterator iter=excluded.begin(); @@ -62,18 +62,18 @@ void testCoarsenIndices() aggregatesMap.buildAggregates(mat, pg, Criterion()); - IndexSet coarseIndices; + ParallelIndexSet coarseIndices; RemoteIndices coarseRemote(coarseIndices,coarseIndices, MPI_COMM_WORLD); typename Dune::PropertyMapTypeSelector<Dune::Amg::VertexVisitedTag,PropertiesGraph>::Type visitedMap = Dune::get(Dune::Amg::VertexVisitedTag(), pg); - Dune::Amg::IndicesCoarsener<Dune::EnumItem<GridFlag,overlap>,IndexSet>::coarsen(indices, - remoteIndices, - pg, - visitedMap, - aggregatesMap, - coarseIndices, - coarseRemote); + Dune::Amg::IndicesCoarsener<Dune::EnumItem<GridFlag,overlap>,ParallelIndexSet>::coarsen(indices, + remoteIndices, + pg, + visitedMap, + aggregatesMap, + coarseIndices, + coarseRemote); std::cout << rank <<": coarse indices: " <<coarseIndices << std::endl; std::cout << rank <<": coarse remote indices:"<<coarseRemote <<std::endl; @@ -82,7 +82,7 @@ void testCoarsenIndices() interface.build(remoteIndices, Dune::EnumItem<GridFlag,owner>(), Dune::EnumItem<GridFlag, overlap>()); Communicator communicator; - typedef Dune::Amg::GlobalAggregatesMap<Vertex,IndexSet> GlobalMap; + typedef Dune::Amg::GlobalAggregatesMap<Vertex,ParallelIndexSet> GlobalMap; GlobalMap gmap(aggregatesMap,coarseIndices); @@ -90,7 +90,7 @@ void testCoarsenIndices() Dune::Amg::printAggregates2d(aggregatesMap, n, N, std::cout); - communicator.template forward<Dune::Amg::AggregatesGatherScatter<typename MatrixGraph::VertexDescriptor,IndexSet> >(gmap); + communicator.template forward<Dune::Amg::AggregatesGatherScatter<typename MatrixGraph::VertexDescriptor,ParallelIndexSet> >(gmap); std::cout<<"Communicated: "; Dune::Amg::printAggregates2d(aggregatesMap, n, N, std::cout); diff --git a/istl/paamg/test/hierarchytest.cc b/istl/paamg/test/hierarchytest.cc index cc95b02fb..0732b2050 100644 --- a/istl/paamg/test/hierarchytest.cc +++ b/istl/paamg/test/hierarchytest.cc @@ -17,7 +17,7 @@ int main(int argc, char** argv) MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &procs); - IndexSet indices; + ParallelIndexSet indices; typedef Dune::FieldMatrix<double,BS,BS> MatrixBlock; typedef Dune::BCRSMatrix<MatrixBlock> BCRSMat; typedef Dune::FieldVector<double,BS> VectorBlock; @@ -31,12 +31,12 @@ int main(int argc, char** argv) RemoteIndices remoteIndices(indices,indices,MPI_COMM_WORLD); remoteIndices.rebuild<false>(); - typedef Dune::Interface<IndexSet> Interface; + typedef Dune::Interface<ParallelIndexSet> Interface; Interface interface; typedef Dune::EnumItem<GridFlag,overlap> OverlapFlags; - typedef Dune::Amg::MatrixHierarchy<BCRSMat,IndexSet,OverlapFlags> Hierarchy; + typedef Dune::Amg::MatrixHierarchy<BCRSMat,ParallelIndexSet,OverlapFlags> Hierarchy; typedef Dune::Amg::Hierarchy<Vector> VHierarchy; interface.build(remoteIndices, Dune::NegateSet<OverlapFlags>(), OverlapFlags()); diff --git a/istl/plocalindex.hh b/istl/plocalindex.hh index cd97588a9..ff2e2cce6 100644 --- a/istl/plocalindex.hh +++ b/istl/plocalindex.hh @@ -18,7 +18,7 @@ namespace Dune */ /** * @file - * @brief Provides classes for use as the local index in IndexSet for distributed computing. + * @brief Provides classes for use as the local index in ParallelIndexSet for distributed computing. * @author Markus Blatt */ diff --git a/istl/remoteindices.hh b/istl/remoteindices.hh index 9486fde5d..9fff88013 100644 --- a/istl/remoteindices.hh +++ b/istl/remoteindices.hh @@ -170,18 +170,18 @@ namespace Dune { /** * @brief Type of the index set we use. */ - typedef T IndexSet; + typedef T ParallelIndexSet; /** * @brief The type of the global index. */ - typedef typename IndexSet::GlobalIndex GlobalIndex; + typedef typename ParallelIndexSet::GlobalIndex GlobalIndex; /** * @brief The type of the local index. */ - typedef typename IndexSet::LocalIndex LocalIndex; + typedef typename ParallelIndexSet::LocalIndex LocalIndex; /** * @brief The type of the attribute. @@ -218,7 +218,7 @@ namespace Dune { * local mapping at the destination of the communication. * May be the same as the source indexset. */ - inline RemoteIndices(const IndexSet& source, const IndexSet& destination, + inline RemoteIndices(const ParallelIndexSet& source, const ParallelIndexSet& destination, const MPI_Comm& comm); /** @@ -301,10 +301,10 @@ namespace Dune { private: /** @brief Index set used at the source of the communication. */ - const IndexSet& source_; + const ParallelIndexSet& source_; /** @brief Index set used at the destination of the communication. */ - const IndexSet& target_; + const ParallelIndexSet& target_; /** @brief The communicator to use.*/ const MPI_Comm& comm_; @@ -365,7 +365,7 @@ namespace Dune { * @param indexSet The index set whose indices we count. * @return the number of indices marked as public. */ - inline int noPublic(const IndexSet& indexSet); + inline int noPublic(const ParallelIndexSet& indexSet); /** * @brief Pack the indices to send if source_ and target_ are the same. @@ -379,7 +379,7 @@ namespace Dune { * @param position The position to start packing. */ template<bool ignorePublic> - inline void packEntries(PairType** myPairs, const IndexSet& indexSet, + inline void packEntries(PairType** myPairs, const ParallelIndexSet& indexSet, char* p_out, MPI_Datatype type, int bufferSize, int* position, int n); @@ -437,7 +437,7 @@ namespace Dune { * * If for example new indices are added to an index set * all pointers of the remote indices to the local indices - * become invalid after IndexSet::endResize() was called. + * become invalid after ParallelIndexSet::endResize() was called. */ MODIFYINDEXSET=mode }; @@ -445,17 +445,17 @@ namespace Dune { /** * @brief Type of the index set we use. */ - typedef T IndexSet; + typedef T ParallelIndexSet; /** * @brief The type of the global index. */ - typedef typename IndexSet::GlobalIndex GlobalIndex; + typedef typename ParallelIndexSet::GlobalIndex GlobalIndex; /** * @brief The type of the local index. */ - typedef typename IndexSet::LocalIndex LocalIndex; + typedef typename ParallelIndexSet::LocalIndex LocalIndex; /** * @brief The type of the attribute. @@ -527,7 +527,7 @@ namespace Dune { */ bool remove(const GlobalIndex& global) throw(InvalidPosition); - RemoteIndexListModifier(const IndexSet& indexSet, + RemoteIndexListModifier(const ParallelIndexSet& indexSet, RemoteIndexList& rList); @@ -538,11 +538,11 @@ namespace Dune { * * Due to adding new indices or/and deleting indices in the * index set all pointers to the local index pair might become - * invalid during IndexSet::endResize(). + * invalid during ParallelIndexSet::endResize(). * This method repairs them. * * @exception InvalidIndexSetState Thrown if the underlying - * index set is not in IndexSetState::GROUND mode (only when + * index set is not in ParallelIndexSetState::GROUND mode (only when * compiled with DUNE_ISTL_WITH_CHECKING!). */ void repairLocalIndexPointers() throw(InvalidIndexSetState); @@ -552,7 +552,7 @@ namespace Dune { typedef SLList<GlobalIndex,Allocator> GlobalList; typedef typename GlobalList::ModifyIterator GlobalModifyIterator; RemoteIndexList* rList_; - const IndexSet* indexSet_; + const ParallelIndexSet* indexSet_; GlobalList* glist_; ModifyIterator iter_; GlobalModifyIterator giter_; @@ -573,17 +573,17 @@ namespace Dune { /** * @brief Type of the index set we use. */ - typedef T IndexSet; + typedef T ParallelIndexSet; /** * @brief The type of the global index. */ - typedef typename IndexSet::GlobalIndex GlobalIndex; + typedef typename ParallelIndexSet::GlobalIndex GlobalIndex; /** * @brief The type of the local index. */ - typedef typename IndexSet::LocalIndex LocalIndex; + typedef typename ParallelIndexSet::LocalIndex LocalIndex; /** * @brief The type of the attribute. @@ -771,8 +771,8 @@ namespace Dune { } template<typename T> - inline RemoteIndices<T>::RemoteIndices(const IndexSet& source, - const IndexSet& destination, + inline RemoteIndices<T>::RemoteIndices(const ParallelIndexSet& source, + const ParallelIndexSet& destination, const MPI_Comm& comm) : source_(source), target_(destination), comm_(comm), sourceSeqNo_(-1), destSeqNo_(-1), publicIgnored(false), firstBuild(true), @@ -788,13 +788,13 @@ namespace Dune { template<typename T> template<bool ignorePublic> inline void RemoteIndices<T>::packEntries(IndexPair<GlobalIndex,LocalIndex>** pairs, - const IndexSet& indexSet, + const ParallelIndexSet& indexSet, char* p_out, MPI_Datatype type, int bufferSize, int *position, int n) { // fill with own indices - typedef typename IndexSet::const_iterator const_iterator; + typedef typename ParallelIndexSet::const_iterator const_iterator; typedef IndexPair<GlobalIndex,LocalIndex> PairType; const const_iterator end = indexSet.end(); @@ -813,9 +813,9 @@ namespace Dune { } template<typename T> - inline int RemoteIndices<T>::noPublic(const IndexSet& indexSet) + inline int RemoteIndices<T>::noPublic(const ParallelIndexSet& indexSet) { - typedef typename IndexSet::const_iterator const_iterator; + typedef typename ParallelIndexSet::const_iterator const_iterator; int noPublic=0; @@ -1227,7 +1227,7 @@ namespace Dune { } template<class T, bool mode> - RemoteIndexListModifier<T,mode>::RemoteIndexListModifier(const IndexSet& indexSet, + RemoteIndexListModifier<T,mode>::RemoteIndexListModifier(const ParallelIndexSet& indexSet, RemoteIndexList& rList) : rList_(&rList), indexSet_(&indexSet), glist_(new GlobalList()), iter_(rList.beginModify()), end_(rList.end()), first_(true) { @@ -1256,7 +1256,7 @@ namespace Dune { if(indexSet_->state()!=GROUND) DUNE_THROW(InvalidIndexSetState, "Index has to be in ground mode for repairing pointers to indices"); #endif - typedef typename IndexSet::const_iterator IndexIterator; + typedef typename ParallelIndexSet::const_iterator IndexIterator; typedef typename GlobalList::const_iterator GlobalIterator; typedef typename RemoteIndexList::iterator Iterator; GlobalIterator giter = glist_->begin(); diff --git a/istl/selection.hh b/istl/selection.hh index 42d2e5128..176b1d56a 100644 --- a/istl/selection.hh +++ b/istl/selection.hh @@ -40,17 +40,17 @@ namespace Dune /** * @brief The type of the underlying index set. */ - typedef IndexSet<TG,TL,N> IndexSet; + typedef ParallelIndexSet<TG,TL,N> ParallelIndexSet; - //typedef typename IndexSet::const_iterator IndexSetIterator; + //typedef typename ParallelIndexSet::const_iterator ParallelIndexSetIterator; - typedef ConstArrayListIterator<IndexPair<TG,TL>, N, std::allocator<Dune::IndexPair<TG,TL> > > IndexSetIterator; + typedef ConstArrayListIterator<IndexPair<TG,TL>, N, std::allocator<Dune::IndexPair<TG,TL> > > ParallelIndexSetIterator; /** * @brief Constructor. * @param iter The iterator over the index set. * @param end The iterator over the index set positioned at the end. */ - SelectionIterator(const IndexSetIterator& iter, const IndexSetIterator& end) + SelectionIterator(const ParallelIndexSetIterator& iter, const ParallelIndexSetIterator& end) : iter_(iter), end_(end) { // Step to the first valid entry @@ -83,8 +83,8 @@ namespace Dune } private: - IndexSetIterator iter_; - const IndexSetIterator end_; + ParallelIndexSetIterator iter_; + const ParallelIndexSetIterator end_; }; @@ -121,7 +121,7 @@ namespace Dune /** * @brief The type of the underlying index set. */ - typedef IndexSet<GlobalIndex,LocalIndex,N> IndexSet; + typedef ParallelIndexSet<GlobalIndex,LocalIndex,N> ParallelIndexSet; /** * @brief The type of the iterator of the selected indices. @@ -137,19 +137,19 @@ namespace Dune : indexSet_() {} - UncachedSelection(const IndexSet& indexset) + UncachedSelection(const ParallelIndexSet& indexset) : indexSet_(&indexset) {} /** * @brief Set the index set of the selection. * @param indexset The index set to use. */ - void setIndexSet(const IndexSet& indexset); + void setIndexSet(const ParallelIndexSet& indexset); /** * @brief Get the index set we are a selection for. */ - //const IndexSet& indexSet() const; + //const ParallelIndexSet& indexSet() const; /** * @brief Get an iterator over the selected indices. @@ -165,7 +165,7 @@ namespace Dune private: - const IndexSet* indexSet_; + const ParallelIndexSet* indexSet_; }; @@ -204,7 +204,7 @@ namespace Dune /** * @brief The type of the underlying index set. */ - typedef IndexSet<GlobalIndex,LocalIndex,N> IndexSet; + typedef ParallelIndexSet<GlobalIndex,LocalIndex,N> ParallelIndexSet; /** * @brief The type of the iterator of the selected indices. @@ -220,7 +220,7 @@ namespace Dune : selected_() {} - Selection(const IndexSet& indexset) + Selection(const ParallelIndexSet& indexset) : selected_(), size_(0), built_(false) { setIndexSet(indexset); @@ -232,7 +232,7 @@ namespace Dune * @brief Set the index set of the selection. * @param indexset The index set to use. */ - void setIndexSet(const IndexSet& indexset); + void setIndexSet(const ParallelIndexSet& indexset); /** * @brief Free allocated memory. @@ -265,13 +265,13 @@ namespace Dune }; template<typename TS, typename TG, typename TL, int N> - inline void Selection<TS,TG,TL,N>::setIndexSet(const IndexSet& indexset) + inline void Selection<TS,TG,TL,N>::setIndexSet(const ParallelIndexSet& indexset) { if(built_) free(); // Count the number of entries the selection has to hold - typedef typename IndexSet::const_iterator const_iterator; + typedef typename ParallelIndexSet::const_iterator const_iterator; const const_iterator end = indexset.end(); int entries = 0; @@ -332,7 +332,7 @@ namespace Dune indexSet_->end()); } template<typename TS, typename TG, typename TL, int N> - void UncachedSelection<TS,TG,TL,N>::setIndexSet(const IndexSet& indexset) + void UncachedSelection<TS,TG,TL,N>::setIndexSet(const ParallelIndexSet& indexset) { indexSet_ = &indexset; } diff --git a/istl/test/indexsettest.cc b/istl/test/indexsettest.cc index e7041fe05..1249c8b31 100644 --- a/istl/test/indexsettest.cc +++ b/istl/test/indexsettest.cc @@ -8,8 +8,8 @@ int testDeleteIndices() { - Dune::IndexSet<int,Dune::LocalIndex,15> indexSet; - Dune::IndexSet<int,Dune::LocalIndex,25> indexSet1; + Dune::ParallelIndexSet<int,Dune::LocalIndex,15> indexSet; + Dune::ParallelIndexSet<int,Dune::LocalIndex,25> indexSet1; indexSet.beginResize(); indexSet1.beginResize(); @@ -22,7 +22,7 @@ int testDeleteIndices() indexSet.endResize(); indexSet1.endResize(); - typedef Dune::IndexSet<int,Dune::LocalIndex,15>::iterator + typedef Dune::ParallelIndexSet<int,Dune::LocalIndex,15>::iterator Iterator; Iterator entry = indexSet.begin(); @@ -52,7 +52,7 @@ int testDeleteIndices() ret++; } - Dune::IndexSet<int,Dune::LocalIndex,25>::iterator iter=indexSet1.begin(); + Dune::ParallelIndexSet<int,Dune::LocalIndex,25>::iterator iter=indexSet1.begin(); // Test whether the local indices changed for(entry = indexSet.begin(); entry != end; ++entry) { diff --git a/istl/test/indicestest.cc b/istl/test/indicestest.cc index 9dc6defc7..42a36a41e 100644 --- a/istl/test/indicestest.cc +++ b/istl/test/indicestest.cc @@ -117,11 +117,11 @@ void testIndices(MPI_Comm comm) // distributed indexset // typedef ParallelLocalIndex<GridFlags> LocalIndexType; - typedef Dune::IndexSet<int,Dune::ParallelLocalIndex<GridFlags>,45> IndexSet; + typedef Dune::ParallelIndexSet<int,Dune::ParallelLocalIndex<GridFlags>,45> ParallelIndexSet; - IndexSet distIndexSet; + ParallelIndexSet distIndexSet; // global indexset - IndexSet globalIndexSet; + ParallelIndexSet globalIndexSet; // Set up the indexsets. int start = std::max(rank*nx-1,0); @@ -167,14 +167,14 @@ void testIndices(MPI_Comm comm) }else globalArray=new Array(0); - typedef Dune::RemoteIndices<IndexSet> RemoteIndices; + typedef Dune::RemoteIndices<ParallelIndexSet> RemoteIndices; RemoteIndices accuIndices(distIndexSet, globalIndexSet, comm); RemoteIndices overlapIndices(distIndexSet, distIndexSet, comm); accuIndices.rebuild<true>(); overlapIndices.rebuild<false>(); - Dune::DatatypeCommunicator<IndexSet> accumulator, overlapExchanger; + Dune::DatatypeCommunicator<ParallelIndexSet> accumulator, overlapExchanger; Dune::EnumItem<GridFlags,owner> sourceFlags; Dune::Combine<Dune::EnumItem<GridFlags,overlap>,Dune::EnumItem<GridFlags,owner>,GridFlags> destFlags; @@ -219,7 +219,7 @@ void testIndices(MPI_Comm comm) template<int NX, int NY, typename TG, typename TA> -void setupDistributed(Array& distArray, Dune::IndexSet<TG,Dune::ParallelLocalIndex<TA> >& distIndexSet, +void setupDistributed(Array& distArray, Dune::ParallelIndexSet<TG,Dune::ParallelLocalIndex<TA> >& distIndexSet, int rank, int procs) { // The local grid @@ -274,7 +274,7 @@ void setupDistributed(Array& distArray, Dune::IndexSet<TG,Dune::ParallelLocalInd } template<int NX,int NY, typename TG, typename TA> -void setupGlobal(Array& globalArray, Dune::IndexSet<TG,Dune::ParallelLocalIndex<TA> >& globalIndexSet) +void setupGlobal(Array& globalArray, Dune::ParallelIndexSet<TG,Dune::ParallelLocalIndex<TA> >& globalIndexSet) { // build global indexset on first process globalIndexSet.beginResize(); @@ -304,11 +304,11 @@ void testIndicesBuffered(MPI_Comm comm) MPI_Comm_size(comm, &procs); MPI_Comm_rank(comm, &rank); - typedef Dune::IndexSet<int,Dune::ParallelLocalIndex<GridFlags> >IndexSet; + typedef Dune::ParallelIndexSet<int,Dune::ParallelLocalIndex<GridFlags> > ParallelIndexSet; - IndexSet distIndexSet; + ParallelIndexSet distIndexSet; // global indexset - IndexSet globalIndexSet; + ParallelIndexSet globalIndexSet; Array distArray; Array globalArray; @@ -320,7 +320,7 @@ void testIndicesBuffered(MPI_Comm comm) setupGlobal<Nx,Ny>(globalArray, globalIndexSet); } - typedef Dune::RemoteIndices<IndexSet> RemoteIndices; + typedef Dune::RemoteIndices<ParallelIndexSet> RemoteIndices; RemoteIndices accuIndices(distIndexSet, globalIndexSet, comm); @@ -330,8 +330,8 @@ void testIndicesBuffered(MPI_Comm comm) RemoteIndices overlapIndices(distIndexSet, distIndexSet, comm); overlapIndices.rebuild<false>(); - Dune::Interface<IndexSet> accuInterface; - Dune::Interface<IndexSet> overlapInterface; + Dune::Interface<ParallelIndexSet> accuInterface; + Dune::Interface<ParallelIndexSet> overlapInterface; Dune::EnumItem<GridFlags,owner> sourceFlags; Dune::Combine<Dune::EnumItem<GridFlags,overlap>,Dune::EnumItem<GridFlags,owner>,GridFlags> destFlags; // Dune::Bool2Type<true> flag; @@ -344,7 +344,7 @@ void testIndicesBuffered(MPI_Comm comm) //accuInterface.print(); - Dune::BufferedCommunicator<IndexSet> accumulator, overlapExchanger; + Dune::BufferedCommunicator<ParallelIndexSet> accumulator, overlapExchanger; accumulator.build<Array>(accuInterface); @@ -400,10 +400,10 @@ void testRedistributeIndices(MPI_Comm comm) int nx = Nx/procs; // distributed indexset - typedef IndexSet<int,ParallelLocalIndex<GridFlags> > IndexSet; - IndexSet sendIndexSet; + typedef ParallelIndexSet<int,ParallelLocalIndex<GridFlags> > ParallelIndexSet; + ParallelIndexSet sendIndexSet; // global indexset - IndexSet receiveIndexSet; + ParallelIndexSet receiveIndexSet; Array array, redistributedArray; @@ -461,7 +461,7 @@ void testRedistributeIndices(MPI_Comm comm) std::cout<< rank<<": distributed and global index set!"<<std::endl<<std::flush; - typedef RemoteIndices<IndexSet> RemoteIndices; + typedef RemoteIndices<ParallelIndexSet> RemoteIndices; RemoteIndices redistributeIndices(sendIndexSet, receiveIndexSet, comm); @@ -470,7 +470,7 @@ void testRedistributeIndices(MPI_Comm comm) redistributeIndices.rebuild<true>(); overlapIndices.rebuild<false>(); - DatatypeCommunicator<IndexSet> redistribute, overlapComm; + DatatypeCommunicator<ParallelIndexSet> redistribute, overlapComm; EnumItem<GridFlags,owner> fowner; EnumItem<GridFlags,overlap> foverlap; @@ -505,10 +505,10 @@ void testRedistributeIndicesBuffered(MPI_Comm comm) int nx = Nx/procs; // distributed indexset - typedef IndexSet<int,ParallelLocalIndex<GridFlags> > IndexSet; - IndexSet sendIndexSet; + typedef ParallelIndexSet<int,ParallelLocalIndex<GridFlags> > ParallelIndexSet; + ParallelIndexSet sendIndexSet; // global indexset - IndexSet receiveIndexSet; + ParallelIndexSet receiveIndexSet; Array array, redistributedArray; @@ -569,7 +569,7 @@ void testRedistributeIndicesBuffered(MPI_Comm comm) std::cout<< rank<<": distributed and global index set!"<<std::endl<<std::flush; - typedef RemoteIndices<IndexSet> RemoteIndices; + typedef RemoteIndices<ParallelIndexSet> RemoteIndices; RemoteIndices redistributeIndices(sendIndexSet, receiveIndexSet, comm); RemoteIndices overlapIndices(receiveIndexSet, receiveIndexSet, comm); @@ -577,15 +577,15 @@ void testRedistributeIndicesBuffered(MPI_Comm comm) overlapIndices.rebuild<false>(); redistributeIndices.rebuild<true>(); - Interface<IndexSet> redistributeInterface, overlapInterface; + Interface<ParallelIndexSet> redistributeInterface, overlapInterface; EnumItem<GridFlags,owner> fowner; EnumItem<GridFlags,overlap> foverlap; redistributeInterface.build(redistributeIndices, fowner, fowner); overlapInterface.build(overlapIndices, fowner, foverlap); - BufferedCommunicator<IndexSet> redistribute; - BufferedCommunicator<IndexSet> overlapComm; + BufferedCommunicator<ParallelIndexSet> redistribute; + BufferedCommunicator<ParallelIndexSet> overlapComm; redistribute.build(array, redistributedArray, redistributeInterface); overlapComm.build<Array>(overlapInterface); diff --git a/istl/test/selectiontest.cc b/istl/test/selectiontest.cc index e5781b9c9..017f75ba6 100644 --- a/istl/test/selectiontest.cc +++ b/istl/test/selectiontest.cc @@ -47,7 +47,7 @@ void test() // Process configuration const int ALSIZE=55; - Dune::IndexSet<int,Dune::ParallelLocalIndex<GridFlags>,ALSIZE> distIndexSet; + Dune::ParallelIndexSet<int,Dune::ParallelLocalIndex<GridFlags>,ALSIZE> distIndexSet; distIndexSet.beginResize(); diff --git a/istl/test/syncertest.cc b/istl/test/syncertest.cc index 722972500..aeb5a5323 100644 --- a/istl/test/syncertest.cc +++ b/istl/test/syncertest.cc @@ -225,8 +225,8 @@ int testIndicesSyncer() // distributed indexset // typedef ParallelLocalIndex<GridFlags> LocalIndexType; - typedef Dune::IndexSet<int,Dune::ParallelLocalIndex<GridFlags> > IndexSet; - IndexSet indexSet, changedIndexSet; + typedef Dune::ParallelIndexSet<int,Dune::ParallelLocalIndex<GridFlags> > ParallelIndexSet; + ParallelIndexSet indexSet, changedIndexSet; // Set up the indexsets. int start = std::max(rank*nx-1,0); @@ -252,8 +252,8 @@ int testIndicesSyncer() indexSet.endResize(); changedIndexSet.endResize(); - Dune::RemoteIndices<IndexSet> remoteIndices(indexSet, indexSet, MPI_COMM_WORLD); - Dune::RemoteIndices<IndexSet> changedRemoteIndices(changedIndexSet, changedIndexSet, MPI_COMM_WORLD); + Dune::RemoteIndices<ParallelIndexSet> remoteIndices(indexSet, indexSet, MPI_COMM_WORLD); + Dune::RemoteIndices<ParallelIndexSet> changedRemoteIndices(changedIndexSet, changedIndexSet, MPI_COMM_WORLD); remoteIndices.rebuild<false>(); changedRemoteIndices.rebuild<false>(); @@ -270,7 +270,7 @@ int testIndicesSyncer() deleteOverlapEntries(changedIndexSet, changedRemoteIndices); std::cout<<"Changed: "<<changedIndexSet<<std::endl<<changedRemoteIndices<<std::endl; - Dune::IndicesSyncer<IndexSet> syncer(changedIndexSet, changedRemoteIndices); + Dune::IndicesSyncer<ParallelIndexSet> syncer(changedIndexSet, changedRemoteIndices); // return 0; std::cout<<"Syncing!"<<std::endl; -- GitLab