31 #ifndef HETEROGEOMETRY_HPP
32 #define HETEROGEOMETRY_HPP
44 #ifdef AGGREGPACKING_SERIALIZATION
53 namespace aggregpacking {
65 #ifdef AGGREGPACKING_SERIALIZATION
105 bool place(
double minRelAggregDist);
130 #ifdef AGGREGPACKING_SERIALIZATION
205 #ifdef AGGREGPACKING_SERIALIZATION
253 #ifdef AGGREGPACKING_SERIALIZATION
281 #ifdef AGGREGPACKING_SERIALIZATION
302 #ifdef AGGREGPACKING_BOOST_PYTHON
303 void py_heterogeometry();
Representation of spherical aggregate.
Definition: aggregate.hpp:251
Octree< Aggregate * > * getOctree()
Getter for octreee (by non-const pointer)
Definition: heterogeometry.hpp:186
virtual double computeVolume()=0
Compute volume of receiver.
HeteroGeometry()
Default constructor.
Definition: heterogeometry.hpp:67
Abstract class representing heterogeneous geometry.
Definition: heterogeometry.hpp:63
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 ...
Definition: heterogeometry.cpp:65
CubeHeteroGeometry(double c, const string &m)
Constructor from size and file name.
Definition: heterogeometry.cpp:257
void setPlaceNumTries(int v)
Setter for placeNumTries.
Definition: heterogeometry.hpp:198
virtual void initOctree()=0
Initialize new octree (and delete the old one)
friend ostream & operator<<(ostream &f, const CubeHeteroGeometry &o)
CubeHeteroGeometry to ostream shift operator.
Definition: heterogeometry.cpp:301
virtual double computeVolume()
Compute volume of cube.
Definition: heterogeometry.hpp:274
File containing representation of different random number generators.
Representation of concrete mixture.
Definition: concmixture.hpp:42
File containing representation of different aggregate types.
bool load()
Saves receiver from this->fileName.
Definition: heterogeometry.hpp:229
double getCubeSize()
Getter for cube size.
Definition: heterogeometry.hpp:277
const vector< Aggregate * > & getAggregates() const
Getter for aggregates (return by const reference)
Definition: heterogeometry.hpp:171
void build(const AggregSizeRandomizer &aggregSizeRandomizer, const ConcreteMixture &concreteMixture)
Generate the geometry by take-and-place process. Aggregates do not overlap. Do nothing if already bui...
Definition: heterogeometry.hpp:149
string getAggregType()
Getter for aggregate type (by value)
Definition: heterogeometry.hpp:177
File containing several auxiliary functions.
Abstract class representing random size generator for given sieve curve.
Definition: randomizer.hpp:99
virtual bool containsParticle(const Aggregate &aggreg)
Tests if given particle is entirely contained by receiver.
Definition: heterogeometry.cpp:293
bool place()
Places all particles randomly such that they do not overlap and all are entirely contained by the cub...
Definition: heterogeometry.hpp:110
Abstract class representing one aggregate particle.
Definition: aggregate.hpp:63
double cubeSize
Cube size of receiver.
Definition: heterogeometry.hpp:248
Octree< Aggregate * > * octree
Octree (for faster spatial checks)
Definition: heterogeometry.hpp:84
friend istream & operator>>(istream &f, CubeHeteroGeometry &o)
CubeHeteroGeometry from istream shift operator.
Definition: heterogeometry.cpp:308
vector< Aggregate * > & getAggregates()
Getter for aggregates (return by non-const reference)
Definition: heterogeometry.hpp:174
Class representing full octree.
Definition: octree.hpp:128
const string & getClassName()
Returns string representation of Sphere class name.
Definition: heterogeometry.hpp:285
void saveObject(const T &t, const string &fName, const string &memoizeDb)
Auxiliary template function for saving objects to files.
Definition: utils.hpp:142
bool load(const string &fName)
Loads receiver from given file.
Definition: heterogeometry.hpp:226
HeteroGeometry(const string &fileName)
Default constructor from file name.
Definition: heterogeometry.hpp:72
void setAggregType(const string &s)
Setter for aggreg type.
Definition: heterogeometry.cpp:43
friend ostream & operator<<(ostream &f, const HeteroGeometry &o)
HeteroGeometry to ostream shift operator.
Definition: heterogeometry.cpp:209
friend istream & operator>>(istream &f, HeteroGeometry &o)
HeteroGeometry from istream shift operator.
Definition: heterogeometry.cpp:219
virtual bool containsParticle(const Aggregate &aggreg)=0
Tests if given particle is entirely contained by receiver.
File containing representation of concrete mixture.
CubeHeteroGeometry(double c)
Constructor from size.
Definition: heterogeometry.hpp:263
void save() const
Saves receiver to this->fileName.
Definition: heterogeometry.hpp:221
bool check()
Checks that no particles overlap.
Definition: heterogeometry.cpp:191
string fileName
File name for saving files.
Definition: heterogeometry.hpp:81
const Octree< Aggregate * > * getOctree() const
Getter for octreee (by const pointer)
Definition: heterogeometry.hpp:189
int getPlaceNumTries()
Getter for placeNumTries.
Definition: heterogeometry.hpp:195
virtual bool placeOneParticle(Aggregate &aggreg)
Places one particle such that it does not overlap with already placed particles and is entirely conta...
Definition: heterogeometry.cpp:278
string getFileName()
Getter for file name.
Definition: heterogeometry.hpp:192
void rebuild(const AggregSizeRandomizer &aggregSizeRandomizer, const ConcreteMixture &concreteMixture)
Delete already build and re-generate the geometry by take-and-place process. Aggregates do not overla...
Definition: heterogeometry.hpp:162
void take(const AggregSizeRandomizer &aggregSizeRandomizer, const ConcreteMixture &concreteMixture)
Creates a random particle.
Definition: heterogeometry.cpp:94
const string & getAggregType() const
Getter for aggregate type (by const reference)
Definition: heterogeometry.hpp:180
File containing octree representation.
void loadAggregates(istream &is)
Loads receiver from given istream.
Definition: heterogeometry.cpp:236
virtual void initOctree()
Initialize new octree (and delete the old one)
Definition: heterogeometry.cpp:273
bool loadObject(T &t, const string &fName, const string &memoizeDb)
Auxiliary template function for lading objects from files.
Definition: utils.hpp:151
void save(const string &fName) const
Saves receiver to given file.
Definition: heterogeometry.hpp:218
virtual bool placeOneParticle(Aggregate &aggreg)=0
Places one particle such that it does not overlap with already placed particles and is entirely conta...
void saveAggregates(ostream &os) const
Saves receiver to given ostream.
Definition: heterogeometry.cpp:229
int placeNumTries
How many tries of one particle placement is done until error is thrown (default 10000) ...
Definition: heterogeometry.hpp:87
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 ...
Definition: heterogeometry.cpp:51
Abstract class representing heterogeneous geometry.
Definition: heterogeometry.hpp:245
void clearAggregates()
Delete all aggregates.
Definition: heterogeometry.cpp:73
~CubeHeteroGeometry()
Destructor.
Definition: heterogeometry.cpp:267
string aggregType
Aggregate type to generate. Currently implemented are "Sphere" and "Ellipsoid".
Definition: heterogeometry.hpp:128
Aggregate * CreateParticle(double size)
Creates and return new Aggregate particle according to aggregType and given size. ...
Definition: heterogeometry.cpp:80
virtual const string & getClassName()=0
Returns string representation of Sphere class name.
vector< Aggregate * > aggregates
Aggregates container.
Definition: heterogeometry.hpp:72
static const string className
String representation of CubeHeteroGeometry class name.
Definition: heterogeometry.hpp:283