ESyS-Particle  2.3.4
nt_block.h
Go to the documentation of this file.
1 // //
3 // Copyright (c) 2003-2017 by The University of Queensland //
4 // Centre for Geoscience Computing //
5 // http://earth.uq.edu.au/centre-geoscience-computing //
6 // //
7 // Primary Business: Brisbane, Queensland, Australia //
8 // Licensed under the Open Software License version 3.0 //
9 // http://www.apache.org/licenses/LICENSE-2.0 //
10 // //
12 
13 #ifndef __NT_BLOCK_H
14 #define __NT_BLOCK_H
15 
16 //--- project includes ---
17 #include "ntable/src/ntb_iter.h"
18 #include "ntable/src/ntable.h"
19 
20 //--- forward decls ---
21 template <typename T>
22 class NTBlock;
23 
24 template <typename T> bool operator==(const NTBlock<T>&,const NTBlock<T>&);
25 template <typename T> bool operator!=(const NTBlock<T>&,const NTBlock<T>&);
26 template <typename T> ostream& operator<<(ostream &, const NTBlock<T>&);
31 template <typename T>
32 class NTBlock
33 {
34  public: // types
36  typedef NTBlock_iter<T> const_iterator; // dodgy
37  typedef T value_type;
38 
39  private:
42 
43  public:
44  NTBlock();
45  NTBlock(NeighborTable<T>*,int,int,int,int,int,int);
46 
47  unsigned int size();
48 
49  // begin and end iterators
50  iterator begin();
51  iterator end();
52 
53  /* iterator rbegin(); */
54 /* iterator rend(); */
55 
57  unsigned int nparts_at_gridpoint(int x,int y,int z) const {return m_table->nparts_at_gridpoint(m_table->index(x,y,z));};
58 
59  // access ops
60  T* ptr(int,int,int,int);
61  T& ref(int,int,int,int);
62 
63  //comparison
64  friend bool operator== <>(const NTBlock&,const NTBlock&);
65  friend bool operator!= <>(const NTBlock&,const NTBlock&);
66 
67  friend ostream& operator<< <>(ostream &, const NTBlock &);
68 
69  friend class NTBlock_iter<T>;
70 };
71 
72 #include "ntable/src/nt_block.hpp"
73 
74 #endif //__NT_BLOCK_H
NTBlock
representation of a slab of the search array of a NeigborTable
Definition: nt_block.h:33
NTBlock::m_ymin
int m_ymin
Definition: nt_block.h:41
operator==
bool operator==(const NTBlock< T > &, const NTBlock< T > &)
Definition: nt_block.hpp:159
NTBlock::m_xmin
int m_xmin
Definition: nt_block.h:41
NTBlock::ref
T & ref(int, int, int, int)
Definition: nt_block.hpp:146
NTBlock::m_zmax
int m_zmax
Definition: nt_block.h:41
ntable.h
ntb_iter.h
NTBlock::nparts_at_gridpoint
unsigned int nparts_at_gridpoint(int x, int y, int z) const
< number of particles at a given gridpoint
Definition: nt_block.h:57
NTBlock::m_zmin
int m_zmin
Definition: nt_block.h:41
operator!=
bool operator!=(const NTBlock< T > &, const NTBlock< T > &)
Definition: nt_block.hpp:174
NTBlock_iter
iterator for a NTBlock
Definition: ntb_iter.h:39
NTBlock::begin
iterator begin()
Definition: nt_block.hpp:73
NTBlock::iterator
NTBlock_iter< T > iterator
Definition: nt_block.h:35
NTBlock::const_iterator
NTBlock_iter< T > const_iterator
Definition: nt_block.h:36
NTBlock::size
unsigned int size()
Definition: nt_block.hpp:56
NTBlock::m_xmax
int m_xmax
Definition: nt_block.h:41
nt_block.hpp
NeighborTable
class for neighbor search
Definition: ntable.h:68
NTBlock::m_ymax
int m_ymax
Definition: nt_block.h:41
NTBlock::ptr
T * ptr(int, int, int, int)
Definition: nt_block.hpp:133
NTBlock::value_type
T value_type
Definition: nt_block.h:37
NTBlock::NTBlock
NTBlock()
Definition: nt_block.hpp:17
operator<<
ostream & operator<<(ostream &, const NTBlock< T > &)
Definition: nt_block.hpp:193
NTBlock::end
iterator end()
Definition: nt_block.hpp:107
NTBlock::m_table
NeighborTable< T > * m_table
Definition: nt_block.h:40