5#ifndef DUNE_COMMON_PARALLEL_PLOCALINDEX_HH
6#define DUNE_COMMON_PARALLEL_PLOCALINDEX_HH
42 os<<
"{local="<<index.localIndex_<<
", attr="<<T(index.attribute_)<<
", public="
43 <<(index.public_ ? true :
false)<<
"}";
123 inline size_t local()
const;
128 inline operator size_t()
const;
214 static MPI_Datatype type;
222 : localIndex_(0), attribute_(static_cast<char>(
attribute)),
223 public_(static_cast<char>(
isPublic)), state_(static_cast<char>(
VALID))
230 public_(static_cast<char>(
isPublic)), state_(static_cast<char>(
VALID))
235 : localIndex_(0), attribute_(), public_(static_cast<char>(false)),
236 state_(static_cast<char>(
VALID))
242 return T(attribute_);
275 return static_cast<bool>(public_);
287 state_=
static_cast<char>(
state);
293 MPI_Datatype MPITraits<ParallelLocalIndex<T> >
::getType()
296 if(type==MPI_DATATYPE_NULL) {
301 MPI_Get_address(&rep, &base);
302 MPI_Get_address(&(rep.attribute_), &disp);
306 MPI_Type_create_struct(1, &length, &disp, types, &tmp);
309 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 bigunsignedint< k > &x)
Definition bigunsignedint.hh:301
bool isPublic() const
Check whether the index might also be known other processes.
Definition plocalindex.hh:273
void setAttribute(const Attribute &attribute)
Set the attribute of the index.
Definition plocalindex.hh:247
size_t local() const
get the local index.
Definition plocalindex.hh:253
LocalIndexState
The states available for the local indices.
Definition localindex.hh:28
void setState(const LocalIndexState &state)
Set the state.
Definition plocalindex.hh:285
static MPI_Datatype getType()
Definition plocalindex.hh:293
ParallelLocalIndex< Attribute > & operator=(size_t index)
Assign a new local index.
Definition plocalindex.hh:266
LocalIndexState state() const
Get the state.
Definition plocalindex.hh:279
ParallelLocalIndex(const Attribute &attribute, bool isPublic)
Constructor.
Definition plocalindex.hh:221
ParallelLocalIndex()
Parameterless constructor.
Definition plocalindex.hh:234
const Attribute attribute() const
Get the attribute of the index.
Definition plocalindex.hh:240
@ VALID
Definition localindex.hh:28
Dune namespace
Definition alignedallocator.hh:13
constexpr auto operator!=(const HybridMultiIndex< S... > &lhs, const HybridMultiIndex< T... > &rhs)
Compare two HybridMultiIndexs for inequality.
Definition hybridmultiindex.hh:441
constexpr bool operator==(const HybridMultiIndex< S... > &lhs, const HybridMultiIndex< T... > &rhs)
Compare two HybridMultiIndexs for value equality.
Definition hybridmultiindex.hh:404
A traits class describing the mapping of types onto MPI_Datatypes.
Definition mpitraits.hh:41
static MPI_Datatype getType()
Definition mpitraits.hh:48
Definition indexset.hh:615
An index present on the local process with an additional attribute flag.
Definition plocalindex.hh:52
T Attribute
The type of the attributes. Normally this will be an enumeration like.
Definition plocalindex.hh:67
static bool compare(const ParallelLocalIndex< T > &t1, const ParallelLocalIndex< T > &t2)
Definition plocalindex.hh:198