dune-grid 2.9.0
Classes | Public Types | Public Member Functions | List of all members
Dune::Torus< Communication, d > Class Template Reference

#include <dune/grid/yaspgrid/torus.hh>

Inheritance diagram for Dune::Torus< Communication, d >:
Inheritance graph

Classes

class  ProcListIterator
 

Public Types

typedef std::array< int, d > iTupel
 type used to pass tupels in and out More...
 

Public Member Functions

 Torus ()
 constructor making uninitialized object More...
 
 Torus (Communication comm, int tag, iTupel size, int overlap, const Yasp::Partitioning< d > *partitioner)
 make partitioner from communicator and coarse mesh size More...
 
int rank () const
 return own rank More...
 
iTupel coord () const
 return own coordinates More...
 
int procs () const
 return number of processes More...
 
const iTupeldims () const
 return dimensions of torus More...
 
int dims (int i) const
 return dimensions of torus in direction i More...
 
Communication comm () const
 return communicator More...
 
int tag () const
 return tag used by torus More...
 
bool inside (iTupel c) const
 return true if coordinate is inside torus More...
 
iTupel rank_to_coord (int rank) const
 map rank to coordinate in torus using lexicographic ordering More...
 
int coord_to_rank (iTupel coord) const
 map coordinate in torus to rank using lexicographic ordering More...
 
int rank_relative (int rank, int dir, int cnt) const
 return rank of process where its coordinate in direction dir has offset cnt (handles periodic case) More...
 
int color (const iTupel &coord) const
 assign color to given coordinate More...
 
int color (int rank) const
 assign color to given rank More...
 
int neighbors () const
 return the number of neighbors, which is $3^d-1$ More...
 
bool is_neighbor (iTupel delta, std::bitset< d > periodic) const
 return true if neighbor with given delta is a neighbor under the given periodicity More...
 
double partition (int rank, iTupel origin_in, iTupel size_in, iTupel &origin_out, iTupel &size_out) const
 partition the given grid onto the torus and return the piece of the process with given rank; returns load imbalance More...
 
ProcListIterator sendbegin () const
 first process in send list More...
 
ProcListIterator sendend () const
 end of send list More...
 
ProcListIterator recvbegin () const
 first process in receive list More...
 
ProcListIterator recvend () const
 last process in receive list More...
 
void send (int rank, void *buffer, int size) const
 store a send request; buffers are sent in order; handles also local requests with memcpy More...
 
void recv (int rank, void *buffer, int size) const
 store a receive request; buffers are received in order; handles also local requests with memcpy More...
 
void exchange () const
 exchange messages stored in request buffers; clear request buffers afterwards More...
 
double global_max (double x) const
 global max More...
 
void print (std::ostream &s) const
 print contents of torus object More...
 

Detailed Description

template<class Communication, int d>
class Dune::Torus< Communication, d >

Torus provides all the functionality to handle a toroidal communication structure:

Member Typedef Documentation

◆ iTupel

template<class Communication , int d>
typedef std::array<int, d> Dune::Torus< Communication, d >::iTupel

type used to pass tupels in and out

Constructor & Destructor Documentation

◆ Torus() [1/2]

template<class Communication , int d>
Dune::Torus< Communication, d >::Torus ( )
inline

constructor making uninitialized object

◆ Torus() [2/2]

template<class Communication , int d>
Dune::Torus< Communication, d >::Torus ( Communication  comm,
int  tag,
iTupel  size,
int  overlap,
const Yasp::Partitioning< d > *  partitioner 
)
inline

make partitioner from communicator and coarse mesh size

Member Function Documentation

◆ color() [1/2]

template<class Communication , int d>
int Dune::Torus< Communication, d >::color ( const iTupel coord) const
inline

assign color to given coordinate

◆ color() [2/2]

template<class Communication , int d>
int Dune::Torus< Communication, d >::color ( int  rank) const
inline

assign color to given rank

◆ comm()

template<class Communication , int d>
Communication Dune::Torus< Communication, d >::comm ( ) const
inline

return communicator

◆ coord()

