Version: SMASH-3.1
grid.cc File Reference
#include "smash/grid.h"
#include <stdexcept>
#include "smash/algorithms.h"
#include "smash/fourvector.h"
#include "smash/logging.h"
#include "smash/particledata.h"
#include "smash/threevector.h"

Go to the source code of this file.

Classes

struct  smash::NeighborLookup
 A strust containing the informations needed to search the neighboring cell. More...
 

Namespaces

 smash
 

Enumerations

enum class  smash::NeedsToWrap { smash::PlusLength , smash::No , smash::MinusLength }
 The options determining what to do if a particle flies out of the grids PlusLength: Used if a periodic boundary condition is applied and a particle passes through the lower bound of the grid. More...
 

Functions

template<typename T >
static std::ostream & std::operator<< (std::ostream &out, const std::vector< T > &v)
 Convenient printout function for a vector. More...
 
template<typename T >
static std::ostream & std::operator<< (std::ostream &out, const std::initializer_list< T > &v)
 Convenient printout function for an initializer list. More...
 
template<typename T , std::size_t N>
static std::ostream & std::operator<< (std::ostream &out, const std::array< T, N > &a)
 Convenient printout function for an array. More...
 

Variables

static constexpr int smash::LGrid = LogArea::Grid::id
 
static const std::initializer_list< GridBase::SizeType > smash::ZERO {0}
 
static const std::initializer_list< GridBase::SizeType > smash::ZERO_ONE {0, 1}
 
static const std::initializer_list< GridBase::SizeType > smash::MINUS_ONE_ZERO {-1, 0}
 
static const std::initializer_list< GridBase::SizeType > smash::MINUS_ONE_ZERO_ONE
 

Function Documentation

◆ operator<<() [1/3]

template<typename T >
static std::ostream& std::operator<< ( std::ostream &  out,
const std::vector< T > &  v 
)
static

Convenient printout function for a vector.

Parameters
[in]outoutput stream
[in]vvector to print out

Definition at line 27 of file grid.cc.

27  {
28  auto column = out.tellp();
29  out << "{ ";
30  for (const auto &x : v) {
31  if (out.tellp() - column >= 100) {
32  out << '\n';
33  column = out.tellp();
34  }
35  out << x << ' ';
36  }
37  return out << '}';
38 }

◆ operator<<() [2/3]

template<typename T >
static std::ostream& std::operator<< ( std::ostream &  out,
const std::initializer_list< T > &  v 
)
static

Convenient printout function for an initializer list.

Parameters
[in]outoutput stream
[in]vinitializer list to print out

Definition at line 46 of file grid.cc.

47  {
48  auto column = out.tellp();
49  out << "{ ";
50  for (const auto &x : v) {
51  if (out.tellp() - column >= 100) {
52  out << '\n';
53  column = out.tellp();
54  }
55  out << x << ' ';
56  }
57  return out << '}';
58 }

◆ operator<<() [3/3]

template<typename T , std::size_t N>
static std::ostream& std::operator<< ( std::ostream &  out,
const std::array< T, N > &  a 
)
static

Convenient printout function for an array.

Parameters
[in]outoutput stream
[in]aarray to print out

Definition at line 66 of file grid.cc.

66  {
67  auto column = out.tellp();
68  out << "{ ";
69  for (const auto &x : a) {
70  if (out.tellp() - column >= 100) {
71  out << '\n';
72  column = out.tellp();
73  }
74  out << x << ' ';
75  }
76  return out << '}';
77 }