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

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 }
const unsigned NEVER
Definition: File.h:35
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
@ DEBUG
Mdouble timeMin_
Definition: BaseCG.h:333
File statFile
File class to handle the output into a .stat file.
Definition: BaseCG.h:376
std::size_t nY_
Definition: BaseCG.h:314
Vec3D min_
Definition: BaseCG.h:345
std::function< bool(const BaseInteractable *)> selectedParticle_
Definition: BaseCG.h:355
std::size_t nZ_
Definition: BaseCG.h:319
std::size_t nX_
Definition: BaseCG.h:309
Mdouble timeMax_
Definition: BaseCG.h:338
CGHandler * handler_
Definition: BaseCG.h:300
Vec3D max_
Definition: BaseCG.h:350
Defines the basic properties that a interactable object can have.
Definition: BaseInteractable.h:55
std::fstream & getFstream()
Allows to access the member variable File::fstream_.
Definition: File.cc:153
void setLastSavedTimeStep(unsigned int lastSavedTimeStep)
Sets File::nextSavedTimeStep_.
Definition: File.cc:302
Definition: Vector.h:51
const Mdouble inf
Definition: GeneralDefine.h:44

References DEBUG, File::getFstream(), handler_, constants::inf, logger, max_, min_, NEVER, nX_, nY_, nZ_, 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.

47 {
48  logger(WARN, "BaseCG::clear(), this function shouldn't be called");
49 }
@ WARN

References logger, and WARN.

◆ copy()

◆ evaluate()

◆ finish()

◆ getAverageBeyondDomain()

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

References averageBeyondDomain_.

◆ getEps()

Mdouble BaseCG::getEps ( ) const
98 {
99  return eps_;
100 }
Mdouble eps_
Definition: BaseCG.h:325

References eps_.

◆ getHandler()

CGHandler * BaseCG::getHandler ( ) const

Returns handler_, a pointer to the CGHandler.

Returns
pointer to the CGHandler
82 {
83 #ifdef DEBUG_OUTPUT
84  if (handler_ == nullptr)
85  {
86  std::cerr << "error: handler_==0 " << std::endl;
87  }
88 #endif
89  return handler_;
90 }

References handler_.

◆ getMax()

Vec3D BaseCG::getMax ( ) const

Returns max_, the upper limit of the spatial domain.

162 {
163  return max_;
164 }

References max_.

◆ getMin()

Vec3D BaseCG::getMin ( ) const

Returns min_, the lower limit of the spatial domain.

157 {
158  return min_;
159 }

References min_.

◆ getNX()

std::size_t BaseCG::getNX ( ) const

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

128 {
129  return nX_;
130 }

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.

118 {
119  return nY_;
120 }

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.

108 {
109  return nZ_;
110 }

References nZ_.

Referenced by commandLineCG(), and setHZ().

◆ getTimeMax()

Mdouble BaseCG::getTimeMax ( ) const

Returns timeMax_, the upper limit of the temporal domain.

182 {
183  return timeMax_;
184 }

References timeMax_.

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

◆ getTimeMin()

Mdouble BaseCG::getTimeMin ( ) const

Returns timeMin_, the lower limit of the temporal domain.

177 {
178  return timeMin_;
179 }

References timeMin_.

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

◆ getVerbose()

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

References verbose_.

◆ getWidth()

virtual Mdouble BaseCG::getWidth ( ) const
pure virtual

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

53 {
54 }

◆ selectSpecies()

void BaseCG::selectSpecies ( unsigned  speciesIndex)

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

Parameters
speciesIndex
230 {
231  selectedParticle_ = [speciesIndex](const BaseInteractable* p)
232  {
233  return p->getIndSpecies() == speciesIndex;
234  };
235 }

References selectedParticle_.

Referenced by commandLineCG().

◆ setAverageBeyondDomain()

void BaseCG::setAverageBeyondDomain ( const bool  val)
inline

References averageBeyondDomain_.

Referenced by commandLineCG().

◆ setEps()

void BaseCG::setEps ( Mdouble  eps)
93 {
94  eps_ = eps;
95 }

References eps_.

◆ setGrid()

void BaseCG::setGrid ( Vec3D  min,
Vec3D  max,
Mdouble  h 
)
223 {
224  setMin(min);
225  setMax(max);
226  setH(h);
227 }
void setMax(Vec3D max)
Sets max_, the upper limit of the spatial domain.
Definition: BaseCG.cc:171
void setH(Mdouble h)
Sets nX_, nY_, nZ_, the number of spatial mesh points in each cartesian direction....
Definition: BaseCG.cc:242
void setMin(Vec3D min)
Sets max_, the lower limit of the spatial domain.
Definition: BaseCG.cc:166

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

243 {
244  setHX(h);
245  setHY(h);
246  setHZ(h);
247  logger(INFO, "min % max % h % nz %", min_, max_, h, nZ_);
248 }
@ 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:250
void setHY(Mdouble h)
Sets nX_ the number of spatial mesh points in the X-direction. Instead of explicitly defining nX,...
Definition: BaseCG.cc:259
void setHZ(Mdouble h)
Sets nX_ the number of spatial mesh points in the X-direction. Instead of explicitly defining nX,...
Definition: BaseCG.cc:268

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.

74 {
75  handler_ = handler;
76 }

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.

