Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Friends

LibGeoDecomp::MeshlessAdapter< TOPOLOGY > Class Template Reference

A utility class which supports users in porting meshless codes to LibGeoDecomp by superimposing a stencil structure, even though the actual cells may be connected by an irregular graph. More...

#include <meshlessadapter.h>

Collaboration diagram for LibGeoDecomp::MeshlessAdapter< TOPOLOGY >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef std::list< std::pair
< FloatCoord< DIM >, int > > 
CoordList
typedef Grid< CoordList, TOPOLOGY > CoordListGrid
typedef std::vector< std::pair
< FloatCoord< DIM >, int > > 
CoordVec
typedef std::vector
< std::vector< int > > 
Graph

Public Member Functions

 MeshlessAdapter (const FloatCoord< DIM > &dimensions=FloatCoord< DIM >(), double boxSize=1)
 creates an MeshlessAdapter which assumes that the coordinates of the cells are elementwise smaller than dimensions.
CoordListGrid grid () const
Coord< DIMposToCoord (const FloatCoord< DIM > &pos) const
void insert (CoordListGrid *grid, const FloatCoord< DIM > &pos, const int &id) const
bool search (const CoordListGrid &positions, const FloatCoord< DIM > &pos, std::set< int > *coords=0) const
 checks if the grid cell containing pos or any of its neighbors in its Moore neighborhood contains a vertex which is closer to pos than the boxSize.
CoordVec findAllPositions (const CoordListGrid &positions) const
double findOptimumBoxSize (const CoordVec &positions, const Graph &graph)
bool checkBoxSize (const CoordVec &positions, const Graph &graph)
const Coord< DIM > & getDiscreteDim () const
std::map< std::string, double > reportFillLevels (const CoordVec &positions) const
const double & getBoxSize () const

Static Public Attributes

static const int DIM = TOPOLOGY::DIM
static const int MAX_SIZE = 300000

Private Member Functions

void resetBoxSize (double newBoxSize)
bool searchList (const CoordList &list, const FloatCoord< DIM > &pos, std::set< int > *coords=0) const
double distance2 (const FloatCoord< DIM > &a, const FloatCoord< DIM > &b) const
 returns the square of the euclidean distance of a and b.
int manhattanDistance (const FloatCoord< DIM > &a, const FloatCoord< DIM > &b) const
bool intervalTooLarge (const Coord< DIM > &a, const Coord< DIM > &b)

Private Attributes

FloatCoord< DIMdimensions
Coord< DIMdiscreteDim
double scale
double radius2
double boxSize

Friends

class MeshlessAdapterTest

Detailed Description

template<class TOPOLOGY = Topologies::Torus<2>::Topology>
class LibGeoDecomp::MeshlessAdapter< TOPOLOGY >

A utility class which supports users in porting meshless codes to LibGeoDecomp by superimposing a stencil structure, even though the actual cells may be connected by an irregular graph.

Its purpose is mostly to aid with computing and verifying the grid geometry.


Member Typedef Documentation

template<class TOPOLOGY = Topologies::Torus<2>::Topology>
typedef std::list<std::pair<FloatCoord<DIM>, int> > LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::CoordList
template<class TOPOLOGY = Topologies::Torus<2>::Topology>
typedef Grid<CoordList, TOPOLOGY> LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::CoordListGrid
template<class TOPOLOGY = Topologies::Torus<2>::Topology>
typedef std::vector<std::pair<FloatCoord<DIM>, int> > LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::CoordVec
template<class TOPOLOGY = Topologies::Torus<2>::Topology>
typedef std::vector<std::vector<int> > LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::Graph

Constructor & Destructor Documentation

template<class TOPOLOGY = Topologies::Torus<2>::Topology>
LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::MeshlessAdapter ( const FloatCoord< DIM > &  dimensions = FloatCoord<DIM>(),
double  boxSize = 1 
) [inline, explicit]

creates an MeshlessAdapter which assumes that the coordinates of the cells are elementwise smaller than dimensions.

The stencil cells will be of size boxSize^DIMENSIONS.

References LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::boxSize, and LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::resetBoxSize().


Member Function Documentation

