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

◆ HGridDistribution

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 
63 {
65 };
@ OLDHGRID
Definition: MercuryBase.h:64
@ EXPONENTIAL
Definition: MercuryBase.h:64
@ LINEAR
Definition: MercuryBase.h:64
@ USER
Definition: MercuryBase.h:64

◆ HGridMethod

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 
23 {
25 };
@ BOTTOMUP
Definition: MercuryBase.h:24
@ TOPDOWN
Definition: MercuryBase.h:24

Function Documentation

◆ operator<<() [1/2]

std::ostream& operator<< ( std::ostream &  os,
HGridDistribution  h 
)
inline
68 {
69  if (h == OLDHGRID)
70  return os << "OLDHGRID";
71  else if (h == LINEAR)
72  return os << "LINEAR";
73  else if (h == EXPONENTIAL)
74  return os << "EXPONENTIAL";
75  else
76  return os << "USER";
77 }

References EXPONENTIAL, LINEAR, and OLDHGRID.

◆ operator<<() [2/2]

std::ostream& operator<< ( std::ostream &  os,
HGridMethod  h 
)
inline
28 {
29  if (h == BOTTOMUP)
30  return os << "BOTTOMUP";
31  else
32  return os << "TOPDOWN";
33 }

References BOTTOMUP.

◆ operator>>() [1/2]

std::istream& operator>> ( std::istream &  is,
HGridDistribution h 
)
inline
80 {
81  std::string s;
82  is >> s;
83  if (s == "OLDHGRID")
84  h = OLDHGRID;
85  else if (s == "LINEAR")
86  h = LINEAR;
87  else if (s == "EXPONENTIAL")
88  h = EXPONENTIAL;
89  else if (s == "USER")
90  h = USER;
91  else
92  {
93  logger(ERROR,"HGridDistribution could not be read: %",s);
94  }
95  return is;
96 }
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
LL< Log::ERROR > ERROR
Error log level.
Definition: Logger.cc:32
RealScalar s
Definition: level1_cplx_impl.h:130
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286

References ERROR, EXPONENTIAL, LINEAR, logger, OLDHGRID, s, oomph::Global_string_for_annotation::string(), and USER.

◆ operator>>() [2/2]

std::istream& operator>> ( std::istream &  is,
HGridMethod h 
)
inline
36 {
37  std::string s;
38  is >> s;
39  if (s == "BOTTOMUP")
40  h = BOTTOMUP;
41  else if (s == "TOPDOWN")
42  h = TOPDOWN;
43  else
44  {
45  logger(ERROR, "HGridMethod could not be read: %", s);
46  }
47  return is;
48 }

References BOTTOMUP, ERROR, logger, s, oomph::Global_string_for_annotation::string(), and TOPDOWN.