251 {
252  logger.assert_debug(h > 0, "setHX(%): h has to be positive");
253  logger.assert_debug(max_.X!=constants::inf && min_.X!=-constants::inf,
254  "setHX(%) can only be used after setting min and max values", h);
255  setNX(static_cast<size_t>(std::ceil((max_.X - min_.X) / h)));
256  logger.assert_always(getNX() > 0, "setHX(%) generated nX=% for %<x<%", h, getNX(), min_.X, max_.X);
257 }
void setNX(std::size_t nX)
Sets nX_, the number of spatial mesh points in the x-direction.
Definition: BaseCG.cc:122
std::size_t getNX() const
Returns nX_, the number of spatial mesh points in the x-direction.
Definition: BaseCG.cc:127
Mdouble X
the vector components
Definition: Vector.h:66

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

260 {
261  logger.assert_debug(h > 0, "setHY(%): h has to be positive");
262  logger.assert_debug(max_.Y!=constants::inf && min_.Y!=-constants::inf,
263  "setHY(%) can only be used after setting min and max values", h);
264  setNY(static_cast<size_t>(std::ceil((max_.Y - min_.Y) / h)));
265  logger.assert_always(getNY() > 0, "setHY(%) generated nY=% for %<y<%", h, getNY(), min_.Y, max_.Y);
266 }
void setNY(std::size_t nY)
Sets nY_, the number of spatial mesh points in the y-direction.
Definition: BaseCG.cc:112
std::size_t getNY() const
Returns nY_, the number of spatial mesh points in the y-direction.
Definition: BaseCG.cc:117
Mdouble Y
Definition: Vector.h:66

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

269 {
270  logger.assert_debug(h > 0, "setHZ(%): h has to be positive");
271  logger.assert_debug(max_.Z!=constants::inf && min_.Z!=-constants::inf,
272  "setHZ(%) can only be used after setting min and max values", h);
273  setNZ(static_cast<size_t>(std::ceil((max_.Z - min_.Z) / h)));
274  logger.assert_always(getNZ() > 0, "setHZ(%) generated nZ=% for %<z<%", h, getNZ(), min_.Z, max_.Z);
275 }
void setNZ(std::size_t nZ)
Sets nZ_, the number of spatial mesh points in the z-direction.
Definition: BaseCG.cc:102
std::size_t getNZ() const
Returns nZ_, the number of spatial mesh points in the z-direction.
Definition: BaseCG.cc:107
Mdouble Z
Definition: Vector.h:66

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

172 {
173  max_ = max;
174 }

References max_.

Referenced by commandLineCG(), and setGrid().

◆ setMin()

void BaseCG::setMin ( Vec3D  min)

Sets max_, the lower limit of the spatial domain.

167 {
168  min_ = min;
169 }

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

140 {
141  nX_ = n[0];
142  nY_ = n[1];
143  nZ_ = n[2];
144 }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:32

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.

133 {
134  nX_ = n;
135  nY_ = n;
136  nZ_ = n;
137 }

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.

123 {
124  nX_ = nX;
125 }

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.

113 {
114  nY_ = nY;
115 }

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.

103 {
104  nZ_ = nZ;
105 }

References nZ_.

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

◆ setRadius()

◆ setSelectedParticle()

void BaseCG::setSelectedParticle ( const std::function< const bool(const BaseInteractable *)> &  selectedParticle)
238 {
239  selectedParticle_ = selectedParticle;
240 }

References selectedParticle_.

◆ setStandardDeviation()

◆ setTimeMax()

void BaseCG::setTimeMax ( Mdouble  timeMax)

Sets timeMax_, the upper limit of the temporal domain.

152 {
153  timeMax_ = timeMax;
154 }

References timeMax_.

Referenced by commandLineCG(), and main().

◆ setTimeMin()

void BaseCG::setTimeMin ( Mdouble  timeMin)

Sets timeMin_, the lower limit of the temporal domain.

147 {
148  timeMin_ = timeMin;
149 }

References timeMin_.

Referenced by commandLineCG(), and main().

◆ setVerbose()

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

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

◆ setX()

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

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

187 {
188  min_.X = min;
189  max_.X = max;
190 }

References max_, min_, and Vec3D::X.

Referenced by commandLineCG(), and setXGrid().

◆ setXGrid()

void BaseCG::setXGrid ( Mdouble  min,
Mdouble  max,
Mdouble  h 
)
205 {
206  setX(min,max);
207  setHX(h);
208 }
void setX(Mdouble min, Mdouble max)
Sets min_.X, max_.X, the limits of the spatial domain in X.
Definition: BaseCG.cc:186

References setHX(), and setX().

◆ setY()

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

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

193 {
194  min_.Y = min;
195  max_.Y = max;
196 }

References max_, min_, and Vec3D::Y.

Referenced by commandLineCG(), and setYGrid().

◆ setYGrid()

void BaseCG::setYGrid ( Mdouble  min,
Mdouble  max,
Mdouble  h 
)
211 {
212  setY(min,max);
213  setHY(h);
214 }
void setY(Mdouble min, Mdouble max)
Sets min_.Y, max_.Y, the limits of the spatial domain in Y.
Definition: BaseCG.cc:192

References setHY(), and setY().

◆ setZ()

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

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

199 {
200  min_.Z = min;
201  max_.Z = max;
202 }

References max_, min_, and Vec3D::Z.

Referenced by commandLineCG(), and setZGrid().

◆ setZGrid()

void BaseCG::setZGrid ( Mdouble  min,
Mdouble  max,
Mdouble  h 
)
217 {
218  setZ(min,max);
219  setHZ(h);
220 }
void setZ(Mdouble min, Mdouble max)
Sets min_.Z, max_.Z, the limits of the spatial domain in Z.
Definition: BaseCG.cc:198

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

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  if (verbose_) os << " verbose 1";
70  //statFile
71 }
virtual Mdouble getWidth() const =0
Returns width_, the coarse-graining width.
virtual std::string getName() const =0
A purely virtual function.

References BaseObject::getName(), getWidth(), 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: