MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BaseCG Class Referenceabstract

Base class of all CG objects, needed to store the various CG objects in the CGHandler. More...

#include <BaseCG.h>

+ Inheritance diagram for BaseCG:

Public Member Functions

 BaseCG ()
 Simple constructor, sets default values. More...
 
 BaseCG (const BaseCG &p)=default
 Default copy constructor, copies all values. More...
 
 ~BaseCG () override=default
 Default destructor, does nothing. More...
 
void read (std::istream &is) override
 Currently, no read functions are implemented for the CGHandler, but the function is required for any derivative of BaseObject. More...
 
void write (std::ostream &os) const override
 Writes class content into an output stream, usually a stat file. More...
 
void clear ()
 This class seems to have no use (?), but is required for any derivative of BaseObject. More...
 
virtual BaseCGcopy () const =0
 Copy operator. Required for BaseHandler::copyAndAddObject. More...
 
virtual void initialise ()=0
 Called at the beginning of the DPM simulation to initialise the cg evaluation and to open the statFile. More...
 
virtual void evaluate ()=0
 Called after a given number of time steps (statFile::saveCount_) to evaluate the CG fields. More...
 
virtual void finish ()=0
 Called at the end of the DPM simulation to finish the cg evaluation and to close the statFile. More...
 
void setHandler (CGHandler *handler)
 Sets handler_, the pointer to the CGHandler. More...
 
CGHandlergetHandler () const
 Returns handler_, a pointer to the CGHandler. More...
 
virtual void setWidth (Mdouble width)=0
 Sets width_, the coarse-graining width. More...
 
virtual Mdouble getWidth () const =0
 Returns width_, the coarse-graining width. More...
 
void setNZ (std::size_t nZ)
 Sets nZ_, the number of spatial mesh points in the z-direction. More...
 
std::size_t getNZ () const
 Returns nZ_, the number of spatial mesh points in the z-direction. More...
 
void setNY (std::size_t nY)
 Sets nY_, the number of spatial mesh points in the y-direction. More...
 
std::size_t getNY () const
 Returns nY_, the number of spatial mesh points in the y-direction. More...
 
void setNX (std::size_t nX)
 Sets nX_, the number of spatial mesh points in the x-direction. More...
 
std::size_t getNX () const
 Returns nX_, the number of spatial mesh points in the x-direction. More...
 
void setN (std::size_t n)
 Sets nX_, nY_, nZ_, the number of spatial mesh points in each cartesian direction. More...
 
void setN (std::array< std::size_t, 3 > n)
 Sets nX_, nY_, nZ_, the number of spatial mesh points in each cartesian direction. More...
 
void setH (Mdouble h)
 Sets nX_, nY_, nZ_, the number of spatial mesh points in each cartesian direction. However, instead of explicitly defining n, the mesh size h=(max-min)/n is defined. More...
 
void setHX (Mdouble h)
 Sets nX_ the number of spatial mesh points in the X-direction. Instead of explicitly defining nX, the mesh size hX=(max.X-min.X)/nX is defined. More...
 
void setHY (Mdouble h)
 Sets nX_ the number of spatial mesh points in the X-direction. Instead of explicitly defining nX, the mesh size hX=(max.X-min.X)/nX is defined. More...
 
void setHZ (Mdouble h)
 Sets nX_ the number of spatial mesh points in the X-direction. Instead of explicitly defining nX, the mesh size hX=(max.X-min.X)/nX is defined. More...
 
void setTimeMin (Mdouble timeMin)
 Sets timeMin_, the lower limit of the temporal domain. More...
 
void setTimeMax (Mdouble timeMax)
 Sets timeMax_, the upper limit of the temporal domain. More...
 
Mdouble getTimeMin () const
 Returns timeMin_, the lower limit of the temporal domain. More...
 
Mdouble getTimeMax () const
 Returns timeMax_, the upper limit of the temporal domain. More...
 
void setMin (Vec3D min)
 Sets max_, the lower limit of the spatial domain. More...
 
void setX (Mdouble min, Mdouble max)
 Sets min_.X, max_.X, the limits of the spatial domain in X. More...
 
void setY (Mdouble min, Mdouble max)
 Sets min_.Y, max_.Y, the limits of the spatial domain in Y. More...
 
