SPH
Public Member Functions | List of all members
SymmetricGravity Class Reference

#include <SymmetricGravity.h>

Inheritance diagram for SymmetricGravity:
IGravity Polymorphic

Public Member Functions

 SymmetricGravity (AutoPtr< IGravity > &&gravity)
 
virtual void build (IScheduler &scheduler, const Storage &storage) override
 Builds the accelerating structure. More...
 
virtual void evalAll (IScheduler &scheduler, ArrayView< Vector > dv, Statistics &stats) const override
 Evaluates the gravitational acceleration concurrently. More...
 
virtual Vector eval (const Vector &r0) const override
 Evaluates the gravitational acceleration at given point. More...
 
virtual Float evalEnergy (IScheduler &scheduler, Statistics &stats) const override
 Computes the total potential energy of the particles. More...
 
virtual RawPtr< const IBasicFindergetFinder () const override
 Optionally returns a finder used by the gravity implementation. More...
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 

Detailed Description

Definition at line 16 of file SymmetricGravity.h.

Constructor & Destructor Documentation

◆ SymmetricGravity()

SymmetricGravity::SymmetricGravity ( AutoPtr< IGravity > &&  gravity)
inlineexplicit

Definition at line 23 of file SymmetricGravity.h.

Member Function Documentation

◆ build()

virtual void SymmetricGravity::build ( IScheduler scheduler,
const Storage storage 
)
inlineoverridevirtual

Builds the accelerating structure.

Needs to be called every time step.

Parameters
schedulerScheduler used for parallelization of the build. Use SEQUENTAIL for sequential (single-threaded) execution.

Implements IGravity.

Definition at line 28 of file SymmetricGravity.h.

◆ eval()

virtual Vector SymmetricGravity::eval ( const Vector r0) const
inlineoverridevirtual

Evaluates the gravitational acceleration at given point.

The point must NOT correspond to any particle, as this case could formally lead to infinite acceleration if no smoothing kernel is used.

Parameters
r0Point where the gravity is evaluated.

Implements IGravity.

Definition at line 77 of file SymmetricGravity.h.

◆ evalAll()

virtual void SymmetricGravity::evalAll ( IScheduler scheduler,
ArrayView< Vector dv,
Statistics stats 
) const
inlineoverridevirtual

Evaluates the gravitational acceleration concurrently.

The function is blocking, it must exit after the gravity is evaluated.

Parameters
schedulerScheduler used for parallelization.
dvAcceleration values; it may already contain some accelerations computed by other code components, gravity should add acceleration instead of replacing the current values.
statsOutput statistics of the gravitational solver.

Implements IGravity.

Definition at line 64 of file SymmetricGravity.h.

◆ evalEnergy()

virtual Float SymmetricGravity::evalEnergy ( IScheduler scheduler,
Statistics stats 
) const
inlineoverridevirtual

Computes the total potential energy of the particles.

The zero point is implementation-specific; it is not required that the energy is strictly negative.

Parameters
schedulerScheduler used for parallelization.
statsOutput statistics of the gravitational solver.

Implements IGravity.

Definition at line 81 of file SymmetricGravity.h.

◆ getFinder()

virtual RawPtr<const IBasicFinder> SymmetricGravity::getFinder ( ) const
inlineoverridevirtual

Optionally returns a finder used by the gravity implementation.

If the gravity uses an acceleration structure that implements the IBasicFinder interface, this function allows the user to obtain the object and re-use in other parts of the code. Finder is assumed to be initialized after build is called.

If the gravity does not use any such structure or it simply does not implement the IBasicFinder interface, the function returns nullptr.

Implements IGravity.

Definition at line 85 of file SymmetricGravity.h.


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