AggregPacking
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
aggregpacking::CubeHeteroGeometry Class Reference

Abstract class representing heterogeneous geometry. More...

#include <heterogeometry.hpp>

Inheritance diagram for aggregpacking::CubeHeteroGeometry:
aggregpacking::HeteroGeometry

Public Member Functions

 CubeHeteroGeometry (double c, const string &m)
 Constructor from size and file name. More...
 
 CubeHeteroGeometry (double c)
 Constructor from size. More...
 
 ~CubeHeteroGeometry ()
 Destructor.
 
virtual void initOctree ()
 Initialize new octree (and delete the old one)
 
virtual double computeVolume ()
 Compute volume of cube.
 
double getCubeSize ()
 Getter for cube size.
 
virtual bool containsParticle (const Aggregate &aggreg)
 Tests if given particle is entirely contained by receiver. More...
 
const string & getClassName ()
 Returns string representation of Sphere class name.
 
void build (const AggregSizeRandomizer &aggregSizeRandomizer, const ConcreteMixture &concreteMixture, double minRelAggregDist)
 Generate the geometry by take-and-place process. Aggregates has at least guaranteed distance between each other. Do nothing if already built. More...
 
void build (const AggregSizeRandomizer &aggregSizeRandomizer, const ConcreteMixture &concreteMixture)
 Generate the geometry by take-and-place process. Aggregates do not overlap. Do nothing if already built. More...
 
void rebuild (const AggregSizeRandomizer &aggregSizeRandomizer, const ConcreteMixture &concreteMixture, double minRelAggregDist)
 Delete already build and re-generate the geometry by take-and-place process. Aggregates has at least guaranteed distance between each other. More...
 
void rebuild (const AggregSizeRandomizer &aggregSizeRandomizer, const ConcreteMixture &concreteMixture)
 Delete already build and re-generate the geometry by take-and-place process. Aggregates do not overlap. More...
 
const vector< Aggregate * > & getAggregates () const
 Getter for aggregates (return by const reference)
 
vector< Aggregate * > & getAggregates ()
 Getter for aggregates (return by non-const reference)
 
string getAggregType ()
 Getter for aggregate type (by value)
 
const string & getAggregType () const
 Getter for aggregate type (by const reference)
 
void setAggregType (const string &s)
 Setter for aggreg type.
 
Octree< Aggregate * > * getOctree ()
 Getter for octreee (by non-const pointer)
 
const Octree< Aggregate * > * getOctree () const
 Getter for octreee (by const pointer)
 
string getFileName ()
 Getter for file name.
 
int getPlaceNumTries ()
 Getter for placeNumTries.
 
void setPlaceNumTries (int v)
 Setter for placeNumTries.
 
bool check ()
 Checks that no particles overlap. More...
 
void save (const string &fName) const
 Saves receiver to given file. More...
 
void save () const
 Saves receiver to this->fileName.
 
bool load (const string &fName)
 Loads receiver from given file. More...
 
bool load ()
 Saves receiver from this->fileName.
 

Static Public Attributes

static const string className = "CubeHeteroGeometry"
 String representation of CubeHeteroGeometry class name.
 

Protected Member Functions

AggregateCreateParticle (double size)
 Creates and return new Aggregate particle according to aggregType and given size. More...
 
void take (const AggregSizeRandomizer &aggregSizeRandomizer, const ConcreteMixture &concreteMixture)
 Creates a random particle. More...
 
bool place (double minRelAggregDist)
 Places all particles randomly such that they have guaranteed distance between each other and all are entirely contained by the cube. More...
 
bool place ()
 Places all particles randomly such that they do not overlap and all are entirely contained by the cube. More...
 
void clearAggregates ()
 Delete all aggregates.
 
void saveAggregates (ostream &os) const
 Saves receiver to given ostream.
 
void loadAggregates (istream &is)
 Loads receiver from given istream.
 

Protected Attributes

vector< Aggregate * > aggregates
 Aggregates container.
 
string fileName
 File name for saving files.
 
Octree< Aggregate * > * octree
 Octree (for faster spatial checks)
 
int placeNumTries
 How many tries of one particle placement is done until error is thrown (default 10000)
 
string aggregType
 Aggregate type to generate. Currently implemented are "Sphere" and "Ellipsoid".
 

Private Member Functions

virtual bool placeOneParticle (Aggregate &aggreg)
 Places one particle such that it does not overlap with already placed particles and is entirely contained by the cube. More...
 

Private Attributes

double cubeSize
 Cube size of receiver.
 

Friends

ostream & operator<< (ostream &f, const CubeHeteroGeometry &o)
 CubeHeteroGeometry to ostream shift operator.
 
