ESyS-Particle  2.3.4
CRandomBlock2D Class Reference

Class for the generation of a 2D random lattice in a rectangular area. More...

#include <RandomBlock.h>

Inheritance diagram for CRandomBlock2D:
Collaboration diagram for CRandomBlock2D:

Public Member Functions

 CRandomBlock2D (double, double, double, double, double, double, double, bool circ_x=false)
 
virtual ~CRandomBlock2D ()
 
virtual void generate (int, unsigned int)
 
virtual void insertParticle (const SimpleParticle)
 
virtual void tagParticleClosestTo (const Vec3 &, int)
 
virtual void tagEdgeY (int, int, double)
 
virtual void tagEdgeZ (int, int, double)
 
virtual void writeToGeoFile (const string &)
 
virtual double calcPorosity ()
 
virtual vector< pair< double, double > > getSizeDistribution (int)
 
- Public Member Functions inherited from ARandomAssembly
virtual ~ARandomAssembly ()
 
virtual void tagSplit (int, int, double)
 
virtual void writeToVtkFile (const string &)
 

Protected Member Functions

virtual Vec3 getAPoint ()
 
virtual int getNParts () const
 
- Protected Member Functions inherited from ARandomAssembly2D
bool isInSpace (const Vec3 &)
 
bool findAFit (SimpleParticle &, const vector< SimpleParticle > &, const Line &)
 
bool findAFit (SimpleParticle &, const vector< SimpleParticle > &)
 
virtual bool checkAFit (const SimpleParticle &)
 
virtual LinegetClosestPlane (const SimpleParticle &)
 
void fillSpace (int)
 
- Protected Member Functions inherited from ARandomAssembly
double m_random (double, double)
 
vector< SimpleParticlegetNeighborList (const SimpleParticle &)
 
vector< SimpleParticleget3ClosestNeighbors (const SimpleParticle &, const vector< SimpleParticle > &)
 
vector< SimpleParticlegetClosestNeighbors (const SimpleParticle &, int)
 
SimpleParticle getClosestParticle (const SimpleParticle &, const vector< SimpleParticle > &)
 

Protected Attributes

double m_maxConnDist
 
- Protected Attributes inherited from ARandomAssembly2D
vector< LineBorders
 
double m_rmin
 
double m_rmax
 min/max particle radius More...
 
double m_xmin
 
double m_xmax
 
double m_ymin
 
double m_ymax
 x,y borders of the lattice More...
 
bool m_circ_x
 
- Protected Attributes inherited from ARandomAssembly
ASimpleNTablem_snt
 
set< BasicInteraction, BILessm_iset
 
vector< SimpleParticlem_bpart
 

Additional Inherited Members

- Static Protected Attributes inherited from ARandomAssembly
static double m_small_value =1e-7
 

Detailed Description

Class for the generation of a 2D random lattice in a rectangular area.

Author
Steffen Abe $Revision$ $Date$

Constructor & Destructor Documentation

◆ CRandomBlock2D()

CRandomBlock2D::CRandomBlock2D ( double  xmin,
double  xmax,
double  ymin,
double  ymax,
double  rmin,
double  rmax,
double  mcd,
bool  circ_x = false 
)

Constructor of CRandomBlock

Parameters
xminminimum in x-direction
xmaxmaximum in x-direction
yminminimum in y-direction
ymaxmaximum in y-direction
rminminimum particle radius
rmaxmaximum particle radius
mcdmaximum relative distance for bond generation

References ARandomAssembly2D::Borders, ARandomAssembly2D::m_circ_x, m_maxConnDist, ARandomAssembly2D::m_rmax, ARandomAssembly2D::m_rmin, ARandomAssembly::m_snt, ARandomAssembly2D::m_xmax, ARandomAssembly2D::m_xmin, ARandomAssembly2D::m_ymax, and ARandomAssembly2D::m_ymin.

◆ ~CRandomBlock2D()

CRandomBlock2D::~CRandomBlock2D ( )
virtual

References ARandomAssembly::m_snt, and NULL.

Member Function Documentation

◆ calcPorosity()

double CRandomBlock2D::calcPorosity ( )
virtual

calculate the porosity of the material

Implements ARandomAssembly.

References esys::lsm::bpu::iter(), ARandomAssembly::m_bpart, ARandomAssembly2D::m_xmax, ARandomAssembly2D::m_xmin, ARandomAssembly2D::m_ymax, and ARandomAssembly2D::m_ymin.

Here is the call graph for this function:

◆ generate()

void CRandomBlock2D::generate ( int  tries,
unsigned int  seed 
)
virtual

Fill the space in the block

Parameters
triesnumber of times the insertion of a particle is tried
seedseed for the random number generator

Implements ARandomAssembly2D.

Reimplemented in CSplitBlock2D, CLayeredBlock2D, and FaultedBlock2D.

References ARandomAssembly2D::checkAFit(), ARandomAssembly2D::fillSpace(), ASimpleNTable::getInteractions(), getNParts(), insertParticle(), ARandomAssembly::m_iset, m_maxConnDist, ARandomAssembly::m_random(), ARandomAssembly2D::m_rmax, ARandomAssembly2D::m_rmin, ARandomAssembly::m_snt, ARandomAssembly2D::m_xmax, ARandomAssembly2D::m_xmin, ARandomAssembly2D::m_ymax, and ARandomAssembly2D::m_ymin.

Referenced by CLayeredBlock2D::generate().

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

◆ getAPoint()

Vec3 CRandomBlock2D::getAPoint ( )
protectedvirtual

Generate a random point within the space of the block

Implements ARandomAssembly2D.

Reimplemented in FaultedBlock2D.

References ARandomAssembly::m_random(), ARandomAssembly2D::m_rmin, ARandomAssembly2D::m_xmax, ARandomAssembly2D::m_xmin, ARandomAssembly2D::m_ymax, and ARandomAssembly2D::m_ymin.

Here is the call graph for this function:

◆ getNParts()

virtual int CRandomBlock2D::getNParts ( ) const
inlineprotectedvirtual

Implements ARandomAssembly2D.

References ARandomAssembly::m_bpart.

Referenced by FaultedBlock2D::generate(), generate(), and CSplitBlock2D::generate().

Here is the caller graph for this function:

◆ getSizeDistribution()

vector< pair< double, double > > CRandomBlock2D::getSizeDistribution ( int  nbins)
virtual

return a histogram of the particle size distribution

Parameters
nbinsnumber of bins

Implements ARandomAssembly.

References esys::lsm::bpu::iter(), ARandomAssembly::m_bpart, ARandomAssembly2D::m_rmax, ARandomAssembly2D::m_rmin, and ARandomAssembly::m_small_value.

Here is the call graph for this function:

◆ insertParticle()

void CRandomBlock2D::insertParticle ( const SimpleParticle  P)
virtual

Insert a particle into the internal structures

Parameters
Pthe particle

Implements ARandomAssembly2D.

References ASimpleNTable::insertParticle(), ARandomAssembly::m_bpart, and ARandomAssembly::m_snt.

Referenced by FaultedBlock2D::generate(), generate(), and CSplitBlock2D::generate().

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

◆ tagEdgeY()

void CRandomBlock2D::tagEdgeY ( int  tag1,
int  tag2,
double  d 
)
virtual

Tag particles along x-edges

Parameters
tag1tag for particles along x_min
tag2tag for particles along x_max
dmaximum distance from the edge at which a particle gets tagged

Implements ARandomAssembly2D.

References esys::lsm::bpu::iter(), ARandomAssembly::m_bpart, ARandomAssembly2D::m_ymax, and ARandomAssembly2D::m_ymin.

Here is the call graph for this function:

◆ tagEdgeZ()

virtual void CRandomBlock2D::tagEdgeZ ( int  ,
int  ,
double   
)
inlinevirtual

Implements ARandomAssembly.

◆ tagParticleClosestTo()

void CRandomBlock2D::tagParticleClosestTo ( const Vec3 pos,
int  tag 
)
virtual

Tag particle closest to a given position

Parameters
posthe position
tagthe tag

Implements ARandomAssembly2D.

References ASimpleNTable::getClosestParticleID(), esys::lsm::bpu::iter(), ARandomAssembly::m_bpart, and ARandomAssembly::m_snt.

Here is the call graph for this function:

◆ writeToGeoFile()

void CRandomBlock2D::writeToGeoFile ( const string &  filename)
virtual

Write the particles contained in the random block into a LSM geometry file v 1.1

Parameters
filenamethe name of the file

Implements ARandomAssembly.

References esys::lsm::bpu::iter(), ARandomAssembly::m_bpart, ARandomAssembly2D::m_circ_x, ARandomAssembly::m_iset, ARandomAssembly2D::m_xmax, ARandomAssembly2D::m_xmin, ARandomAssembly2D::m_ymax, and ARandomAssembly2D::m_ymin.

Here is the call graph for this function:

Member Data Documentation

◆ m_maxConnDist

double CRandomBlock2D::m_maxConnDist
protected

Referenced by CRandomBlock2D(), and generate().


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