void setZ (Mdouble min, Mdouble max)
 Sets min_.Z, max_.Z, the limits of the spatial domain in Z. More...
 
void setXGrid (Mdouble min, Mdouble max, Mdouble h)
 
void setYGrid (Mdouble min, Mdouble max, Mdouble h)
 
void setZGrid (Mdouble min, Mdouble max, Mdouble h)
 
void setGrid (Vec3D min, Vec3D max, Mdouble h)
 
void setMax (Vec3D max)
 Sets max_, the upper limit of the spatial domain. More...
 
Vec3D getMin () const
 Returns min_, the lower limit of the spatial domain. More...
 
Vec3D getMax () const
 Returns max_, the upper limit of the spatial domain. More...
 
void selectSpecies (unsigned speciesIndex)
 
void setSelectedParticle (const std::function< const bool(const BaseInteractable *)> &selectedParticle)
 
void setEps (Mdouble eps)
 
Mdouble getEps () const
 
void setAverageBeyondDomain (const bool val)
 
bool getAverageBeyondDomain () const
 
virtual void setStandardDeviation (Mdouble std)=0
 
virtual void setRadius (Mdouble radius)=0
 
- Public Member Functions inherited from BaseObject
 BaseObject ()=default
 Default constructor. More...
 
 BaseObject (const BaseObject &p)=default
 Copy constructor, copies all the objects BaseObject contains. More...
 
virtual ~BaseObject ()=default
 virtual destructor More...
 
virtual std::string getName () const =0
 A purely virtual function. More...
 
virtual void moveInHandler (unsigned int index)
 Except that it is virtual, it does the same thing as setIndex() does. More...
 
void setIndex (unsigned int index)
 Allows one to assign an index to an object in the handler/container. More...
 
void setId (unsigned long id)
 Assigns a unique identifier to each object in the handler (container) which remains constant even after the object is deleted from the container/handler. More...
 
unsigned int getIndex () const
 Returns the index of the object in the handler. More...
 
unsigned int getId () const
 Returns the unique identifier of any particular object. More...
 
void setGroupId (unsigned groupId)
 
unsigned getGroupId () const
 

Public Attributes

File statFile
 File class to handle the output into a .stat file. More...
 

Protected Attributes

CGHandlerhandler_
 
std::size_t nX_
 
std::size_t nY_
 
std::size_t nZ_
 
Mdouble eps_
 
Mdouble timeMin_
 
Mdouble timeMax_
 
Vec3D min_
 
Vec3D max_
 
std::function< bool(const
BaseInteractable *)> 
selectedParticle_
 
bool averageBeyondDomain_ = true
 Determines whether particles outside the domain are considered when computing the averaged fields. More...
 

Detailed Description

Base class of all CG objects, needed to store the various CG objects in the CGHandler.

The CGHandler contains a set of BaseCG* pointers, which can contain different CG objects.

This class contains properties that any CG class needs:

  • a pointer to a handler_ object with set and get functions
  • the variables and functionality inherited from BaseObject
  • initialize, evaluate, and finalize functions called by the CGHandler
  • parameters that specify the options to initialize the mesh of CGPoints (min_, max_, nX_, nY_, nZ_) and properties of the CGFunction (width_)
  • parameters that specify when evaluate will be called (timeMin_, timeMax_)
  • the statFile into which statistical output is written.

Definition at line 56 of file BaseCG.h.

Constructor & Destructor Documentation

BaseCG::BaseCG ( )

Simple constructor, sets default values.

Definition at line 29 of file BaseCG.cc.

References DEBUG, File::getFstream(), handler_, constants::inf, logger, max_, min_, NEVER, nX_, nY_, nZ_, selectedParticle_, File::setLastSavedTimeStep(), statFile, timeMax_, and timeMin_.