istream & operator>> (istream &f, CubeHeteroGeometry &o)
 CubeHeteroGeometry from istream shift operator.
 

Detailed Description

Abstract class representing heterogeneous geometry.

Contains a list of aggregates and functions for generation

Constructor & Destructor Documentation

aggregpacking::CubeHeteroGeometry::CubeHeteroGeometry ( double  c,
const string &  m 
)

Constructor from size and file name.

Parameters
ccube size
mfile name
aggregpacking::CubeHeteroGeometry::CubeHeteroGeometry ( double  c)
inline

Constructor from size.

Parameters
ccube size

Member Function Documentation

void aggregpacking::HeteroGeometry::build ( const AggregSizeRandomizer aggregSizeRandomizer,
const ConcreteMixture concreteMixture,
double  minRelAggregDist 
)
inherited

Generate the geometry by take-and-place process. Aggregates has at least guaranteed distance between each other. Do nothing if already built.

Parameters
aggregSizeRandomizersieve curve random size generator
concreteMixtureused concrete mixture
minRelAggregDistminimum relative aggregates distance (relatively to the smaller particle)
void aggregpacking::HeteroGeometry::build ( const AggregSizeRandomizer aggregSizeRandomizer,
const ConcreteMixture concreteMixture 
)
inlineinherited

Generate the geometry by take-and-place process. Aggregates do not overlap. Do nothing if already built.

Parameters
aggregSizeRandomizersieve curve random size generator
concreteMixtureused concrete mixture
bool aggregpacking::HeteroGeometry::check ( )
inherited

Checks that no particles overlap.

Returns
true if no particles overlap, false if any do
bool aggregpacking::CubeHeteroGeometry::containsParticle ( const Aggregate aggreg)
virtual

Tests if given particle is entirely contained by receiver.

Parameters
aggreggiven particle
Returns
true if receiver contains entire given particle, false otherwise

Implements aggregpacking::HeteroGeometry.

Aggregate * aggregpacking::HeteroGeometry::CreateParticle ( double  size)
protectedinherited

Creates and return new Aggregate particle according to aggregType and given size.

Parameters
sizesize of returned particle
Returns
new Aggregate object
bool aggregpacking::HeteroGeometry::load ( const string &  fName)
inlineinherited

Loads receiver from given file.

Parameters
fNamefile name
bool aggregpacking::HeteroGeometry::place ( double  minRelAggregDist)
protectedinherited

Places all particles randomly such that they have guaranteed distance between each other and all are entirely contained by the cube.

Parameters
minRelAggregDistminimal distance between particles, relative to the smaller particle from each pair. I.e., the distance is at least (1.+minRelAggregDist)*sizeOfSmallerParticle
Returns
true if successful, false otherwise
bool aggregpacking::HeteroGeometry::place ( )
inlineprotectedinherited

Places all particles randomly such that they do not overlap and all are entirely contained by the cube.

Returns
true if successful, false otherwise
bool aggregpacking::CubeHeteroGeometry::placeOneParticle ( Aggregate aggreg)
privatevirtual

Places one particle such that it does not overlap with already placed particles and is entirely contained by the cube.

Parameters
aggreggiven particle
Returns
true if succesful, false otherwise

Implements aggregpacking::HeteroGeometry.

void aggregpacking::HeteroGeometry::rebuild ( const AggregSizeRandomizer aggregSizeRandomizer,
const ConcreteMixture concreteMixture,
double  minRelAggregDist 
)
inherited

Delete already build and re-generate the geometry by take-and-place process. Aggregates has at least guaranteed distance between each other.

Parameters
aggregSizeRandomizersieve curve random size generator
concreteMixtureused concrete mixture
minRelAggregDistminimum relative aggregates distance (relatively to the smaller particle)
void aggregpacking::HeteroGeometry::rebuild ( const AggregSizeRandomizer aggregSizeRandomizer,
const ConcreteMixture concreteMixture 
)
inlineinherited

Delete already build and re-generate the geometry by take-and-place process. Aggregates do not overlap.

Parameters
aggregSizeRandomizersieve curve random size generator
concreteMixtureused concrete mixture
void aggregpacking::HeteroGeometry::save ( const string &  fName) const
inlineinherited

Saves receiver to given file.

Parameters
fNamefile name
void aggregpacking::HeteroGeometry::take ( const AggregSizeRandomizer aggregSizeRandomizer,
const ConcreteMixture concreteMixture 
)
protectedinherited

Creates a random particle.

Parameters
aggregSizeRandomizersieve curve random size generator
concreteMixtureused concrete mixture

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