template<class Communication , int d>
iTupel Dune::Torus< Communication, d >::coord ( ) const
inline

return own coordinates

◆ coord_to_rank()

template<class Communication , int d>
int Dune::Torus< Communication, d >::coord_to_rank ( iTupel  coord) const
inline

map coordinate in torus to rank using lexicographic ordering

◆ dims() [1/2]

template<class Communication , int d>
const iTupel & Dune::Torus< Communication, d >::dims ( ) const
inline

return dimensions of torus

◆ dims() [2/2]

template<class Communication , int d>
int Dune::Torus< Communication, d >::dims ( int  i) const
inline

return dimensions of torus in direction i

◆ exchange()

template<class Communication , int d>
void Dune::Torus< Communication, d >::exchange ( ) const
inline

exchange messages stored in request buffers; clear request buffers afterwards

◆ global_max()

template<class Communication , int d>
double Dune::Torus< Communication, d >::global_max ( double  x) const
inline

global max

◆ inside()

template<class Communication , int d>
bool Dune::Torus< Communication, d >::inside ( iTupel  c) const
inline

return true if coordinate is inside torus

◆ is_neighbor()

template<class Communication , int d>
bool Dune::Torus< Communication, d >::is_neighbor ( iTupel  delta,
std::bitset< d >  periodic 
) const
inline

return true if neighbor with given delta is a neighbor under the given periodicity

◆ neighbors()

template<class Communication , int d>
int Dune::Torus< Communication, d >::neighbors ( ) const
inline

return the number of neighbors, which is $3^d-1$

◆ partition()

template<class Communication , int d>
double Dune::Torus< Communication, d >::partition ( int  rank,
iTupel  origin_in,
iTupel  size_in,
iTupel origin_out,
iTupel size_out 
) const
inline

partition the given grid onto the torus and return the piece of the process with given rank; returns load imbalance

Parameters
rankrank of our processor
origin_inglobal origin
size_inglobal size
origin_outorigin of this processors interior
size_outsize of this processors interior

◆ print()

template<class Communication , int d>
void Dune::Torus< Communication, d >::print ( std::ostream &  s) const
inline

print contents of torus object

◆ procs()

template<class Communication , int d>
int Dune::Torus< Communication, d >::procs ( ) const
inline

return number of processes

◆ rank()

template<class Communication , int d>
int Dune::Torus< Communication, d >::rank ( ) const
inline

return own rank

◆ rank_relative()

template<class Communication , int d>
int Dune::Torus< Communication, d >::rank_relative ( int  rank,
int  dir,
int  cnt 
) const
inline

return rank of process where its coordinate in direction dir has offset cnt (handles periodic case)

◆ rank_to_coord()

template<class Communication , int d>
iTupel Dune::Torus< Communication, d >::rank_to_coord ( int  rank) const
inline

map rank to coordinate in torus using lexicographic ordering

◆ recv()

template<class Communication , int d>
void Dune::Torus< Communication, d >::recv ( int  rank,
void *  buffer,
int  size 
) const
inline

store a receive request; buffers are received in order; handles also local requests with memcpy

◆ recvbegin()

template<class Communication , int d>
ProcListIterator Dune::Torus< Communication, d >::recvbegin ( ) const
inline

first process in receive list

◆ recvend()

template<class Communication , int d>
ProcListIterator Dune::Torus< Communication, d >::recvend ( ) const
inline

last process in receive list

◆ send()

template<class Communication , int d>
void Dune::Torus< Communication, d >::send ( int  rank,
void *  buffer,
int  size 
) const
inline

store a send request; buffers are sent in order; handles also local requests with memcpy

◆ sendbegin()

template<class Communication , int d>
ProcListIterator Dune::Torus< Communication, d >::sendbegin ( ) const
inline

first process in send list

◆ sendend()

template<class Communication , int d>
ProcListIterator Dune::Torus< Communication, d >::sendend ( ) const
inline

end of send list

◆ tag()

template<class Communication , int d>
int Dune::Torus< Communication, d >::tag ( ) const
inline

return tag used by torus


The documentation for this class was generated from the following file: