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

Spherically symmetrized gravitational force. More...

#include <SphericalGravity.h>

Inheritance diagram for SphericalGravity:
IGravity Polymorphic

Public Member Functions

 SphericalGravity (const Vector &center=Vector(0._f))
 
virtual void build (IScheduler &UNUSED(scheduler), const Storage &storage) override
 
virtual void evalAll (IScheduler &scheduler, ArrayView< Vector > dv, Statistics &UNUSED(stats)) const override
 
virtual Vector eval (const Vector &r0) const override
 Evaluates the gravitational acceleration at given point. More...
 
virtual Float evalEnergy (IScheduler &UNUSED(scheduler), Statistics &UNUSED(stats)) const override
 
virtual RawPtr< const IBasicFindergetFinder () const override
 Optionally returns a finder used by the gravity implementation. More...
 
- Public Member Functions inherited from IGravity
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 Float evalEnergy (IScheduler &scheduler, Statistics &stats) const =0
 Computes the total potential energy of the particles. More...
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 

Detailed Description

Spherically symmetrized gravitational force.

Computes gravitational force of a homogeneous sphere. This is the fastest possible evaluation of gravity, but it's very imprecise and limited only to spheres, so it is only intended to be used for simple tests and sanity checks of more complex gravity models. Particles are assumed to be spherically symmetric; the force can be used even for different particle distributions, but may yield incorrect results.

Definition at line 23 of file SphericalGravity.h.

Constructor & Destructor Documentation

◆ SphericalGravity()

SphericalGravity::SphericalGravity ( const Vector center = Vector(0._f))
inline

Definition at line 30 of file SphericalGravity.h.

Member Function Documentation

◆ build()

virtual void SphericalGravity::build ( IScheduler UNUSEDscheduler,
const Storage storage 
)
inlineoverridevirtual

Definition at line 33 of file SphericalGravity.h.

◆ eval()

virtual Vector SphericalGravity::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 47 of file SphericalGravity.h.

◆ evalAll()

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

Definition at line 38 of file SphericalGravity.h.

◆ evalEnergy()

virtual Float SphericalGravity::evalEnergy ( IScheduler UNUSEDscheduler,
Statistics UNUSEDstats 
) const
inlineoverridevirtual

Definition at line 52 of file SphericalGravity.h.

◆ getFinder()

virtual RawPtr<const IBasicFinder> SphericalGravity::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 57 of file SphericalGravity.h.


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