SPH
Classes | Functions
Initial.h File Reference

Generating initial conditions of SPH particles. More...

#include "common/ForwardDecl.h"
#include "objects/containers/ArrayView.h"
#include "objects/geometry/Vector.h"
#include "objects/wrappers/Function.h"
#include "quantities/IMaterial.h"

Go to the source code of this file.

Classes

class  BodyView
 Non-owning view of particles belonging to the same body. More...
 
struct  PowerLawSfd
 Holds the information about a power-law size-frequency distributions. More...
 
class  InitialConditions
 Object for adding one or more bodies with given material into a Storage. More...
 
struct  InitialConditions::BodySetup
 Holds data needed to create a single body in addHeterogeneousBody function. More...
 

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...
 

Detailed Description

Generating initial conditions of SPH particles.

Author
Pavel Sevecek (sevecek at sirrah.troja.mff.cuni.cz)
Date
2016-2021

Definition in file Initial.h.

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.