15#ifndef MOMENTUM_GRANULARBODYSYSTEM_H
16#define MOMENTUM_GRANULARBODYSYSTEM_H
18#include "momentum_namespace.h"
19#include "momentum_export.h"
24#include "AffineMatrix4x4.h"
25#include "GranularBody.h"
26#include "DataBufferAccessor.h"
35 class GranularBodySystem;
51 class ParticleDistribution;
75 HEXAGONAL_CLOSE_PACK = 1
132 bool onlyCheckForMidPoint )
const;
144 bool onlyCheckForMidPoint )
const;
182#ifndef AGX_MOMENTUM_ANALYSIS_API
184 void applyAirResistance(
double dragCoefficient,
double viscousCoeffcient );
319 agx::Physics::GranularBodySystem* m_granularBodySystem;
Matrix class for rigid transformations (translation, rotation).
Definition: AffineMatrix4x4.h:51
A class describing a Geometry.
Definition: Geometry.h:44
The GranularBodySystem class acts as a container for all the active GranularBodies in the simulation.
Definition: GranularBodySystem.h:57
LatticeType
Definition: GranularBodySystem.h:73
GranularBodyVector getGranularBodies(const std::vector< unsigned int > &ids) const
Get GranularBodies given a vector of ids.
std::shared_ptr< DataBufferAccessor > getDataBufferAccessor()
Return the low level data buffer accessor for the GranularBodySystem that contains structured array d...
int removeGranularBodiesInsideGeometry(const Geometry *geometry, bool onlyCheckForMidPoint)
Remove Granular Bodies that are partially or wholly inside the specified Geometry.
GranularBodyVector filterBodiesInGeometry(const Geometry *geometry, const GranularBodyVector &granularBodies, bool onlyCheckForMidPoint) const
Return a subset of specified granular bodies that intersect with a specified geometry.
bool writeFile(const std::string &filename, const GranularBodyVector &granularBodies) const
Write granular bodies that intersect with a specified geometry to a file with format according to fil...
double getTotalEnergy() const
GranularBodyVector getGranularBodiesInsideGeometry(const Geometry *geometry, bool onlyCheckForMidPoint) const
Return all granular bodies that intersect with a specified geometry.
GranularBodyVector spawnGranularBodyLatticeInBound(const Vec3 &min, const Vec3 &max, const ParticleDistribution *distribution, const Vec3 &spacing, double jitterFactor, const Material *material, LatticeType latticeType=SQUARE_PACK)
Creates a lattice of particles in a axis aligned bound created by two position.
GranularBodyVector getGranularBodies() const
Get the active GranularBodies in the simulation.
double getRotationalEnergy() const
double getTranslationalEnergy() const
bool writeFileFromGeometry(const std::string &filename, const GranularBodyVector &granularBodies, const Geometry *geometry) const
Write granular bodies that intersect with a specified geometry to a file with format according to fil...
bool loadFileGetBodies(const std::string &filename, const Material *initialMaterial, GranularBodyVector &granularBodies, const AffineMatrix4x4 &offset=AffineMatrix4x4())
Load GranularBodies from the specified .agx file into the current simulation and insert the loaded gr...
GranularBodyVector spawnGranularBodyLatticeInGeometry(const Geometry *geometry, double radius, const Vec3 &spacing, double jitterFactor, const Material *material, LatticeType latticeType=SQUARE_PACK)
Creates a lattice of particles in a geometry given in the SpaceClaim scene.
GranularBodyVector spawnGranularBodyLatticeInGeometry(const Geometry *geometry, const ParticleDistribution *distribution, const Vec3 &spacing, double jitterFactor, const Material *material, LatticeType latticeType=SQUARE_PACK)
Creates a lattice of particles in a geometry given in the SpaceClaim scene.
bool loadFile(const std::string &filename, const Material *initialMaterial, const AffineMatrix4x4 &offset=AffineMatrix4x4())
Load GranularBodies from the specified .agx file into the current simulation.
GranularBodyVector spawnGranularBodyLatticeInBound(const Vec3 &min, const Vec3 &max, double radius, const Vec3 &spacing, double jitterFactor, const Material *material, LatticeType latticeType=SQUARE_PACK)
Creates a lattice of particles in a axis aligned bound created by two position.
std::shared_ptr< GranularBody > createGranularBody(double radius, const Material *material)
Create a new GranularBody in the simulation.
std::shared_ptr< GranularBody > getGranularBody(unsigned int id) const
Get a GranularBody in the simulation given an id.
A class describing a Material which is attached to a Geometry.
Definition: Material.h:41
A wrapper class for a ParticleDistribution of ParticleModels.
Definition: ParticleDistribution.h:74
A 3 dimensional vector which can be used to define a point or a vector and contains basic arithmetic.
Definition: Vec3.h:40
Namespace for Momentum Scripting API.
Definition: AffineMatrix4x4.h:29
std::vector< std::shared_ptr< GranularBody > > GranularBodyVector
A vector with objects of the type GranularBody .
Definition: GranularBody.h:362
std::shared_ptr< GranularBody > GranularBodyPtr
Definition: GranularBody.h:362
Definition: SceneGraph.h:29