30 {
31  handler_ = nullptr;
32  statFile.getFstream().precision(8);
33  statFile.getFstream().setf(std::ios::left);
35  nX_ = 1;
36  nY_ = 1;
37  nZ_ = 1;
42  selectedParticle_ = [](const BaseInteractable* p) { return true; };
43  logger(DEBUG, "BaseCG::BaseCG() finished");
44 }
Mdouble timeMax_
Definition: BaseCG.h:333
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
void setLastSavedTimeStep(unsigned int lastSavedTimeStep)
Sets File::nextSavedTimeStep_.
Definition: File.cc:303
const Mdouble inf
Definition: GeneralDefine.h:44
const unsigned NEVER
Definition: File.h:35
std::function< bool(const BaseInteractable *)> selectedParticle_
Definition: BaseCG.h:350
std::fstream & getFstream()
Allows to access the member variable File::fstream_.
Definition: File.cc:154
Vec3D min_
Definition: BaseCG.h:340
std::size_t nY_
Definition: BaseCG.h:309
File statFile
File class to handle the output into a .stat file.
Definition: BaseCG.h:369
std::size_t nZ_
Definition: BaseCG.h:314
Defines the basic properties that a interactable object can have.
CGHandler * handler_
Definition: BaseCG.h:295
std::size_t nX_
Definition: BaseCG.h:304
Definition: Vector.h:49
Mdouble timeMin_
Definition: BaseCG.h:328
Vec3D max_
Definition: BaseCG.h:345
BaseCG::BaseCG ( const BaseCG p)
default

Default copy constructor, copies all values.

BaseCG::~BaseCG ( )
overridedefault

Default destructor, does nothing.

Member Function Documentation

void BaseCG::clear ( )

This class seems to have no use (?), but is required for any derivative of BaseObject.

Definition at line 46 of file BaseCG.cc.

47 {
48  std::cout << "BaseCG::clear(), this function shouldn't be called" << std::endl;
49 }
virtual void BaseCG::finish ( )
pure virtual
bool BaseCG::getAverageBeyondDomain ( ) const
inline

Definition at line 277 of file BaseCG.h.

References averageBeyondDomain_.

277 {return averageBeyondDomain_;}
bool averageBeyondDomain_
Determines whether particles outside the domain are considered when computing the averaged fields...
Definition: BaseCG.h:363
Mdouble BaseCG::getEps ( ) const

Definition at line 96 of file BaseCG.cc.

References eps_.

97 {
98  return eps_;
99 }
Mdouble eps_
Definition: BaseCG.h:320
CGHandler * BaseCG::getHandler ( ) const

Returns handler_, a pointer to the CGHandler.

Returns
pointer to the CGHandler

Definition at line 80 of file BaseCG.cc.

References handler_.

81 {
82 #ifdef DEBUG_OUTPUT
83  if (handler_ == nullptr)
84  {
85  std::cerr << "error: handler_==0 " << std::endl;
86  }
87 #endif
88  return handler_;
89 }
CGHandler * handler_
Definition: BaseCG.h:295
Vec3D BaseCG::getMax ( ) const

Returns max_, the upper limit of the spatial domain.

Definition at line 160 of file BaseCG.cc.

References max_.

161 {
162  return max_;
163 }
Vec3D max_
Definition: BaseCG.h:345
Vec3D BaseCG::getMin ( ) const

Returns min_, the lower limit of the spatial domain.

Definition at line 155 of file BaseCG.cc.

References min_.

156 {
157  return min_;
158 }
Vec3D min_
Definition: BaseCG.h:340
std::size_t BaseCG::getNX ( ) const

Returns nX_, the number of spatial mesh points in the x-direction.

Definition at line 126 of file BaseCG.cc.

References nX_.

Referenced by setHX().

127 {
128  return nX_;
129 }
std::size_t nX_
Definition: BaseCG.h:304
std::size_t BaseCG::getNY ( ) const

Returns nY_, the number of spatial mesh points in the y-direction.

Definition at line 116 of file BaseCG.cc.

References nY_.

Referenced by setHY().

117 {
118  return nY_;
119 }
std::size_t nY_
Definition: BaseCG.h:309
std::size_t BaseCG::getNZ ( ) const

Returns nZ_, the number of spatial mesh points in the z-direction.

Definition at line 106 of file BaseCG.cc.

References nZ_.

Referenced by setHZ().

107 {
108  return nZ_;
109 }
std::size_t nZ_
Definition: BaseCG.h:314
Mdouble BaseCG::getTimeMax ( ) const

Returns timeMax_, the upper limit of the temporal domain.

Definition at line 180 of file BaseCG.cc.

References timeMax_.

Referenced by CGHandler::evaluate(), and CGHandler::getTimeMax().

181 {
182  return timeMax_;
183 }
Mdouble timeMax_
Definition: BaseCG.h:333
Mdouble BaseCG::getTimeMin ( ) const

Returns timeMin_, the lower limit of the temporal domain.

Definition at line 175 of file BaseCG.cc.

References timeMin_.

Referenced by CGHandler::evaluate(), and CGHandler::getTimeMin().

176 {
177  return timeMin_;
178 }
Mdouble timeMin_
Definition: BaseCG.h:328
virtual Mdouble BaseCG::getWidth ( ) const
pure virtual

Returns width_, the coarse-graining width.

Implemented in CG< Coordinates, BaseFunction, Fields >, and CG< CGCoordinates::XYZ, BaseFunction, Fields >.

Referenced by write().

virtual void BaseCG::initialise ( )
pure virtual
void BaseCG::read ( std::istream &  is)
overridevirtual

Currently, no read functions are implemented for the CGHandler, but the function is required for any derivative of BaseObject.

Implements BaseObject.

Definition at line 52 of file BaseCG.cc.

53 {
54 }
void BaseCG::selectSpecies ( unsigned  speciesIndex)

sets selectedParticle_ such that only particles of a certain species are selected

Parameters
speciesIndex

Definition at line 228 of file BaseCG.cc.

References selectedParticle_.

229 {
230  selectedParticle_ = [speciesIndex](const BaseInteractable* p)
231  {
232  return p->getIndSpecies() == speciesIndex;
233  };
234 }
std::function< bool(const BaseInteractable *)> selectedParticle_
Definition: BaseCG.h:350
Defines the basic properties that a interactable object can have.
void BaseCG::setAverageBeyondDomain ( const bool  val)
inline

Definition at line 275 of file BaseCG.h.

References averageBeyondDomain_.

bool averageBeyondDomain_
Determines whether particles outside the domain are considered when computing the averaged fields...
Definition: BaseCG.h:363
void BaseCG::setEps ( Mdouble  eps)

Definition at line 91 of file BaseCG.cc.

References eps_.

92 {
93  eps_ = eps;
94 }
Mdouble eps_
Definition: BaseCG.h:320
void BaseCG::setGrid ( Vec3D  min,
Vec3D  max,
Mdouble  h 
)

Definition at line 221 of file BaseCG.cc.

References setH(), setMax(), and setMin().

222 {
223  setMin(min);
224  setMax(max);
225  setH(h);
226 }
void setMax(Vec3D max)
Sets max_, the upper limit of the spatial domain.
Definition: BaseCG.cc:170
void setMin(Vec3D min)
Sets max_, the lower limit of the spatial domain.
Definition: BaseCG.cc:165
void setH(Mdouble h)
Sets nX_, nY_, nZ_, the number of spatial mesh points in each cartesian direction. However, instead of explicitly defining n, the mesh size h=(max-min)/n is defined.
Definition: BaseCG.cc:241
void BaseCG::setH ( Mdouble  h)

Sets nX_, nY_, nZ_, the number of spatial mesh points in each cartesian direction. However, instead of explicitly defining n, the mesh size h=(max-min)/n is defined.

Definition at line 241 of file BaseCG.cc.

References INFO, logger, max_, min_, nZ_, setHX(), setHY(), and setHZ().

Referenced by setGrid().

