MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MercuryBase.h File Reference
#include <iostream>
#include "DPMBase.h"
#include "HGrid.h"

Go to the source code of this file.

Classes

class  MercuryBase
 This is the base class for both Mercury2D and Mercury3D. Note the actually abstract grid is defined in the class Grid defined below. More...
 

Enumerations

enum  HGridMethod { BOTTOMUP, TOPDOWN }
 Enum class that indicates how particles in different levels (cross level checking) of the HGrid are checked for interactions. More...
 
enum  HGridDistribution { OLDHGRID, LINEAR, EXPONENTIAL, USER }
 Enum that indicates what the ratio of the size of the cells in different levels is. More...
 

Functions

std::ostream & operator<< (std::ostream &os, HGridMethod h)
 
std::istream & operator>> (std::istream &is, HGridMethod &h)
 
std::ostream & operator<< (std::ostream &os, HGridDistribution h)
 
std::istream & operator>> (std::istream &is, HGridDistribution &h)
 

Enumeration Type Documentation

Enum that indicates what the ratio of the size of the cells in different levels is.

The options for the distribution of cell-sizes are:

  • OLDHGRID Each cell is twice as big as the one below it, for example (1, 2, 4, 8, ...).
  • LINEAR The difference between the cell sizes at each level is the same, for example (1, 2, 3, 4, ...).
  • EXPONENTIAL Each cell size is a constant factor c > 1 bigger than the one below it, for example with c = 3, (1, 3, 9, 27, ...).
  • USER The cell sizes are defined by the user.
Enumerator
OLDHGRID 
LINEAR 
EXPONENTIAL 
USER 

Definition at line 83 of file MercuryBase.h.

Enum class that indicates how particles in different levels (cross level checking) of the HGrid are checked for interactions.

With this enum class, one can choose how they want to check particles in different levels for interactions, so called cross-level checking BOTTOMUP means that small particles are inserted into the coarser HGrid-level, TOPDOWN means that big particles are inserted into a finer HGrid-level when checking for interactions.

Enumerator
BOTTOMUP 
TOPDOWN 

Definition at line 43 of file MercuryBase.h.

44 {
46 };

Function Documentation

std::ostream& operator<< ( std::ostream &  os,
HGridMethod  h 
)
inline

Definition at line 48 of file MercuryBase.h.

References BOTTOMUP.

49 {
50  if (h == BOTTOMUP)
51  return os << "BOTTOMUP";
52  else
53  return os << "TOPDOWN";
54 }
std::ostream& operator<< ( std::ostream &  os,
HGridDistribution  h 
)
inline

Definition at line 88 of file MercuryBase.h.

References EXPONENTIAL, LINEAR, and OLDHGRID.

89 {
90  if (h == OLDHGRID)
91  return os << "OLDHGRID";
92  else if (h == LINEAR)
93  return os << "LINEAR";
94  else if (h == EXPONENTIAL)
95  return os << "EXPONENTIAL";
96  else
97  return os << "USER";
98 }
std::istream& operator>> ( std::istream &  is,
HGridMethod h 
)
inline

Definition at line 56 of file MercuryBase.h.

References BOTTOMUP, ERROR, logger, and TOPDOWN.

57 {
58  std::string s;
59  is >> s;
60  if (s == "BOTTOMUP")
61  h = BOTTOMUP;
62  else if (s == "TOPDOWN")
63  h = TOPDOWN;
64  else
65  {
66  logger(ERROR, "HGridMethod could not be read: %", s);
67  }
68  return is;
69 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
LL< Log::ERROR > ERROR
Error log level.
Definition: Logger.cc:53
std::istream& operator>> ( std::istream &  is,
HGridDistribution h 
)
inline

Definition at line 100 of file MercuryBase.h.

References ERROR, EXPONENTIAL, LINEAR, logger, OLDHGRID, and USER.

101 {
102  std::string s;
103  is >> s;
104  if (s == "OLDHGRID")
105  h = OLDHGRID;
106  else if (s == "LINEAR")
107  h = LINEAR;
108  else if (s == "EXPONENTIAL")
109  h = EXPONENTIAL;
110  else if (s == "USER")
111  h = USER;
112  else
113  {
114  logger(ERROR,"HGridDistribution could not be read: %",s);
115  }
116  return is;
117 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
LL< Log::ERROR > ERROR
Error log level.
Definition: Logger.cc:53