SPH
|
Interface for computing gravitational interactions of particles. More...
#include <IGravity.h>
Public Member Functions | |
virtual void | build (IScheduler &scheduler, const Storage &storage)=0 |
Builds the accelerating structure. More... | |
virtual void | evalAll (IScheduler &scheduler, ArrayView< Vector > dv, Statistics &stats) const =0 |
Evaluates the gravitational acceleration concurrently. More... | |
virtual Vector | eval (const Vector &r0) const =0 |
Evaluates the gravitational acceleration at given point. More... | |
virtual Float | evalEnergy (IScheduler &scheduler, Statistics &stats) const =0 |
Computes the total potential energy of the particles. More... | |
virtual RawPtr< const IBasicFinder > | getFinder () const =0 |
Optionally returns a finder used by the gravity implementation. More... | |
Public Member Functions inherited from Polymorphic | |
virtual | ~Polymorphic () |
Interface for computing gravitational interactions of particles.
Definition at line 14 of file IGravity.h.
|
pure virtual |
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. |
Implemented in SymmetricGravity, CachedGravity, and BarnesHut.
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. |
Implemented in SymmetricGravity, SphericalGravity, CachedGravity, BruteForceGravity, and BarnesHut.
|
pure virtual |
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. |
Implemented in SymmetricGravity, CachedGravity, and BarnesHut.
|
pure virtual |
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. |
Implemented in SymmetricGravity, CachedGravity, and BarnesHut.
|
pure virtual |
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.
Implemented in SymmetricGravity, SphericalGravity, CachedGravity, BruteForceGravity, and BarnesHut.