SPH
|
Classes | |
struct | Tumbler |
struct | HistogramParams |
Parameters of the histogram. More... | |
struct | HistPoint |
Point in the histogram. More... | |
class | LinearFunction |
Class representing an ordinary 1D linear function. More... | |
class | QuadraticFunction |
struct | KsResult |
Typedefs | |
using | ExtHistogramId = ExtendedEnum< HistogramId > |
using | KsFunction = Function< StaticArray< Float, 4 >(PlotPoint)> |
Enumerations | |
enum class | ComponentFlag { OVERLAP = 0 , SEPARATE_BY_FLAG = 1 << 0 , ESCAPE_VELOCITY = 1 << 1 , SORT_BY_MASS = 1 << 2 } |
enum class | MoonEnum { LARGEST_FRAGMENT , RUNAWAY , MOON , IMPACTOR , UNOBSERVABLE } |
Potential relationship of the body with a respect to the largest remnant (fragment). More... | |
enum class | HistogramId { RADII = -1 , EQUIVALENT_MASS_RADII = -2 , VELOCITIES = -3 , ROTATIONAL_FREQUENCY = -4 , ROTATIONAL_PERIOD = -5 , ROTATIONAL_AXIS = -6 } |
Quantity from which the histogram is constructed. More... | |
enum class | HistogramSource { COMPONENTS , PARTICLES } |
Source data used to construct the histogram. More... | |
Functions | |
Array< Size > | findNeighbourCounts (const Storage &storage, const Float particleRadius) |
Finds the number of neighbours of each particle. More... | |
Size | findComponents (const Storage &storage, const Float particleRadius, const Flags< ComponentFlag > flags, Array< Size > &indices) |
Finds and marks connected components (a.k.a. separated bodies) in the array of vertices. More... | |
Array< Size > | findLargestComponent (const Storage &storage, const Float particleRadius, const Flags< ComponentFlag > flags) |
Returns the indices of particles belonging to the largest remnant. More... | |
Array< Tumbler > | findTumblers (const Storage &storage, const Float limit) |
Find all tumbling asteroids. More... | |
Array< MoonEnum > | findMoons (const Storage &storage, const Float radius=1._f, const Float limit=0._f) |
Find a potential satellites of the largest body. More... | |
Size | findMoonCount (ArrayView< const Float > m, ArrayView< const Vector > r, ArrayView< const Vector > v, const Size i, const Float radius=1._f, const Float limit=0._f) |
Find the number of moons of given body. More... | |
Vector | getCenterOfMass (ArrayView< const Float > m, ArrayView< const Vector > r, ArrayView< const Size > idxs=nullptr) |
Computes the center of mass. More... | |
SymmetricTensor | getInertiaTensor (ArrayView< const Float > m, ArrayView< const Vector > r, const Vector &r0, ArrayView< const Size > idxs=nullptr) |
Computes the total inertia tensor of particles with respect to given center. More... | |
SymmetricTensor | getInertiaTensor (ArrayView< const Float > m, ArrayView< const Vector > r, ArrayView< const Size > idxs=nullptr) |
Computes the total inertia tensor of particle with respect to their center of mass. More... | |
Vector | getAngularFrequency (ArrayView< const Float > m, ArrayView< const Vector > r, ArrayView< const Vector > v, const Vector &r0, const Vector &v0, ArrayView< const Size > idxs=nullptr) |
Computes the immediate vector of angular frequency of a rigid body. More... | |
Vector | getAngularFrequency (ArrayView< const Float > m, ArrayView< const Vector > r, ArrayView< const Vector > v, ArrayView< const Size > idxs=nullptr) |
Float | getSphericity (IScheduler &scheduler, const Storage &strorage, const Float resolution=0.05_f) |
Computes the sphericity coefficient of a body. More... | |
Array< HistPoint > | getDifferentialHistogram (ArrayView< const Float > values, const HistogramParams ¶ms) |
Computes the differential histogram from given values. More... | |
Array< HistPoint > | getDifferentialHistogram (const Storage &storage, const ExtHistogramId id, const HistogramSource source, const HistogramParams ¶ms) |
Computes the differential histogram of particles in the storage. More... | |
Array< HistPoint > | getCumulativeHistogram (const Storage &storage, const ExtHistogramId id, const HistogramSource source, const HistogramParams ¶ms) |
Computes cumulative (integral) histogram of particles in the storage. More... | |
LinearFunction | getLinearFit (ArrayView< const PlotPoint > points) |
Finds a linear fit to a set of points. More... | |
QuadraticFunction | getQuadraticFit (ArrayView< const PlotPoint > points) |
Outcome | compareParticles (const Storage &test, const Storage &ref, const Float eps=1.e-6_f) |
Compares particle positions and state quantities of two storages. More... | |
Outcome | compareLargeSpheres (const Storage &test, const Storage &ref, const Float fraction, const Float maxDeviation, const Float eps=1.e-6_f) |
Compares the positions, velocities and radii of the largest particles in given states. More... | |
Float | correlationCoefficient (ArrayView< const PlotPoint > points) |
Float | chiSquareDistribution (const Float chiSqr, const Float dof) |
Float | chiSquareTest (ArrayView< const Float > measured, ArrayView< const Float > expected) |
Float | kolmogorovSmirnovDistribution (const Float x) |
KsResult | kolmogorovSmirnovTest (ArrayView< const Float > data, const Function< Float(Float)> &expectedCdf) |
One-dimensional Kolmogorov-Smirnov test with given CDF of expected probability distribution. More... | |
KsResult | kolmogorovSmirnovTest (ArrayView< const Float > data1, ArrayView< const Float > data2) |
KsResult | kolmogorovSmirnovTest (ArrayView< const PlotPoint > data, const KsFunction &expected) |
Two-dimensional Kolmogorov-Smirnov test. More... | |
KsFunction | getUniformKsFunction (Interval rangeX, Interval rangeY) |
using Post::ExtHistogramId = typedef ExtendedEnum<HistogramId> |
Definition at line 214 of file Analysis.h.
using Post::KsFunction = typedef Function<StaticArray<Float, 4>(PlotPoint)> |
Definition at line 30 of file StatisticTests.h.
|
strong |
Definition at line 39 of file Analysis.h.
|
strong |
Quantity from which the histogram is constructed.
Beside the listed options, any QuantityId can be used, by casting to HistogramId enum. All values of HistogramId has to be negative to avoid clashes.
Enumerator | |
---|---|
RADII | Particle radii or equivalent radii of components. |
EQUIVALENT_MASS_RADII | Radii determined from particle masses and given reference density. This generally given more 'discretized' SFD, as masses of SPH particles are constant during the run, whereas radii (smoothing lenghts) or densities may change. |
VELOCITIES | Particle velocities. |
ROTATIONAL_FREQUENCY | Rotational frequency in revs/day. |
ROTATIONAL_PERIOD | Rotational periods of particles (in hours)
|
ROTATIONAL_AXIS | Distribution of axis directions, from -pi to pi. |
Definition at line 191 of file Analysis.h.
|
strong |
Source data used to construct the histogram.
Enumerator | |
---|---|
COMPONENTS | Equivalent radii of connected chunks of particles (SPH framework) |
PARTICLES | Radii of individual particles, considering particles as spheres (N-body framework) |
Definition at line 217 of file Analysis.h.
|
strong |
Potential relationship of the body with a respect to the largest remnant (fragment).
Definition at line 96 of file Analysis.h.
Definition at line 28 of file StatisticTests.cpp.
Definition at line 33 of file StatisticTests.cpp.
Outcome Post::compareLargeSpheres | ( | const Storage & | test, |
const Storage & | ref, | ||
const Float | fraction, | ||
const Float | maxDeviation, | ||
const Float | eps = 1.e-6_f |
||
) |
Compares the positions, velocities and radii of the largest particles in given states.
If both states match, returns SUCCESS, otherwise returns an explanatory message. This comparison method in suitable for N-body simulations with merging. Function considers two states equal even if they differ by few particles.
test | Particles to test |
ref | Reference particles |
fraction | Fraction of the largest particles to test. The rest is considered a "noise". |
maxDeviation | Maximal difference in positions of matching particles |
eps | Allowed relative error. |
Definition at line 101 of file Compare.cpp.
NAMESPACE_SPH_BEGIN Outcome Post::compareParticles | ( | const Storage & | test, |
const Storage & | ref, | ||
const Float | eps = 1.e-6_f |
||
) |
Compares particle positions and state quantities of two storages.
If both states match, returns SUCCESS, otherwise returns an explanatory message. This comparison method is mainly intended for SPH simulations.
test | Particles to test |
ref | Reference particles |
eps | Allowed relative error. |
Definition at line 9 of file Compare.cpp.
NAMESPACE_SPH_BEGIN Float Post::correlationCoefficient | ( | ArrayView< const PlotPoint > | points | ) |
Definition at line 7 of file StatisticTests.cpp.
Size Post::findComponents | ( | const Storage & | storage, |
const Float | particleRadius, | ||
const Flags< ComponentFlag > | flags, | ||
Array< Size > & | indices | ||
) |
Finds and marks connected components (a.k.a. separated bodies) in the array of vertices.
It is a useful function for finding bodies in simulations where we do not merge particles.
storage | Storage containing the particles. Must also contain QuantityId::FLAG if SEPARATE_BY_FLAG option is used. |
particleRadius | Size of particles in smoothing lengths. |
flags | Flags specifying connectivity of components, etc; see emum ComponentFlag. |
indices[out] | Array of indices from 0 to n-1, where n is the number of components. In the array, i-th index corresponds to component to which i-th particle belongs. |
Definition at line 86 of file Analysis.cpp.
Array< Size > Post::findLargestComponent | ( | const Storage & | storage, |
const Float | particleRadius, | ||
const Flags< ComponentFlag > | flags | ||
) |
Returns the indices of particles belonging to the largest remnant.
The returned indices are sorted.
Definition at line 216 of file Analysis.cpp.
Size Post::findMoonCount | ( | ArrayView< const Float > | m, |
ArrayView< const Vector > | r, | ||
ArrayView< const Vector > | v, | ||
const Size | i, | ||
const Float | radius = 1._f , |
||
const Float | limit = 0._f |
||
) |
Find the number of moons of given body.
m | Masses of bodies, sorted in descending order. |
r | Positions and radii of bodies, sorted by mass (in descending order) |
v | Velocities of bodies, sorted by mass (in descending order) |
i | Index of the queried body |
radius | Radius multiplier, may be used to exclude moons with pericenter very close to the body. |
limit | Limiting mass radio, moons with masses lower than limit*m[i] are excluded. |
Definition at line 415 of file Analysis.cpp.
Array< Post::MoonEnum > Post::findMoons | ( | const Storage & | storage, |
const Float | radius = 1._f , |
||
const Float | limit = 0._f |
||
) |
Find a potential satellites of the largest body.
The sattelites are mainly determined using the total energy of the bodies; if the energy is negative, the body is likely to be a sattelite. Note that the N-body interactions can eject bodies with negative energy away from the largest remnant (fragment), and also make a body with positive energy a future satellite (by decreasing the energy during close encounter with 3rd body). If the energy of a body is negative, a Keplerian ellipse (assuming 2-body problem) is computed and based on this ellipse, the body is either marked as moon or as impactor.
The function is mainly intended for post-reaccumulation analysis of the created asteroidal family. Satellites determined during reaccumulation can be very uncertain, as explained above. The storage must contains positions (with velocities) and masses of the bodies. The bodies do not have to be sorted, the largest remnant (or fragment) is defined as the most massive body.
storage | Storage containing bodies of the asteroidal family |
radius | Relative radius of bodies, multiplying the radius stored in h-component. Used only in collision detection; value 0 turns it off completely. |
limit | Relative observational limit, with a respect to the largest remnant (fragment). Bodies with radius smaller than \({\rm limit} \cdot R_{\rm lr}\) are marked as UNOBSERVABLE, regardless their bound status. Must be in interval [0, 1>. |
Definition at line 367 of file Analysis.cpp.
NAMESPACE_SPH_BEGIN Array< Size > Post::findNeighbourCounts | ( | const Storage & | storage, |
const Float | particleRadius | ||
) |
Finds the number of neighbours of each particle.
Note that each particle searches neighbours up to the distance given by their smoothing length, so the relation "A is a neighbour of B" might not be symmetrical.
storage | Storage containing the particles. |
particleRadius | Size of particles in smoothing lengths. |
Definition at line 22 of file Analysis.cpp.
Array< Post::Tumbler > Post::findTumblers | ( | const Storage & | storage, |
const Float | limit | ||
) |
Find all tumbling asteroids.
Limit specifies the required misalignment angle (in radians) for asteroid to be considered a tumbler. Note that tumbling begins to be detectable for the misalignment angle larger than 15 degrees with high accuracy data (Henych, 2013).
Definition at line 441 of file Analysis.cpp.
Vector Post::getAngularFrequency | ( | ArrayView< const Float > | m, |
ArrayView< const Vector > | r, | ||
ArrayView< const Vector > | v, | ||
ArrayView< const Size > | idxs = nullptr |
||
) |
Definition at line 541 of file Analysis.cpp.
Vector Post::getAngularFrequency | ( | ArrayView< const Float > | m, |
ArrayView< const Vector > | r, | ||
ArrayView< const Vector > | v, | ||
const Vector & | r0, | ||
const Vector & | v0, | ||
ArrayView< const Size > | idxs = nullptr |
||
) |
Computes the immediate vector of angular frequency of a rigid body.
Definition at line 514 of file Analysis.cpp.
Vector Post::getCenterOfMass | ( | ArrayView< const Float > | m, |
ArrayView< const Vector > | r, | ||
ArrayView< const Size > | idxs = nullptr |
||
) |
Computes the center of mass.
Definition at line 461 of file Analysis.cpp.
Array< Post::HistPoint > Post::getCumulativeHistogram | ( | const Storage & | storage, |
const ExtHistogramId | id, | ||
const HistogramSource | source, | ||
const HistogramParams & | params | ||
) |
Computes cumulative (integral) histogram of particles in the storage.
storage | Storage containing particle data. |
id | Specifies the quantity for which the histogram is constructed. |
source | Specifies the input bodies, see HistogramSource. |
params | Parameters of the histogram. |
Definition at line 814 of file Analysis.cpp.
Array< Post::HistPoint > Post::getDifferentialHistogram | ( | ArrayView< const Float > | values, |
const HistogramParams & | params | ||
) |
Computes the differential histogram from given values.
Note that only bin count and input range are used from the histogram parameters. No cut-offs are applied.
Definition at line 861 of file Analysis.cpp.
Array< Post::HistPoint > Post::getDifferentialHistogram | ( | const Storage & | storage, |
const ExtHistogramId | id, | ||
const HistogramSource | source, | ||
const HistogramParams & | params | ||
) |
Computes the differential histogram of particles in the storage.
Definition at line 852 of file Analysis.cpp.
SymmetricTensor Post::getInertiaTensor | ( | ArrayView< const Float > | m, |
ArrayView< const Vector > | r, | ||
ArrayView< const Size > | idxs = nullptr |
||
) |
Computes the total inertia tensor of particle with respect to their center of mass.
Definition at line 506 of file Analysis.cpp.
SymmetricTensor Post::getInertiaTensor | ( | ArrayView< const Float > | m, |
ArrayView< const Vector > | r, | ||
const Vector & | r0, | ||
ArrayView< const Size > | idxs = nullptr |
||
) |
Computes the total inertia tensor of particles with respect to given center.
Definition at line 484 of file Analysis.cpp.
Post::LinearFunction Post::getLinearFit | ( | ArrayView< const PlotPoint > | points | ) |
Finds a linear fit to a set of points.
The set of points must have at least two elements and they must not coincide.
Definition at line 914 of file Analysis.cpp.
Post::QuadraticFunction Post::getQuadraticFit | ( | ArrayView< const PlotPoint > | points | ) |
Definition at line 935 of file Analysis.cpp.
Float Post::getSphericity | ( | IScheduler & | scheduler, |
const Storage & | strorage, | ||
const Float | resolution = 0.05_f |
||
) |
Computes the sphericity coefficient of a body.
Sphericity is defined as the ratio of the surface area of a sphere (with the same volume as the given body) to the surface area of the body ([Wadell_1935]). This value is equal to 1 for sphere (and only for sphere); the lower the value, the more the body is "aspheric". The sphericity is useful for quantification of "roundness"; the ratio of semi-axes, for example, can be easily 1 even for cube, definitely not a round body.
Note that the sphericity depends on resolution, small-scale topograpy will always cause the sphericity to decrease! When comparing sphericities, it is necessary to use the same resolution for the compared bodies.
scheduler | Scheduler potentially used for parallelization. |
storage | Storage containing particle positions, optionally also masses and densities. |
resolution | Relative resolution used to compute the sphericity. |
Definition at line 550 of file Analysis.cpp.
Post::KsFunction Post::getUniformKsFunction | ( | Interval | rangeX, |
Interval | rangeY | ||
) |
Definition at line 167 of file StatisticTests.cpp.
Definition at line 53 of file StatisticTests.cpp.
Post::KsResult Post::kolmogorovSmirnovTest | ( | ArrayView< const Float > | data, |
const Function< Float(Float)> & | expectedCdf | ||
) |
One-dimensional Kolmogorov-Smirnov test with given CDF of expected probability distribution.
Definition at line 92 of file StatisticTests.cpp.
Post::KsResult Post::kolmogorovSmirnovTest | ( | ArrayView< const Float > | data1, |
ArrayView< const Float > | data2 | ||
) |
Definition at line 111 of file StatisticTests.cpp.
Post::KsResult Post::kolmogorovSmirnovTest | ( | ArrayView< const PlotPoint > | data, |
const KsFunction & | expected | ||
) |
Two-dimensional Kolmogorov-Smirnov test.
Definition at line 149 of file StatisticTests.cpp.