AggregPacking
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
aggregpacking::HeteroGeometry Class Referenceabstract

Abstract class representing heterogeneous geometry. More...

#include <heterogeometry.hpp>

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

Public Member Functions

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...
 
virtual double computeVolume ()=0
 Compute volume of receiver.
 
virtual void initOctree ()=0
 Initialize new octree (and delete the old one)
 
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...
 
virtual const string & getClassName ()=0
 Returns string representation of Sphere class name.
 
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.
 

Protected Member Functions

 HeteroGeometry ()
 Default constructor.
 
 HeteroGeometry (const string &fileName)
 Default constructor from file name. More...
 
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...
 
virtual bool placeOneParticle (Aggregate &aggreg)=0
 Places one particle such that it does not overlap with already placed particles and is entirely contained by the cube. More...
 
virtual bool containsParticle (const Aggregate &aggreg)=0
 Tests if given particle is entirely contained by receiver. 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".
 

Friends

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

Detailed Description

Abstract class representing heterogeneous geometry.

Contains a list of aggregates and functions for generation

Constructor & Destructor Documentation

aggregpacking::HeteroGeometry::HeteroGeometry ( const string &  fileName)
inlineprotected

Default constructor from file name.

Parameters
fileNamefile name

Member Function Documentation

void aggregpacking::HeteroGeometry::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.

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 
)
inline

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 ( )

Checks that no particles overlap.

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

Tests if given particle is entirely contained by receiver.

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

Implemented in aggregpacking::CubeHeteroGeometry.

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

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)
inline

Loads receiver from given file.

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

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 ( )
inlineprotected

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

Returns
true if successful, false otherwise
virtual bool aggregpacking::HeteroGeometry::placeOneParticle ( Aggregate aggreg)
protectedpure virtual

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

Implemented in aggregpacking::CubeHeteroGeometry.

void aggregpacking::HeteroGeometry::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.

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 
)
inline

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
inline

Saves receiver to given file.

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

Creates a random particle.

Parameters
aggregSizeRandomizersieve curve random size generator
concreteMixtureused concrete mixture

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