Version: SMASH-1.5
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  smash::NeedsToWrap { smash::NeedsToWrap::PlusLength, smash::NeedsToWrap::No, smash::NeedsToWrap::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)
 
template<typename T >
static std::ostream & std::operator<< (std::ostream &out, const std::initializer_list< T > &v)
 
template<typename T , std::size_t N>
static std::ostream & std::operator<< (std::ostream &out, const std::array< T, N > &a)
 

Function Documentation

◆ operator<<() [1/3]

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

Definition at line 22 of file grid.cc.

22  {
23  auto column = out.tellp();
24  out << "{ ";
25  for (const auto &x : v) {
26  if (out.tellp() - column >= 100) {
27  out << '\n';
28  column = out.tellp();
29  }
30  out << x << ' ';
31  }
32  return out << '}';
33 }

◆ operator<<() [2/3]

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

Definition at line 36 of file grid.cc.

37  {
38  auto column = out.tellp();
39  out << "{ ";
40  for (const auto &x : v) {
41  if (out.tellp() - column >= 100) {
42  out << '\n';
43  column = out.tellp();
44  }
45  out << x << ' ';
46  }
47  return out << '}';
48 }

◆ 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

Definition at line 51 of file grid.cc.

51  {
52  auto column = out.tellp();
53  out << "{ ";
54  for (const auto &x : a) {
55  if (out.tellp() - column >= 100) {
56  out << '\n';
57  column = out.tellp();
58  }
59  out << x << ' ';
60  }
61  return out << '}';
62 }