26 template <
typename Type>
53 virtual std::string
getName()
const override {
71 virtual std::string
getName()
const override {
72 return "Total momentum";
90 virtual std::string
getName()
const override {
91 return "Total angular momentum";
109 virtual std::string
getName()
const override {
110 return "Kinetic energy";
123 virtual std::string
getName()
const override {
124 return "Internal energy";
141 virtual std::string
getName()
const override {
142 return "Total energy";
159 virtual std::string
getName()
const override {
160 return "Center of mass";
174 virtual std::string
name()
const = 0;
197 virtual std::string
getName()
const override {
219 virtual std::string
getName()
const override {
239 template <
typename TIntegral>
241 name = integral->getName();
242 closure = [i = std::move(integral)](
243 const Storage& storage) ->
Dynamic {
return i->evaluate(storage); };
247 return closure(storage).getScalar();
250 virtual std::string
getName()
const override {
Generic dynamically allocated resizable storage.
Object holding a single values of various types.
Generic wrappers of lambdas, functors and other callables.
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.
Computing minimum, maximum and mean value of floats.
#define NAMESPACE_SPH_END
const NothingType NOTHING
QuantityMetadata getMetadata(const QuantityId key)
Returns the quantity information using quantity ID.
QuantityId
Unique IDs of basic quantities of SPH particles.
Wrapper of pointer that deletes the resource from destructor.
Computes the center of mass of particles.
virtual Vector evaluate(const Storage &storage) const override
Computes the integral quantity using particles in the storage.
CenterOfMass(const Optional< Size > bodyId=NOTHING)
virtual std::string getName() const override
Returns the name of the integral.
Convenient object for storing a single value of different types.
Interface for classes computing integral quantities from storage.
virtual Type evaluate(const Storage &storage) const =0
Computes the integral quantity using particles in the storage.
virtual std::string getName() const =0
Returns the name of the integral.
Interface for auxilirary user-defined scalar quantities.
virtual Float evaluate(const Size i) const =0
virtual void initialize(const Storage &storage)=0
virtual std::string name() const =0
Helper integral wrapping another integral and converting the returned value to scalar.
virtual Float evaluate(const Storage &storage) const override
Computes the integral quantity using particles in the storage.
IntegralWrapper(AutoPtr< TIntegral > &&integral)
IntegralWrapper()=default
virtual std::string getName() const override
Returns the name of the integral.
Helper class for statistics, accumulating minimal, maximal and mean value of a set of numbers.
Returns means of given scalar quantity.
QuantityMeans(const QuantityId id, const Optional< Size > bodyId=NOTHING)
Computes mean of quantity values.
virtual MinMaxMean evaluate(const Storage &storage) const override
Computes the integral quantity using particles in the storage.
virtual std::string getName() const override
Returns the name of the integral.
Returns the quantity value of given particle.
QuantityValue(const QuantityId id, const Size particleIdx)
virtual std::string getName() const override
Returns the name of the integral.
virtual Float evaluate(const Storage &storage) const override
Computes the integral quantity using particles in the storage.
Container storing all quantities used within the simulations.
Computes total angular momentum of all SPH particles with a respect to the reference frame.
virtual Vector evaluate(const Storage &storage) const override
Computes the integral quantity using particles in the storage.
TotalAngularMomentum(const Float frameFrequency=0._f)
virtual std::string getName() const override
Returns the name of the integral.
Returns the total energy of all particles.
virtual Float evaluate(const Storage &storage) const override
Computes the integral quantity using particles in the storage.
virtual std::string getName() const override
Returns the name of the integral.
TotalEnergy(const Float omega=0._f)
Returns the total internal energy of all particles.
virtual Float evaluate(const Storage &storage) const override
Computes the integral quantity using particles in the storage.
virtual std::string getName() const override
Returns the name of the integral.
Returns the total kinetic energy of all particles.
virtual Float evaluate(const Storage &storage) const override
Computes the integral quantity using particles in the storage.
TotalKineticEnergy(const Float omega=0._f)
virtual std::string getName() const override
Returns the name of the integral.
Computes the total mass of all SPH particles.
virtual Float evaluate(const Storage &storage) const override
Computes the integral quantity using particles in the storage.
virtual std::string getName() const override
Returns the name of the integral.
Computes total momentum of all SPH particles with a respect to the reference frame.
virtual std::string getName() const override
Returns the name of the integral.
virtual Vector evaluate(const Storage &storage) const override
Computes the integral quantity using particles in the storage.
TotalMomentum(const Float omega=0._f)
Variant, an implementation of type-safe union, similar to std::variant or boost::variant.
Optional< T > tryGet() const
Returns the stored value in the variant.
INLINE T & get()
Returns the stored value.
Generic storage and input/output routines of settings.
Base class for all polymorphic objects.