Go to the documentation of this file.
4 #ifndef DUNE_PLOCALINDEX_HH
5 #define DUNE_PLOCALINDEX_HH
37 os<<
"{local="<<index.localIndex_<<
", attr="<<T(index.attribute_)<<
", public="
38 <<(index.public_ ? true :
false)<<
"}";
46 class ParallelLocalIndex
52 friend std::ostream& operator<<<>(std::ostream& os,
const ParallelLocalIndex<T>& index);
118 inline size_t local()
const;
123 inline operator size_t()
const;
174 if(p1.local()!=p2.local())
176 if(p1.attribute()!=p2.attribute())
178 if(p1.isPublic()!=p2.isPublic())
195 return t1.attribute()<t2.attribute();
204 class MPITraits<ParallelLocalIndex<T> >
207 static MPI_Datatype getType();
209 static MPI_Datatype type;
217 : localIndex_(0), attribute_(static_cast<char>(attribute)),
218 public_(static_cast<char>(isPublic)), state_(static_cast<char>(
VALID))
224 : localIndex_(local), attribute_(static_cast<char>(attribute)),
225 public_(static_cast<char>(isPublic)), state_(static_cast<char>(
VALID))
230 : localIndex_(0), attribute_(), public_(static_cast<char>(false)),
231 state_(static_cast<char>(
VALID))
237 return T(attribute_);
244 attribute_ = attribute;
270 return static_cast<bool>(public_);
282 state_=
static_cast<char>(state);
291 if(type==MPI_DATATYPE_NULL) {
295 ParallelLocalIndex<T> rep;
296 MPI_Get_address(&rep, &base);
297 MPI_Get_address(&(rep.attribute_), &disp);
301 MPI_Type_create_struct(1, &length, &disp, types, &tmp);
303 MPI_Type_create_resized(tmp, 0,
sizeof(ParallelLocalIndex<T>), &type);
304 MPI_Type_commit(&type);
312 MPI_Datatype MPITraits<ParallelLocalIndex<T> >::type = MPI_DATATYPE_NULL;
ParallelLocalIndex< Attribute > & operator=(size_t index)
Assign a new local index.
Definition: plocalindex.hh:261
size_t local() const
get the local index.
Definition: plocalindex.hh:248
LocalIndexState
The states avaiable for the local indices.
Definition: localindex.hh:26
bool isPublic() const
Check whether the index might also be known other processes.
Definition: plocalindex.hh:268
T Attribute
The type of the attributes. Normally this will be an enumeration like.
Definition: plocalindex.hh:62
@ VALID
Definition: localindex.hh:26
Definition: indexset.hh:615
constexpr bool operator!=(const DebugAllocator< T > &, const DebugAllocator< T > &)
check whether allocators are not equivalent
Definition: debugallocator.hh:318
Provides a map between global and local indices.
std::ostream & operator<<(std::ostream &s, const bigunsignedint< k > &x)
Definition: bigunsignedint.hh:273
Provides classes for use as the local index in ParallelIndexSet.
An index present on the local process with an additional attribute flag.
Definition: plocalindex.hh:27
static bool compare(const ParallelLocalIndex< T > &t1, const ParallelLocalIndex< T > &t2)
Definition: plocalindex.hh:193
Definition: indexset.hh:77
const Attribute attribute() const
Get the attribute of the index.
Definition: plocalindex.hh:235
ParallelLocalIndex()
Parameterless constructor.
Definition: plocalindex.hh:229
void setState(const LocalIndexState &state)
Set the state.
Definition: plocalindex.hh:280
void setAttribute(const Attribute &attribute)
Set the attribute of the index.
Definition: plocalindex.hh:242
constexpr bool operator==(const DebugAllocator< T > &, const DebugAllocator< T > &)
check whether allocators are equivalent
Definition: debugallocator.hh:310
Traits classes for mapping types onto MPI_Datatype.
LocalIndexState state() const
Get the state.
Definition: plocalindex.hh:274
Dune namespace.
Definition: alignedallocator.hh:13