template<class TOPOLOGY = Topologies::Torus<2>::Topology>
bool LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::checkBoxSize ( const CoordVec positions,
const Graph graph 
) [inline]
template<class TOPOLOGY = Topologies::Torus<2>::Topology>
double LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::distance2 ( const FloatCoord< DIM > &  a,
const FloatCoord< DIM > &  b 
) const [inline, private]
template<class TOPOLOGY = Topologies::Torus<2>::Topology>
CoordVec LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::findAllPositions ( const CoordListGrid positions  )  const [inline]
template<class TOPOLOGY = Topologies::Torus<2>::Topology>
double LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::findOptimumBoxSize ( const CoordVec positions,
const Graph graph 
) [inline]
template<class TOPOLOGY = Topologies::Torus<2>::Topology>
const double& LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::getBoxSize (  )  const [inline]
template<class TOPOLOGY = Topologies::Torus<2>::Topology>
const Coord<DIM>& LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::getDiscreteDim (  )  const [inline]
template<class TOPOLOGY = Topologies::Torus<2>::Topology>
CoordListGrid LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::grid (  )  const [inline]
template<class TOPOLOGY = Topologies::Torus<2>::Topology>
void LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::insert ( CoordListGrid grid,
const FloatCoord< DIM > &  pos,
const int &  id 
) const [inline]
template<class TOPOLOGY = Topologies::Torus<2>::Topology>
bool LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::intervalTooLarge ( const Coord< DIM > &  a,
const Coord< DIM > &  b 
) [inline, private]
template<class TOPOLOGY = Topologies::Torus<2>::Topology>
int LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::manhattanDistance ( const FloatCoord< DIM > &  a,
const FloatCoord< DIM > &  b 
) const [inline, private]
template<class TOPOLOGY = Topologies::Torus<2>::Topology>
Coord<DIM> LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::posToCoord ( const FloatCoord< DIM > &  pos  )  const [inline]
template<class TOPOLOGY = Topologies::Torus<2>::Topology>
std::map<std::string, double> LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::reportFillLevels ( const CoordVec positions  )  const [inline]
template<class TOPOLOGY = Topologies::Torus<2>::Topology>
void LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::resetBoxSize ( double  newBoxSize  )  [inline, private]
template<class TOPOLOGY = Topologies::Torus<2>::Topology>
bool LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::search ( const CoordListGrid positions,
const FloatCoord< DIM > &  pos,
std::set< int > *  coords = 0 
) const [inline]

checks if the grid cell containing pos or any of its neighbors in its Moore neighborhood contains a vertex which is closer to pos than the boxSize.

May return a list of all found vertex IDs if coords is set.

References LibGeoDecomp::CoordBox< DIM >::begin(), LibGeoDecomp::CoordBox< DIM >::end(), LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::posToCoord(), and LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::searchList().

template<class TOPOLOGY = Topologies::Torus<2>::Topology>
bool LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::searchList ( const CoordList list,
const FloatCoord< DIM > &  pos,
std::set< int > *  coords = 0 
) const [inline, private]

Friends And Related Function Documentation

template<class TOPOLOGY = Topologies::Torus<2>::Topology>
friend class MeshlessAdapterTest [friend]

Member Data Documentation

template<class TOPOLOGY = Topologies::Torus<2>::Topology>
double LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::boxSize [private]
template<class TOPOLOGY = Topologies::Torus<2>::Topology>
const int LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::DIM = TOPOLOGY::DIM [static]
template<class TOPOLOGY = Topologies::Torus<2>::Topology>
FloatCoord<DIM> LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::dimensions [private]
template<class TOPOLOGY = Topologies::Torus<2>::Topology>
Coord<DIM> LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::discreteDim [private]
template<class TOPOLOGY = Topologies::Torus<2>::Topology>
const int LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::MAX_SIZE = 300000 [static]
template<class TOPOLOGY = Topologies::Torus<2>::Topology>
double LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::radius2 [private]
template<class TOPOLOGY = Topologies::Torus<2>::Topology>
double LibGeoDecomp::MeshlessAdapter< TOPOLOGY >::scale [private]

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