SPH
Functions
Initial.cpp File Reference
#include "sph/initial/Initial.h"
#include "math/rng/VectorRng.h"
#include "objects/finders/NeighbourFinder.h"
#include "objects/geometry/Domain.h"
#include "objects/geometry/Sphere.h"
#include "physics/Eos.h"
#include "physics/Integrals.h"
#include "quantities/IMaterial.h"
#include "quantities/Quantity.h"
#include "quantities/Storage.h"
#include "sph/initial/Distribution.h"
#include "system/Factory.h"
#include "system/Profiler.h"
#include "thread/Scheduler.h"
#include "timestepping/ISolver.h"

Go to the source code of this file.

Functions

void repelParticles (ArrayView< Vector > r, const Float radius)
 Displaces particles so that no two particles overlap. More...
 
Vector moveToCenterOfMassSystem (ArrayView< const Float > m, ArrayView< Vector > r)
 Modifies particle positions so that their center of mass lies at the origin. More...
 
void moveToCenterOfMassSystem (Storage &storage)
 Modifies particle positions and velocities so that the center of mass is at the origin and the total momentum is zero. More...
 

Function Documentation

◆ moveToCenterOfMassSystem() [1/2]

Vector moveToCenterOfMassSystem ( ArrayView< const Float m,
ArrayView< Vector r 
)

Modifies particle positions so that their center of mass lies at the origin.

Function can be also used for particle velocities, modifying them so that the total momentum is zero.

Parameters
mParticle masses; must be positive values
rParticle positions (or velocities)
Returns
Computed center of mass, subtracted from positions.

Definition at line 363 of file Initial.cpp.

◆ moveToCenterOfMassSystem() [2/2]

void moveToCenterOfMassSystem ( Storage storage)

Modifies particle positions and velocities so that the center of mass is at the origin and the total momentum is zero.

Definition at line 379 of file Initial.cpp.

◆ repelParticles()

void repelParticles ( ArrayView< Vector r,
const Float  radius 
)

Displaces particles so that no two particles overlap.

In case no particles overlap, function does nothing.

Parameters
rPositions of particles
radiusRadius of the particles in units of smoothing length.

Definition at line 335 of file Initial.cpp.