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
 
void setVerbose (const bool verbose)
 
bool getVerbose () const
 
virtual void setWidthTime (Mdouble widthTime)
 
virtual Mdouble getWidthTime () const
 
virtual void setTimeStep (Mdouble timeStep)
 
virtual Mdouble getTimeStep () 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...
 
bool verbose_ = false
 

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.

Constructor & Destructor Documentation

◆ BaseCG() [1/2]

BaseCG::BaseCG ( )

Simple constructor, sets default values.

9 {
10  handler_ = nullptr;
11  statFile.getFstream().precision(8);
12  statFile.getFstream().setf(std::ios::left);
14  nX_ = 1;
15  nY_ = 1;
16  nZ_ = 1;
21  selectedParticle_ = [](const BaseInteractable* p) { return true; };
22  logger(DEBUG, "BaseCG::BaseCG() finished");
23 }
const unsigned NEVER
Definition: File.h:13
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
@ DEBUG
float * p
Definition: Tutorial_Map_using.cpp:9
Mdouble timeMin_
Definition: BaseCG.h:320
File statFile
File class to handle the output into a .stat file.
Definition: BaseCG.h:363
std::size_t nY_
Definition: BaseCG.h:301
Vec3D min_
Definition: BaseCG.h:332
std::function< bool(const BaseInteractable *)> selectedParticle_
Definition: BaseCG.h:342
std::size_t nZ_
Definition: BaseCG.h:306
std::size_t nX_
Definition: BaseCG.h:296
Mdouble timeMax_
Definition: BaseCG.h:325
CGHandler * handler_
Definition: BaseCG.h:287
Vec3D max_
Definition: BaseCG.h:337
Defines the basic properties that a interactable object can have.
Definition: BaseInteractable.h:34
std::fstream & getFstream()
Allows to access the member variable File::fstream_.
Definition: File.cc:131
void setLastSavedTimeStep(unsigned int lastSavedTimeStep)
Sets File::nextSavedTimeStep_.
Definition: File.cc:280
Definition: Kernel/Math/Vector.h:30
const Mdouble inf
Definition: GeneralDefine.h:23

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

◆ BaseCG() [2/2]

BaseCG::BaseCG ( const BaseCG p)
default

Default copy constructor, copies all values.

◆ ~BaseCG()

BaseCG::~BaseCG ( )
overridedefault

Default destructor, does nothing.

Member Function Documentation

◆ clear()

void BaseCG::clear ( )

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

26 {
27  logger(WARN, "BaseCG::clear(), this function shouldn't be called");
28 }
@ WARN

References logger, and WARN.

◆ copy()

◆ evaluate()

◆ finish()

◆ getAverageBeyondDomain()

bool BaseCG::getAverageBeyondDomain ( ) const
inline
256 {return averageBeyondDomain_;}
bool averageBeyondDomain_
Determines whether particles outside the domain are considered when computing the averaged fields.
Definition: BaseCG.h:355

References averageBeyondDomain_.

◆ getEps()

Mdouble BaseCG::getEps ( ) const
77 {
78  return eps_;
79 }
Mdouble eps_
Definition: BaseCG.h:312

References eps_.

Referenced by commandLineCG().

◆ getHandler()

CGHandler * BaseCG::getHandler ( ) const

Returns handler_, a pointer to the CGHandler.

Returns
pointer to the CGHandler
61 {
62 #ifdef DEBUG_OUTPUT
63  if (handler_ == nullptr)
64  {
65  std::cerr << "error: handler_==0 " << std::endl;
66  }
67 #endif
68  return handler_;
69 }

References handler_.

Referenced by CGFields::DisplacementField::setFields().

◆ getMax()

Vec3D BaseCG::getMax ( ) const

Returns max_, the upper limit of the spatial domain.

141 {
142  return max_;
143 }

References max_.

◆ getMin()

Vec3D BaseCG::getMin ( ) const

Returns min_, the lower limit of the spatial domain.

136 {
137  return min_;
138 }

References min_.

◆ getNX()

std::size_t BaseCG::getNX ( ) const

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

107 {
108  return nX_;
109 }

References nX_.

Referenced by commandLineCG(), and setHX().

◆ getNY()

std::size_t BaseCG::getNY ( ) const

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

97 {
98  return nY_;
99 }

References nY_.

Referenced by commandLineCG(), and setHY().

◆ getNZ()

std::size_t BaseCG::getNZ ( ) const

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

87 {
88  return nZ_;
89 }

References nZ_.

Referenced by commandLineCG(), and setHZ().

◆ getTimeMax()

Mdouble BaseCG::getTimeMax ( ) const

Returns timeMax_, the upper limit of the temporal domain.

161 {
162  return timeMax_;
163 }

References timeMax_.

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

◆ getTimeMin()

Mdouble BaseCG::getTimeMin ( ) const

Returns timeMin_, the lower limit of the temporal domain.

156 {
157  return timeMin_;
158 }

References timeMin_.

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

◆ getTimeStep()

Mdouble BaseCG::getTimeStep ( ) const
virtual

Reimplemented in TimeSmoothedCG< Coordinates, BaseFunction, Fields >.

273 {
274  logger(ERROR, "getTimeStep() should not be used, it is a dummy function for templating");
275  return 0;
276 }
@ ERROR

References ERROR, and logger.

Referenced by commandLineCG().

◆ getVerbose()

bool BaseCG::getVerbose ( ) const
inline
260 {return verbose_;}
bool verbose_
Definition: BaseCG.h:357

References verbose_.

◆ getWidth()

virtual Mdouble BaseCG::getWidth ( ) const
pure virtual

◆ getWidthTime()

Mdouble BaseCG::getWidthTime ( ) const
virtual

Reimplemented in TimeSmoothedCG< Coordinates, BaseFunction, Fields >.

267 {
268  logger(ERROR, "getWidthTime() should not be used, it is a dummy function for templating");
269  return 0;
270 }

References ERROR, and logger.

Referenced by commandLineCG().

◆ initialise()

◆ read()

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.

32 {
33 }

◆ selectSpecies()

void BaseCG::selectSpecies ( unsigned  speciesIndex)

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

Parameters
speciesIndex
209 {
210  selectedParticle_ = [speciesIndex](const BaseInteractable* p)
211  {
212  return p->getIndSpecies() == speciesIndex;
213  };
214 }

References p, and selectedParticle_.

Referenced by commandLineCG().

◆ setAverageBeyondDomain()

void BaseCG::setAverageBeyondDomain ( const bool  val)
inline
val
Definition: calibrate.py:119

References averageBeyondDomain_, and calibrate::val.

Referenced by commandLineCG().

◆ setEps()

void BaseCG::setEps ( Mdouble  eps)
72 {
73  eps_ = eps;
74 }
double eps
Definition: crbond_bessel.cc:24

References CRBond_Bessel::eps, and eps_.

Referenced by commandLineCG().

◆ setGrid()

void BaseCG::setGrid ( Vec3D  min,
Vec3D  max,
Mdouble  h 
)
202 {
203  setMin(min);
204  setMax(max);
205  setH(h);
206 }
void setMax(Vec3D max)
Sets max_, the upper limit of the spatial domain.
Definition: BaseCG.cc:150
void setH(Mdouble h)
Sets nX_, nY_, nZ_, the number of spatial mesh points in each cartesian direction....
Definition: BaseCG.cc:221
void setMin(Vec3D min)
Sets max_, the lower limit of the spatial domain.
Definition: BaseCG.cc:145
#define min(a, b)
Definition: datatypes.h:22
#define max(a, b)
Definition: datatypes.h:23

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

◆ setH()

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.

