ESyS-Particle  2.3.4
esys::lsm::SphereBlockGenerator Class Reference

#include <SphereBlockGenerator.h>

Inheritance diagram for esys::lsm::SphereBlockGenerator:
Collaboration diagram for esys::lsm::SphereBlockGenerator:

Public Types

typedef NTable::ParticleVector ParticleVector
 
typedef NTable::ParticleIterator ParticleIterator
 
typedef set< int > IdSet
 
- Public Types inherited from esys::lsm::ParticleGenerator
typedef CircularNeighbourTable< SimpleParticleNTable
 
typedef boost::object_pool< SimpleParticleParticlePool
 

Public Member Functions

 SphereBlockGenerator (NTable &, ParticlePool &, double, const Vec3 &, double, double, double, int, int)
 
virtual ~SphereBlockGenerator ()
 
virtual void generate ()
 
virtual void generateSeedParticles ()
 
virtual void generateFillParticles ()
 
virtual SimpleParticle generateParticle (const Vec3 &point)
 
virtual void insertParticle (const SimpleParticle &)
 
virtual double getRadius () const
 
int getNextId ()
 
size_t getNumParticles () const
 
const BoundingBox getBBox () const
 
virtual double getGridRadius () const
 
virtual bool particleFits (const SimpleParticle &particle) const
 
ParticleIterator getParticleIterator ()
 
vector< SimpleParticle * > getClosestNeighbors (const SimpleParticle &, int)
 
bool findAFitWithSphere (SimpleParticle &, const vector< SimpleParticle * > &)
 
bool findAFit (SimpleParticle &, const vector< SimpleParticle * > &)
 
bool checkAFit (const SimpleParticle &)
 
Vec3 getAPoint ()
 
- Public Member Functions inherited from esys::lsm::ParticleGenerator
 ParticleGenerator (NTable &nTable, ParticlePool &particlePool)
 
virtual ~ParticleGenerator ()
 

Private Attributes

ParticleVector m_particleVector
 
double m_tol
 
IdSet m_idSet
 
Vec3 m_center
 
double m_radius
 
double m_min_rad
 
double m_max_rad
 
int m_max_tries
 
int m_tag
 

Additional Inherited Members

- Protected Member Functions inherited from esys::lsm::ParticleGenerator
 ParticleGenerator ()
 
NTablegetNTable ()
 
const NTablegetNTable () const
 
ParticlePoolgetParticlePool ()
 
const ParticlePoolgetParticlePool () const
 

Member Typedef Documentation

◆ IdSet

◆ ParticleIterator

◆ ParticleVector

Constructor & Destructor Documentation

◆ SphereBlockGenerator()

esys::lsm::SphereBlockGenerator::SphereBlockGenerator ( NTable ntable,
ParticlePool pool,
double  tol,
const Vec3 pos,
double  rad,
double  rmin,
double  rmax,
int  ntries,
int  tag 
)

constructor

Parameters
ntablethe neigbour table to be used
poolthe particle pool
tolthe fitting tolerance
poscenter position
radradius
rminminimum particle radius
rmaxmaximum particle radius
ntriesmax. nr. of tries

References m_center, m_max_rad, m_max_tries, m_min_rad, m_radius, m_tag, and m_tol.

◆ ~SphereBlockGenerator()

esys::lsm::SphereBlockGenerator::~SphereBlockGenerator ( )
virtual

destructor

Member Function Documentation

◆ checkAFit()

bool esys::lsm::SphereBlockGenerator::checkAFit ( const SimpleParticle Po)

check if Po is within the Space and is not crossing any boundary or overlapping with other particles.

Parameters
Pothe particle

References esys::lsm::ParticleGenerator::getNTable(), SimpleParticle::getPos(), SimpleParticle::getRad(), esys::lsm::NeighbourTable< TmplParticle >::getUniqueNeighbourVector(), esys::lsm::bpu::iter(), m_max_rad, m_tol, and particleFits().

Referenced by generateFillParticles().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findAFit()

bool esys::lsm::SphereBlockGenerator::findAFit ( SimpleParticle Po,
const vector< SimpleParticle * > &  NL 
)

Find a fit for a sphere using the list of neigbors

Parameters
Pothe particle to fit
NLthe list of neighbors

References Sphere3D::FillIn(), esys::lsm::SimpleParticleData::getID(), and m_tag.

Referenced by generateFillParticles().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findAFitWithSphere()

bool esys::lsm::SphereBlockGenerator::findAFitWithSphere ( SimpleParticle Po,
const vector< SimpleParticle * > &  NL 
)

Find a fit for a sphere using the list of neigbors and the outer sphere

Parameters
Pothe particle to fit
NLthe list of neighbors

References Sphere3D::FillIn(), esys::lsm::SimpleParticleData::getID(), m_center, m_radius, and m_tag.

Referenced by generateFillParticles().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generate()

void esys::lsm::SphereBlockGenerator::generate ( )
virtual

generate particles

Implements esys::lsm::ParticleGenerator.

References generateFillParticles(), and generateSeedParticles().

Here is the call graph for this function:

◆ generateFillParticles()

void esys::lsm::SphereBlockGenerator::generateFillParticles ( )
virtual

◆ generateParticle()

SimpleParticle esys::lsm::SphereBlockGenerator::generateParticle ( const Vec3 point)
virtual

generate a particle at a given position

Parameters
point

References getNextId(), getRadius(), and m_tag.

Referenced by generateFillParticles(), and generateSeedParticles().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateSeedParticles()

void esys::lsm::SphereBlockGenerator::generateSeedParticles ( )
virtual

generate seed particles

References generateParticle(), getBBox(), getGridRadius(), esys::lsm::GridIterator::hasNext(), insertParticle(), esys::lsm::GridIterator::next(), and particleFits().

Referenced by generate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAPoint()

Vec3 esys::lsm::SphereBlockGenerator::getAPoint ( )

get a random point inside the sphere

References m_center, m_radius, and Vec3::norm().

Referenced by generateFillParticles().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBBox()

const BoundingBox esys::lsm::SphereBlockGenerator::getBBox ( ) const

calculate & return bounding box for bounding sphere

References m_center, and m_radius.

Referenced by generateSeedParticles().

Here is the caller graph for this function:

◆ getClosestNeighbors()

vector< SimpleParticle * > esys::lsm::SphereBlockGenerator::getClosestNeighbors ( const SimpleParticle P,
int  np 
)

get closes Neigbours

Parameters
Pthe particle
npthe number of neighbours

References esys::lsm::ParticleGenerator::getNTable(), SimpleParticle::getPos(), esys::lsm::NeighbourTable< TmplParticle >::getUniqueNeighbourVector(), m_max_rad, and m_tol.

Referenced by generateFillParticles().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getGridRadius()

double esys::lsm::SphereBlockGenerator::getGridRadius ( ) const
virtual

return max. radius to be used as spacing for grid iterator

References m_max_rad.

Referenced by generateSeedParticles().

Here is the caller graph for this function:

◆ getNextId()

int esys::lsm::SphereBlockGenerator::getNextId ( )

get next available particle ID

References esys::lsm::ParticleGenerator::getNTable(), and esys::lsm::CircularNeighbourTable< TmplParticle >::getNumParticles().

Referenced by generateParticle().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNumParticles()

size_t esys::lsm::SphereBlockGenerator::getNumParticles ( ) const
inline

References m_idSet.

◆ getParticleIterator()

ParticleIterator esys::lsm::SphereBlockGenerator::getParticleIterator ( )
inline

References m_particleVector.

◆ getRadius()

double esys::lsm::SphereBlockGenerator::getRadius ( ) const
virtual

??

References m_max_rad, and m_min_rad.

Referenced by generateParticle().

Here is the caller graph for this function:

◆ insertParticle()

void esys::lsm::SphereBlockGenerator::insertParticle ( const SimpleParticle particle)
virtual

◆ particleFits()

bool esys::lsm::SphereBlockGenerator::particleFits ( const SimpleParticle particle) const
virtual

check particle fit

References SimpleParticle::getPos(), SimpleParticle::getRad(), m_center, m_max_rad, m_min_rad, and m_radius.

Referenced by checkAFit(), and generateSeedParticles().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_center

Vec3 esys::lsm::SphereBlockGenerator::m_center
private

◆ m_idSet

IdSet esys::lsm::SphereBlockGenerator::m_idSet
private

Referenced by getNumParticles(), and insertParticle().

◆ m_max_rad

double esys::lsm::SphereBlockGenerator::m_max_rad
private

◆ m_max_tries

int esys::lsm::SphereBlockGenerator::m_max_tries
private

◆ m_min_rad

double esys::lsm::SphereBlockGenerator::m_min_rad
private

◆ m_particleVector

ParticleVector esys::lsm::SphereBlockGenerator::m_particleVector
private

◆ m_radius

double esys::lsm::SphereBlockGenerator::m_radius
private

◆ m_tag

int esys::lsm::SphereBlockGenerator::m_tag
private

◆ m_tol

double esys::lsm::SphereBlockGenerator::m_tol
private

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