4#ifndef DUNE_PLOCALINDEX_HH
5#define DUNE_PLOCALINDEX_HH
27 template<
class T>
class ParallelLocalIndex;
37 os<<
"{local="<<index.localIndex_<<
", attr="<<T(index.attribute_)<<
", public="
38 <<(index.public_ ? true :
false)<<
"}";
118 inline size_t local()
const;
123 inline operator size_t()
const;
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) {
296 MPI_Get_address(&rep, &base);
297 MPI_Get_address(&(rep.attribute_), &disp);
301 MPI_Type_create_struct(1, &length, &disp, types, &tmp);
304 MPI_Type_commit(&type);
Traits classes for mapping types onto MPI_Datatype.
Provides classes for use as the local index in ParallelIndexSet.
Provides a map between global and local indices.
std::ostream & operator<<(std::ostream &s, const std::array< T, N > &e)
Output operator for array.
Definition array.hh:28
EnableIfInterOperable< T1, T2, bool >::type operator==(const ForwardIteratorFacade< T1, V1, R1, D > &lhs, const ForwardIteratorFacade< T2, V2, R2, D > &rhs)
Checks for equality.
Definition iteratorfacades.hh:233
EnableIfInterOperable< T1, T2, bool >::type operator!=(const ForwardIteratorFacade< T1, V1, R1, D > &lhs, const ForwardIteratorFacade< T2, V2, R2, D > &rhs)
Checks for inequality.
Definition iteratorfacades.hh:255
bool isPublic() const
Check whether the index might also be known other processes.
Definition plocalindex.hh:268
void setAttribute(const Attribute &attribute)
Set the attribute of the index.
Definition plocalindex.hh:242
size_t local() const
get the local index.
Definition plocalindex.hh:248
LocalIndexState
The states avaiable for the local indices.
Definition localindex.hh:26
void setState(const LocalIndexState &state)
Set the state.
Definition plocalindex.hh:280
ParallelLocalIndex< Attribute > & operator=(size_t index)
Assign a new local index.
Definition plocalindex.hh:261
LocalIndexState state() const
Get the state.
Definition plocalindex.hh:274
ParallelLocalIndex()
Parameterless constructor.
Definition plocalindex.hh:229
const Attribute attribute() const
Get the attribute of the index.
Definition plocalindex.hh:235
@ VALID
Definition localindex.hh:26
Dune namespace.
Definition alignment.hh:11
A traits class describing the mapping of types onto MPI_Datatypes.
Definition mpitraits.hh:39
static MPI_Datatype getType()
Definition mpitraits.hh:46
Definition indexset.hh:614
An index present on the local process with an additional attribute flag.
Definition plocalindex.hh:47
T Attribute
The type of the attributes. Normally this will be an enumeration like.
Definition plocalindex.hh:62
static bool compare(const ParallelLocalIndex< T > &t1, const ParallelLocalIndex< T > &t2)
Definition plocalindex.hh:193