112 template <
typename TDerived>
133 virtual void clear()
override;
139 return static_cast<const TDerived*
>(
this)->getX(r);
220 actPeriod = params.
period;
229 virtual void clear()
override;
235 bool isExpired(
const Float x,
const Float t)
const;
267 const std::string&
name)
286 virtual void clear()
override;
306 return "Angular histogram of velocities";
311 virtual void clear()
override;
333 virtual std::string
getCaption()
const override;
337 virtual void clear()
override;
356 virtual std::string
getCaption()
const override;
360 virtual void clear()
override;
372 : plots(
std::move(plots)) {}
375 return plots[0]->getCaption();
380 virtual void clear()
override;
Various function for interpretation of the results of a simulation.
#define SPH_ASSERT(x,...)
uint32_t Size
Integral type used to index arrays (by default).
double Float
Precision used withing the code. Use Float instead of float or double where precision is important.
Integrals of motion and other integral quantities.
#define INLINE
Macros for conditional compilation based on selected compiler.
#define NAMESPACE_SPH_END
Class defining additional operators from existing ones.
const NothingType NOTHING
Array< Float > getLinearTics(const Interval &interval, const Size minCount)
Returns the tics to be drawn on a linear axis of a plot.
Array< Float > getLogTics(const Interval &interval, const Size minCount)
Returns the tics to be drawn on a logarithmic axis of a plot.
QuantityMetadata getMetadata(const QuantityId key)
Returns the quantity information using quantity ID.
QuantityId
Unique IDs of basic quantities of SPH particles.
INLINE Float getLength(const Vector &v)
Returns the length of the vector. Enabled only for vectors of floating-point precision.
INLINE float dot(const BasicVector< float > &v1, const BasicVector< float > &v2)
Make sure the vector is trivially constructible and destructible, needed for fast initialization of a...
Differential histogram of angular distribution.
virtual void onTimeStep(const Storage &storage, const Statistics &stats) override
Updates the plot with new data.
AngularHistogramPlot(const Float period)
virtual std::string getCaption() const override
Returns the caption of the plot.
virtual void clear() override
Clears all cached data, prepares for next run.
virtual void plot(IDrawingContext &dc) const override
Draws the plot into the drawing context.
Wrapper of pointer that deletes the resource from destructor.
Plots a dependence of given quantity on the distance from given axis.
INLINE Float getX(const Vector &r) const
AxialDistributionPlot(const Vector &axis, const QuantityId id, const Optional< Size > binCnt=NOTHING)
Plots given array of points.
virtual void plot(IDrawingContext &dc) const override
Draws the plot into the drawing context.
virtual void onTimeStep(const Storage &storage, const Statistics &stats) override
Updates the plot with new data.
virtual std::string getCaption() const override
Returns the caption of the plot.
DataPlot(const Array< Post::HistPoint > &points, const Flags< AxisScaleEnum > scale, const std::string &name)
virtual void clear() override
Clears all cached data, prepares for next run.
Differential histogram of quantities.
Post::ExtHistogramId id
ID of a quantity from which the histogram is constructed.
Float period
Period of redrawing the histogram. Zero means the histogram is drawn every time step.
HistogramPlot(const QuantityId id, const Optional< Interval > interval, const Float period)
virtual void plot(IDrawingContext &dc) const override
Draws the plot into the drawing context.
HistogramPlot(const Post::HistogramId id, const Optional< Interval > interval, const Float period, const std::string &name)
virtual std::string getCaption() const override
Returns the caption of the plot.
std::string name
Displayed name of the histogram.
virtual void clear() override
Clears all cached data, prepares for next run.
Optional< Interval > interval
Array< Post::HistPoint > points
Points representing the histogram.
virtual void onTimeStep(const Storage &storage, const Statistics &stats) override
Updates the plot with new data.
virtual void endPath()=0
Finalizes the path. Does not connect the last point to anything.
virtual void closePath()=0
Closes the path, connecting to the first point on the path.
virtual void addPoint(const PlotPoint &point)=0
Adds a next point on the path.
Abstraction of a drawing context.
virtual void drawLine(const PlotPoint &from, const PlotPoint &to)=0
Draws a line connecting two points.
virtual AutoPtr< IDrawPath > drawPath()=0
Draws a path connecting points.
virtual void setStyle(const Size index)=0
Changes the current drawing style.
virtual void drawErrorPoint(const ErrorPlotPoint &point)=0
Adds a point with error bars to the plot.
virtual void setTransformMatrix(const AffineMatrix2 &matrix)=0
Applies the given tranformation matrix on all primitives.
virtual void drawPoint(const PlotPoint &point)=0
Adds a single point to the plot.
Interface for constructing generic plots from quantities stored in storage.
virtual void onTimeStep(const Storage &storage, const Statistics &stats)=0
Updates the plot with new data.
Interval rangeX() const
Returns the plotted range in x-coordinate.
virtual void plot(IDrawingContext &dc) const =0
Draws the plot into the drawing context.
virtual std::string getCaption() const =0
Returns the caption of the plot.
virtual void clear()=0
Clears all cached data, prepares for next run.
Interval rangeY() const
Returns the plotted range in y-coordinate.
Helper integral wrapping another integral and converting the returned value to scalar.
virtual std::string getName() const override
Returns the name of the integral.
Object representing a 1D interval of real numbers.
Helper object used for drawing multiple plots into the same device.
MultiPlot(Array< AutoPtr< IPlot >> &&plots)
virtual void clear() override
Clears all cached data, prepares for next run.
virtual void onTimeStep(const Storage &storage, const Statistics &stats) override
Updates the plot with new data.
virtual std::string getCaption() const override
Returns the caption of the plot.
virtual void plot(IDrawingContext &dc) const override
Draws the plot into the drawing context.
Plots a dependence of given quantity on the distance from the origin.
INLINE Float getX(const Vector &r) const
RadialDistributionPlot(const QuantityId id, const Optional< Size > binCnt=NOTHING)
virtual void clear() override
Clears all cached data, prepares for next run.
virtual std::string getCaption() const override
Returns the caption of the plot.
virtual void plot(IDrawingContext &dc) const override
Draws the plot into the drawing context.
virtual void onTimeStep(const Storage &storage, const Statistics &stats) override
Updates the plot with new data.
SfdPlot(const Flags< Post::ComponentFlag > connectivity, const Float period)
Plots SFD of components, given their connectivity.
Base class for plots showing a dependence of given quantity on a spatial coordinate.
virtual void clear() override
Clears all cached data, prepares for next run.
Array< PlotPoint > points
virtual void plot(IDrawingContext &dc) const override
Draws the plot into the drawing context.
virtual std::string getCaption() const override
Returns the caption of the plot.
virtual void onTimeStep(const Storage &storage, const Statistics &UNUSED(stats)) override
SpatialPlot(const QuantityId id, const Optional< Size > binCnt=NOTHING)
Constructs the spatial plot.
Object holding various statistics about current run.
Container storing all quantities used within the simulations.
Plot of temporal dependence of a scalar quantity.
TemporalPlot(const IntegralWrapper &integral, const Params ¶ms)
Creates a plot showing the whole history of given integral.
virtual void plot(IDrawingContext &dc) const override
Draws the plot into the drawing context.
virtual void clear() override
Clears all cached data, prepares for next run.
virtual std::string getCaption() const override
Returns the caption of the plot.
virtual void onTimeStep(const Storage &storage, const Statistics &stats) override
Updates the plot with new data.
HistogramSource
Source data used to construct the histogram.
HistogramId
Quantity from which the histogram is constructed.
Overload of std::swap for Sph::Array.
Base class for all polymorphic objects.
Float segment
Plotted time segment.
Interval fixedRangeX
Fixed x-range for the plot. If empty, a dynamic range is used.
Float minRangeY
Minimal size of the y-range.
Float period
Time that needs to pass before a new point is added.
bool shrinkY
When discarting points out of plotted range, shrink y-axis to fit currently visible points.