222 {
223  setHX(h);
224  setHY(h);
225  setHZ(h);
226  logger(INFO, "min % max % h % nz %", min_, max_, h, nZ_);
227 }
@ INFO
void setHX(Mdouble h)
Sets nX_ the number of spatial mesh points in the X-direction. Instead of explicitly defining nX,...
Definition: BaseCG.cc:229
void setHY(Mdouble h)
Sets nX_ the number of spatial mesh points in the X-direction. Instead of explicitly defining nX,...
Definition: BaseCG.cc:238
void setHZ(Mdouble h)
Sets nX_ the number of spatial mesh points in the X-direction. Instead of explicitly defining nX,...
Definition: BaseCG.cc:247

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

Referenced by commandLineCG(), and setGrid().

◆ setHandler()

void BaseCG::setHandler ( CGHandler handler)

Sets handler_, the pointer to the CGHandler.

53 {
54  handler_ = handler;
55 }

References handler_.

Referenced by CGHandler::addObject().

◆ setHX()

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.

230 {
231  logger.assert_debug(h > 0, "setHX(%): h has to be positive");
232  logger.assert_debug(max_.X!=constants::inf && min_.X!=-constants::inf,
233  "setHX(%) can only be used after setting min and max values", h);
234  setNX(static_cast<size_t>(std::ceil((max_.X - min_.X) / h)));
235  logger.assert_always(getNX() > 0, "setHX(%) generated nX=% for %<x<%", h, getNX(), min_.X, max_.X);
236 }
void setNX(std::size_t nX)
Sets nX_, the number of spatial mesh points in the x-direction.
Definition: BaseCG.cc:101
std::size_t getNX() const
Returns nX_, the number of spatial mesh points in the x-direction.
Definition: BaseCG.cc:106
Mdouble X
the vector components
Definition: Kernel/Math/Vector.h:45
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 ceil(const bfloat16 &a)
Definition: BFloat16.h:644

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

Referenced by commandLineCG(), setH(), and setXGrid().

◆ setHY()

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.

239 {
240  logger.assert_debug(h > 0, "setHY(%): h has to be positive");
241  logger.assert_debug(max_.Y!=constants::inf && min_.Y!=-constants::inf,
242  "setHY(%) can only be used after setting min and max values", h);
243  setNY(static_cast<size_t>(std::ceil((max_.Y - min_.Y) / h)));
244  logger.assert_always(getNY() > 0, "setHY(%) generated nY=% for %<y<%", h, getNY(), min_.Y, max_.Y);
245 }
void setNY(std::size_t nY)
Sets nY_, the number of spatial mesh points in the y-direction.
Definition: BaseCG.cc:91
std::size_t getNY() const
Returns nY_, the number of spatial mesh points in the y-direction.
Definition: BaseCG.cc:96
Mdouble Y
Definition: Kernel/Math/Vector.h:45

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

Referenced by commandLineCG(), setH(), and setYGrid().

◆ setHZ()

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.

248 {
249  logger.assert_debug(h > 0, "setHZ(%): h has to be positive");
250  logger.assert_debug(max_.Z!=constants::inf && min_.Z!=-constants::inf,
251  "setHZ(%) can only be used after setting min and max values", h);
252  setNZ(static_cast<size_t>(std::ceil((max_.Z - min_.Z) / h)));
253  logger.assert_always(getNZ() > 0, "setHZ(%) generated nZ=% for %<z<%", h, getNZ(), min_.Z, max_.Z);
254 }
void setNZ(std::size_t nZ)
Sets nZ_, the number of spatial mesh points in the z-direction.
Definition: BaseCG.cc:81
std::size_t getNZ() const
Returns nZ_, the number of spatial mesh points in the z-direction.
Definition: BaseCG.cc:86
Mdouble Z
Definition: Kernel/Math/Vector.h:45

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

Referenced by commandLineCG(), setH(), and setZGrid().

◆ setMax()

void BaseCG::setMax ( Vec3D  max)

Sets max_, the upper limit of the spatial domain.

151 {
152  max_ = max;
153 }

References max, and max_.

Referenced by commandLineCG(), and setGrid().

◆ setMin()

void BaseCG::setMin ( Vec3D  min)

Sets max_, the lower limit of the spatial domain.

146 {
147  min_ = min;
148 }

References min, and min_.

Referenced by commandLineCG(), and setGrid().

◆ setN() [1/2]

void BaseCG::setN ( std::array< std::size_t, 3 >  n)

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

119 {
120  nX_ = n[0];
121  nY_ = n[1];
122  nZ_ = n[2];
123 }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11

References n, nX_, nY_, and nZ_.

◆ setN() [2/2]

void BaseCG::setN ( std::size_t  n)

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

112 {
113  nX_ = n;
114  nY_ = n;
115  nZ_ = n;
116 }

References n, nX_, nY_, and nZ_.

Referenced by commandLineCG(), and main().

◆ setNX()

void BaseCG::setNX ( std::size_t  nX)

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

102 {
103  nX_ = nX;
104 }

References nX_.

Referenced by commandLineCG(), main(), and setHX().

◆ setNY()

void BaseCG::setNY ( std::size_t  nY)

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

92 {
93  nY_ = nY;
94 }

References nY_.

Referenced by commandLineCG(), and setHY().

◆ setNZ()

void BaseCG::setNZ ( std::size_t  nZ)

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

82 {
83  nZ_ = nZ;
84 }

References nZ_.

Referenced by commandLineCG(), main(), setCGHandler(), and setHZ().

◆ setRadius()

◆ setSelectedParticle()

void BaseCG::setSelectedParticle ( const std::function< const bool(const BaseInteractable *)> &  selectedParticle)
217 {
218  selectedParticle_ = selectedParticle;
219 }

References selectedParticle_.

◆ setStandardDeviation()

◆ setTimeMax()

void BaseCG::setTimeMax ( Mdouble  timeMax)

Sets timeMax_, the upper limit of the temporal domain.

131 {
132  timeMax_ = timeMax;
133 }

References timeMax_.

Referenced by commandLineCG(), and main().

◆ setTimeMin()

void BaseCG::setTimeMin ( Mdouble  timeMin)

Sets timeMin_, the lower limit of the temporal domain.

126 {
127  timeMin_ = timeMin;
128 }

References timeMin_.

Referenced by commandLineCG(), and main().

◆ setTimeStep()

void BaseCG::setTimeStep ( Mdouble  timeStep)
virtual

Reimplemented in TimeSmoothedCG< Coordinates, BaseFunction, Fields >.

262 {
263  logger(ERROR, "setTimeStep() should not be used, it is a dummy function for templating");
264 }

References ERROR, and logger.

Referenced by commandLineCG().

◆ setVerbose()

void BaseCG::setVerbose ( const bool  verbose)
inline
258 {verbose_=verbose;}
bool verbose
Definition: statXZ.cpp:7

References verbose, and verbose_.

Referenced by commandLineCG().

◆ setWidth()

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 >, CG< Coordinates, CGFunctions::Lucy, CGFields::StandardFields >, and CG< CGCoordinates::O, CGFunctions::Lucy, CGFields::StandardFields >.

Referenced by commandLineCG().

◆ setWidthTime()

void BaseCG::setWidthTime ( Mdouble  widthTime)
virtual

Reimplemented in TimeSmoothedCG< Coordinates, BaseFunction, Fields >.

257 {
258  logger(ERROR, "setWidthTime() should not be used, it is a dummy function for templating");
259 }

References ERROR, and logger.

Referenced by commandLineCG().

◆ setX()

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

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

166 {
167  min_.X = min;
168  max_.X = max;
169 }

References max, max_, min, min_, and Vec3D::X.

Referenced by commandLineCG(), and setXGrid().

◆ setXGrid()

void BaseCG::setXGrid ( Mdouble  min,
Mdouble  max,
Mdouble  h 
)
184 {
185  setX(min,max);
186  setHX(h);
187 }
void setX(Mdouble min, Mdouble max)
Sets min_.X, max_.X, the limits of the spatial domain in X.
Definition: BaseCG.cc:165

References max, min, setHX(), and setX().

◆ setY()

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

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

172 {
173  min_.Y = min;
174  max_.Y = max;
175 }

References max, max_, min, min_, and Vec3D::Y.

Referenced by commandLineCG(), and setYGrid().

◆ setYGrid()

void BaseCG::setYGrid ( Mdouble  min,
Mdouble  max,
Mdouble  h 
)
190 {
191  setY(min,max);
192  setHY(h);
193 }
void setY(Mdouble min, Mdouble max)
Sets min_.Y, max_.Y, the limits of the spatial domain in Y.
Definition: BaseCG.cc:171

References max, min, setHY(), and setY().

◆ setZ()

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

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

178 {
179  min_.Z = min;
180  max_.Z = max;
181 }

References max, max_, min, min_, and Vec3D::Z.

Referenced by commandLineCG(), and setZGrid().

◆ setZGrid()

void BaseCG::setZGrid ( Mdouble  min,
Mdouble  max,
Mdouble  h 
)
196 {
197  setZ(min,max);
198  setHZ(h);
199 }
void setZ(Mdouble min, Mdouble max)
Sets min_.Z, max_.Z, the limits of the spatial domain in Z.
Definition: BaseCG.cc:177

References max, min, setHZ(), and setZ().

◆ write()

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 TimeSmoothedCG< Coordinates, BaseFunction, Fields >, TimeAveragedCG< Coordinates, BaseFunction, Fields >, TimeAveragedCG< CGCoordinates::XYZ, BaseFunction, CGFields::StandardFields >, CG< Coordinates, BaseFunction, Fields >, CG< Coordinates, CGFunctions::Lucy, CGFields::StandardFields >, and CG< CGCoordinates::O, CGFunctions::Lucy, CGFields::StandardFields >.

39 {
40  //BaseObject::write(os);
41  os << getName();
42  os << " min " << min_;
43  os << " max " << max_;
44  if (!std::isinf(timeMin_)) os << " timeMin " << timeMin_;
45  if (!std::isinf(timeMax_)) os << " timeMax " << timeMax_;
46  os << " n " << nX_ << " " << nY_ << " " << nZ_;
47  os << " width " << getWidth();
48  if (verbose_) os << " verbose 1";
49  //statFile
50 }
virtual Mdouble getWidth() const =0
Returns width_, the coarse-graining width.
virtual std::string getName() const =0
A purely virtual function.
#define isinf(X)
Definition: main.h:110

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

Member Data Documentation

◆ averageBeyondDomain_

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.

Referenced by getAverageBeyondDomain(), and setAverageBeyondDomain().

◆ eps_

Mdouble BaseCG::eps_
protected

Finite difference step size used to computed derivatives of CG functions

Referenced by getEps(), and setEps().

◆ handler_

CGHandler* BaseCG::handler_
protected

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

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

◆ max_

Vec3D BaseCG::max_
protected

see min_.

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

◆ min_

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.

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

◆ nX_

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.

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

◆ nY_

std::size_t BaseCG::nY_
protected

see nX_

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

◆ nZ_

std::size_t BaseCG::nZ_
protected

see nZ_

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

◆ selectedParticle_

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).

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

◆ statFile

File BaseCG::statFile

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

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

◆ timeMax_

Mdouble BaseCG::timeMax_
protected

see timeMin_

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

◆ timeMin_

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.

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

◆ verbose_

bool BaseCG::verbose_ = false
protected

Referenced by getVerbose(), setVerbose(), and write().


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