242 {
243  setHX(h);
244  setHY(h);
245  setHZ(h);
246  logger(INFO, "min % max % h % nz %", min_, max_, h, nZ_);
247 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
void setHX(Mdouble h)
Sets nX_ the number of spatial mesh points in the X-direction. Instead of explicitly defining nX...
Definition: BaseCG.cc:249
Vec3D min_
Definition: BaseCG.h:340
void setHZ(Mdouble h)
Sets nX_ the number of spatial mesh points in the X-direction. Instead of explicitly defining nX...
Definition: BaseCG.cc:267
std::size_t nZ_
Definition: BaseCG.h:314
void setHY(Mdouble h)
Sets nX_ the number of spatial mesh points in the X-direction. Instead of explicitly defining nX...
Definition: BaseCG.cc:258
Vec3D max_
Definition: BaseCG.h:345
void BaseCG::setHandler ( CGHandler handler)

Sets handler_, the pointer to the CGHandler.

Definition at line 72 of file BaseCG.cc.

References handler_.

Referenced by CGHandler::addObject().

73 {
74  handler_ = handler;
75 }
CGHandler * handler_
Definition: BaseCG.h:295
void BaseCG::setHX ( Mdouble  h)

Sets nX_ the number of spatial mesh points in the X-direction. Instead of explicitly defining nX, the mesh size hX=(max.X-min.X)/nX is defined.

Definition at line 249 of file BaseCG.cc.

References getNX(), constants::inf, logger, max_, min_, setNX(), and Vec3D::X.

Referenced by setH(), and setXGrid().

250 {
251  logger.assert(h > 0, "setHX(%): h has to be positive");
253  "setHX(%) can only be used after setting min and max values", h);
254  setNX(static_cast<size_t>(std::ceil((max_.X - min_.X) / h)));
255  logger.assert_always(getNX() > 0, "setHX(%) generated nX=% for %<x<%", h, getNX(), min_.X, max_.X);
256 }
Mdouble X
the vector components
Definition: Vector.h:65
std::size_t getNX() const
Returns nX_, the number of spatial mesh points in the x-direction.
Definition: BaseCG.cc:126
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
const Mdouble inf
Definition: GeneralDefine.h:44
void setNX(std::size_t nX)
Sets nX_, the number of spatial mesh points in the x-direction.
Definition: BaseCG.cc:121
Vec3D min_
Definition: BaseCG.h:340
Vec3D max_
Definition: BaseCG.h:345
void BaseCG::setHY ( Mdouble  h)

Sets nX_ the number of spatial mesh points in the X-direction. Instead of explicitly defining nX, the mesh size hX=(max.X-min.X)/nX is defined.

Definition at line 258 of file BaseCG.cc.

References getNY(), constants::inf, logger, max_, min_, setNY(), and Vec3D::Y.

Referenced by setH(), and setYGrid().

259 {
260  logger.assert(h > 0, "setHY(%): h has to be positive");
262  "setHY(%) can only be used after setting min and max values", h);
263  setNY(static_cast<size_t>(std::ceil((max_.Y - min_.Y) / h)));
264  logger.assert_always(getNY() > 0, "setHY(%) generated nY=% for %<y<%", h, getNY(), min_.Y, max_.Y);
265 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
std::size_t getNY() const
Returns nY_, the number of spatial mesh points in the y-direction.
Definition: BaseCG.cc:116
const Mdouble inf
Definition: GeneralDefine.h:44
void setNY(std::size_t nY)
Sets nY_, the number of spatial mesh points in the y-direction.
Definition: BaseCG.cc:111
Vec3D min_
Definition: BaseCG.h:340
Mdouble Y
Definition: Vector.h:65
Vec3D max_
Definition: BaseCG.h:345
void BaseCG::setHZ ( Mdouble  h)

Sets nX_ the number of spatial mesh points in the X-direction. Instead of explicitly defining nX, the mesh size hX=(max.X-min.X)/nX is defined.

Definition at line 267 of file BaseCG.cc.

References getNZ(), constants::inf, logger, max_, min_, setNZ(), and Vec3D::Z.

Referenced by setH(), and setZGrid().

268 {
269  logger.assert(h > 0, "setHZ(%): h has to be positive");
271  "setHZ(%) can only be used after setting min and max values", h);
272  setNZ(static_cast<size_t>(std::ceil((max_.Z - min_.Z) / h)));
273  logger.assert_always(getNZ() > 0, "setHZ(%) generated nZ=% for %<z<%", h, getNZ(), min_.Z, max_.Z);
274 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
void setNZ(std::size_t nZ)
Sets nZ_, the number of spatial mesh points in the z-direction.
Definition: BaseCG.cc:101
const Mdouble inf
Definition: GeneralDefine.h:44
std::size_t getNZ() const
Returns nZ_, the number of spatial mesh points in the z-direction.
Definition: BaseCG.cc:106
Vec3D min_
Definition: BaseCG.h:340
Mdouble Z
Definition: Vector.h:65
Vec3D max_
Definition: BaseCG.h:345
void BaseCG::setMax ( Vec3D  max)

Sets max_, the upper limit of the spatial domain.

Definition at line 170 of file BaseCG.cc.

References max_.

Referenced by setGrid().

171 {
172  max_ = max;
173 }
Vec3D max_
Definition: BaseCG.h:345
void BaseCG::setMin ( Vec3D  min)

Sets max_, the lower limit of the spatial domain.

Definition at line 165 of file BaseCG.cc.

References min_.

Referenced by setGrid().

166 {
167  min_ = min;
168 }
Vec3D min_
Definition: BaseCG.h:340
void BaseCG::setN ( std::size_t  n)

Sets nX_, nY_, nZ_, the number of spatial mesh points in each cartesian direction.

Definition at line 131 of file BaseCG.cc.

References nX_, nY_, and nZ_.

132 {
133  nX_ = n;
134  nY_ = n;
135  nZ_ = n;
136 }
std::size_t nY_
Definition: BaseCG.h:309
std::size_t nZ_
Definition: BaseCG.h:314
std::size_t nX_
Definition: BaseCG.h:304
void BaseCG::setN ( std::array< std::size_t, 3 >  n)

Sets nX_, nY_, nZ_, the number of spatial mesh points in each cartesian direction.

Definition at line 138 of file BaseCG.cc.

References nX_, nY_, and nZ_.

139 {
140  nX_ = n[0];
141  nY_ = n[1];
142  nZ_ = n[2];
143 }
std::size_t nY_
Definition: BaseCG.h:309
std::size_t nZ_
Definition: BaseCG.h:314
std::size_t nX_
Definition: BaseCG.h:304
void BaseCG::setNX ( std::size_t  nX)

Sets nX_, the number of spatial mesh points in the x-direction.

Definition at line 121 of file BaseCG.cc.

References nX_.

Referenced by setHX().

122 {
123  nX_ = nX;
124 }
std::size_t nX_
Definition: BaseCG.h:304
void BaseCG::setNY ( std::size_t  nY)

Sets nY_, the number of spatial mesh points in the y-direction.

Definition at line 111 of file BaseCG.cc.

References nY_.

Referenced by setHY().

112 {
113  nY_ = nY;
114 }
std::size_t nY_
Definition: BaseCG.h:309
void BaseCG::setNZ ( std::size_t  nZ)

Sets nZ_, the number of spatial mesh points in the z-direction.

Definition at line 101 of file BaseCG.cc.

References nZ_.

Referenced by setHZ().

102 {
103  nZ_ = nZ;
104 }
std::size_t nZ_
Definition: BaseCG.h:314
virtual void BaseCG::setRadius ( Mdouble  radius)
pure virtual
void BaseCG::setSelectedParticle ( const std::function< const bool(const BaseInteractable *)> &  selectedParticle)

Definition at line 236 of file BaseCG.cc.

References selectedParticle_.

237 {
238  selectedParticle_ = selectedParticle;
239 }
std::function< bool(const BaseInteractable *)> selectedParticle_
Definition: BaseCG.h:350
virtual void BaseCG::setStandardDeviation ( Mdouble  std)
pure virtual
void BaseCG::setTimeMax ( Mdouble  timeMax)

Sets timeMax_, the upper limit of the temporal domain.

Definition at line 150 of file BaseCG.cc.

References timeMax_.

151 {
152  timeMax_ = timeMax;
153 }
Mdouble timeMax_
Definition: BaseCG.h:333
void BaseCG::setTimeMin ( Mdouble  timeMin)

Sets timeMin_, the lower limit of the temporal domain.

Definition at line 145 of file BaseCG.cc.

References timeMin_.

146 {
147  timeMin_ = timeMin;
148 }
Mdouble timeMin_
Definition: BaseCG.h:328
virtual void BaseCG::setWidth ( Mdouble  width)
pure virtual

Sets width_, the coarse-graining width.

Todo:
should be standard deviation, but is currently cutoff.

Implemented in CG< Coordinates, BaseFunction, Fields >, and CG< CGCoordinates::XYZ, BaseFunction, Fields >.

void BaseCG::setX ( Mdouble  min,
Mdouble  max 
)

Sets min_.X, max_.X, the limits of the spatial domain in X.

Definition at line 185 of file BaseCG.cc.

References max_, min_, and Vec3D::X.

Referenced by setXGrid().

