SPH
|
#include <SymmetricGravity.h>
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 IBasicFinder > | getFinder () const override |
Optionally returns a finder used by the gravity implementation. More... | |
![]() | |
virtual | ~Polymorphic () |
Definition at line 16 of file SymmetricGravity.h.
Definition at line 23 of file SymmetricGravity.h.
|
inlineoverridevirtual |
Builds the accelerating structure.
Needs to be called every time step.
scheduler | Scheduler used for parallelization of the build. Use SEQUENTAIL for sequential (single-threaded) execution. |
Implements IGravity.
Definition at line 28 of file SymmetricGravity.h.
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.
r0 | Point where the gravity is evaluated. |
Implements IGravity.
Definition at line 77 of file SymmetricGravity.h.
|
inlineoverridevirtual |
Evaluates the gravitational acceleration concurrently.
The function is blocking, it must exit after the gravity is evaluated.
scheduler | Scheduler used for parallelization. |
dv | Acceleration values; it may already contain some accelerations computed by other code components, gravity should add acceleration instead of replacing the current values. |
stats | Output statistics of the gravitational solver. |
Implements IGravity.
Definition at line 64 of file SymmetricGravity.h.
|
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.
scheduler | Scheduler used for parallelization. |
stats | Output statistics of the gravitational solver. |
Implements IGravity.
Definition at line 81 of file SymmetricGravity.h.
|
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.