4 #ifndef DUNE_PLOCALINDEX_HH 5 #define DUNE_PLOCALINDEX_HH 35 std::ostream& operator<<(std::ostream& os, const ParallelLocalIndex<T>& index)
37 os<<
"{local="<<index.localIndex_<<
", attr="<<T(index.attribute_)<<
", public=" 38 <<(index.public_ ? true :
false)<<
"}";
106 inline const Attribute
attribute()
const;
118 inline size_t local()
const;
123 inline operator size_t()
const;
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_);
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);
void setState(const LocalIndexState &state)
Set the state.
Definition: plocalindex.hh:280
Definition: localindex.hh:26
An index present on the local process with an additional attribute flag.
Definition: plocalindex.hh:27
LocalIndexState
The states avaiable for the local indices.
Definition: localindex.hh:26
static MPI_Datatype getType()
Definition: mpitraits.hh:45
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
ParallelLocalIndex< Attribute > & operator=(size_t index)
Assign a new local index.
Definition: plocalindex.hh:261
Traits classes for mapping types onto MPI_Datatype.
const Attribute attribute() const
Get the attribute of the index.
Definition: plocalindex.hh:235
static bool compare(const ParallelLocalIndex< T > &t1, const ParallelLocalIndex< T > &t2)
Definition: plocalindex.hh:193
bool isPublic() const
Check whether the index might also be known other processes.
Definition: plocalindex.hh:268
Provides classes for use as the local index in ParallelIndexSet.
Definition: indexset.hh:613
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
size_t local() const
get the local index.
Definition: plocalindex.hh:248
void setAttribute(const Attribute &attribute)
Set the attribute of the index.
Definition: plocalindex.hh:242
Dune namespace.
Definition: alignedallocator.hh:9
T Attribute
The type of the attributes. Normally this will be an enumeration like.
Definition: plocalindex.hh:62
ParallelLocalIndex()
Parameterless constructor.
Definition: plocalindex.hh:229
LocalIndexState state() const
Get the state.
Definition: plocalindex.hh:274
A traits class describing the mapping of types onto MPI_Datatypes.
Definition: bigunsignedint.hh:25
Provides a map between global and local indices.