186 {
187  min_.X = min;
188  max_.X = max;
189 }
Mdouble X
the vector components
Definition: Vector.h:65
Vec3D min_
Definition: BaseCG.h:340
Vec3D max_
Definition: BaseCG.h:345
void BaseCG::setXGrid ( Mdouble  min,
Mdouble  max,
Mdouble  h 
)

Definition at line 203 of file BaseCG.cc.

References setHX(), and setX().

204 {
205  setX(min,max);
206  setHX(h);
207 }
void setHX(Mdouble h)
Sets nX_ the number of spatial mesh points in the X-direction. Instead of explicitly defining nX...
Definition: BaseCG.cc:249
void setX(Mdouble min, Mdouble max)
Sets min_.X, max_.X, the limits of the spatial domain in X.
Definition: BaseCG.cc:185
void BaseCG::setY ( Mdouble  min,
Mdouble  max 
)

Sets min_.Y, max_.Y, the limits of the spatial domain in Y.

Definition at line 191 of file BaseCG.cc.

References max_, min_, and Vec3D::Y.

Referenced by setYGrid().

192 {
193  min_.Y = min;
194  max_.Y = max;
195 }
Vec3D min_
Definition: BaseCG.h:340
Mdouble Y
Definition: Vector.h:65
Vec3D max_
Definition: BaseCG.h:345
void BaseCG::setYGrid ( Mdouble  min,
Mdouble  max,
Mdouble  h 
)

Definition at line 209 of file BaseCG.cc.

References setHY(), and setY().

210 {
211  setY(min,max);
212  setHY(h);
213 }
void setY(Mdouble min, Mdouble max)
Sets min_.Y, max_.Y, the limits of the spatial domain in Y.
Definition: BaseCG.cc:191
void setHY(Mdouble h)
Sets nX_ the number of spatial mesh points in the X-direction. Instead of explicitly defining nX...
Definition: BaseCG.cc:258
void BaseCG::setZ ( Mdouble  min,
Mdouble  max 
)

Sets min_.Z, max_.Z, the limits of the spatial domain in Z.

Definition at line 197 of file BaseCG.cc.

References max_, min_, and Vec3D::Z.

Referenced by setZGrid().

198 {
199  min_.Z = min;
200  max_.Z = max;
201 }
Vec3D min_
Definition: BaseCG.h:340
Mdouble Z
Definition: Vector.h:65
Vec3D max_
Definition: BaseCG.h:345
void BaseCG::setZGrid ( Mdouble  min,
Mdouble  max,
Mdouble  h 
)

Definition at line 215 of file BaseCG.cc.

References setHZ(), and setZ().

216 {
217  setZ(min,max);
218  setHZ(h);
219 }
void setHZ(Mdouble h)
Sets nX_ the number of spatial mesh points in the X-direction. Instead of explicitly defining nX...
Definition: BaseCG.cc:267
void setZ(Mdouble min, Mdouble max)
Sets min_.Z, max_.Z, the limits of the spatial domain in Z.
Definition: BaseCG.cc:197
void BaseCG::write ( std::ostream &  os) const
overridevirtual

Writes class content into an output stream, usually a stat file.

Parameters
[out]osoutput stream to which data is written

Implements BaseObject.

Reimplemented in CG< Coordinates, BaseFunction, Fields >, CG< CGCoordinates::XYZ, BaseFunction, Fields >, TimeSmoothedCG< Coordinates, BaseFunction, Fields >, TimeAveragedCG< Coordinates, BaseFunction, Fields >, and TimeAveragedCG< CGCoordinates::XYZ, BaseFunction, Fields >.

Definition at line 59 of file BaseCG.cc.

References BaseObject::getName(), getWidth(), max_, min_, nX_, nY_, nZ_, timeMax_, and timeMin_.

60 {
61  //BaseObject::write(os);
62  os << getName();
63  os << " min " << min_;
64  os << " max " << max_;
65  if (!std::isinf(timeMin_)) os << " timeMin " << timeMin_;
66  if (!std::isinf(timeMax_)) os << " timeMax " << timeMax_;
67  os << " n " << nX_ << " " << nY_ << " " << nZ_;
68  os << " width " << getWidth();
69  //statFile
70 }
Mdouble timeMax_
Definition: BaseCG.h:333
virtual std::string getName() const =0
A purely virtual function.
Vec3D min_
Definition: BaseCG.h:340
std::size_t nY_
Definition: BaseCG.h:309
std::size_t nZ_
Definition: BaseCG.h:314
std::size_t nX_
Definition: BaseCG.h:304
virtual Mdouble getWidth() const =0
Returns width_, the coarse-graining width.
Mdouble timeMin_
Definition: BaseCG.h:328
Vec3D max_
Definition: BaseCG.h:345

Member Data Documentation

bool BaseCG::averageBeyondDomain_ = true
protected

Determines whether particles outside the domain are considered when computing the averaged fields.

If set to true, then the average of field f over a coordinate direction x is computed as \(\frac{1}{x_{max}-x_{min}}\int_{-\infty}^{\infty} f dx\) If set to false, then the average of field f over a coordinate direction x is computed as \(\frac{1}{x_{max}-x_{min}}\int_{x_{min}}^{x_{max}} f dx\)

Todo:

should the default be false?

currently, the above description is not implemented; it simply ignores particles outside the domain.

Definition at line 363 of file BaseCG.h.

Referenced by getAverageBeyondDomain(), and setAverageBeyondDomain().

Mdouble BaseCG::eps_
protected

Finite difference step size used to computed derivatives of CG functions

Definition at line 320 of file BaseCG.h.

Referenced by getEps(), and setEps().

CGHandler* BaseCG::handler_
protected

the pointer to the CGHandler, used to get data from the CGHandler.

Definition at line 295 of file BaseCG.h.

Referenced by BaseCG(), getHandler(), and setHandler().

Vec3D BaseCG::max_
protected

see min_.

Definition at line 345 of file BaseCG.h.

Referenced by BaseCG(), getMax(), setH(), setHX(), setHY(), setHZ(), setMax(), setX(), setY(), setZ(), and write().

Vec3D BaseCG::min_
protected

min_ and max_ define the spatial dimensions of the coarse-graining volume; if these parameters are not defined by the user, they are set to the system dimensions (DPMBase::min_ and DPMBase::max_) in CG::initialize.

Definition at line 340 of file BaseCG.h.

Referenced by BaseCG(), getMin(), setH(), setHX(), setHY(), setHZ(), setMin(), setX(), setY(), setZ(), and write().

std::size_t BaseCG::nX_
protected

nX_, nY_, and nZ_ define the size of the mesh of CGPoints, i.e. the spatial positions at which the cg variables are evaluated. nX_, nY_, and nZ_ are the number of points in x-, y-, and z-direction. the is used to set the width of the These values are set to 1 by default, unless modified by the user.

Definition at line 304 of file BaseCG.h.

Referenced by BaseCG(), getNX(), setN(), setNX(), and write().

std::size_t BaseCG::nY_
protected

see nX_

Definition at line 309 of file BaseCG.h.

Referenced by BaseCG(), getNY(), setN(), setNY(), and write().

std::size_t BaseCG::nZ_
protected

see nZ_

Definition at line 314 of file BaseCG.h.

Referenced by BaseCG(), getNZ(), setH(), setN(), setNZ(), and write().

std::function<bool(const BaseInteractable*)> BaseCG::selectedParticle_
protected

A function returning true for each particle that should be included in the statistics (all by default).

Definition at line 350 of file BaseCG.h.

Referenced by BaseCG(), selectSpecies(), and setSelectedParticle().

File BaseCG::statFile

File class to handle the output into a .stat file.

Definition at line 369 of file BaseCG.h.

Referenced by BaseCG(), CGHandler::evaluate(), and CGHandler::finish().

Mdouble BaseCG::timeMax_
protected

see timeMin_

Definition at line 333 of file BaseCG.h.

Referenced by BaseCG(), getTimeMax(), setTimeMax(), and write().

Mdouble BaseCG::timeMin_
protected

timeMin_ and timeMax_ define the temporal dimensions of the coarse-graining volume; these parameters are set to \(\pm\infty\) by default, unless modified by the user; otherwise, timeMin_ is set to DPMBase::time_ in CG::initialize.

Definition at line 328 of file BaseCG.h.

Referenced by BaseCG(), getTimeMin(), setTimeMin(), and write().


The documentation for this class was generated from the following files: