14 #ifndef ESYS_LSMGOUGEBLOCK3D_H
15 #define ESYS_LSMGOUGEBLOCK3D_H
17 #include "Foundation/BoundingBox.h"
18 #include "Geometry/CircularNeighbourTable.h"
19 #include "Geometry/BlockGenerator.h"
20 #include "Geometry/Plane.h"
21 #include "Geometry/BasicInteraction.h"
23 #include <boost/shared_ptr.hpp>
32 typedef std::vector<Plane> PlaneVector;
54 typedef std::vector<bool> BoolVector;
55 typedef std::vector<BoundingBox> BoundingBoxVector;
62 const BoolVector &periodicDimensions,
63 Orientation orientation,
70 void initialiseFitPlaneVector();
74 const PlaneVector &getFitPlaneVector()
const;
76 double getMinRadius()
const;
78 double getMaxRadius()
const;
80 const BoolVector &getPeriodicDimensions()
const;
83 BoolVector m_periodicDimensions;
84 Orientation m_orientation;
87 PlaneVector m_fitPlaneVector;
90 typedef std::vector<PackingInfo> PackingInfoVector;
101 Orientation orientation,
104 const BoolVector &peridicDimensions=BoolVector(3,
false),
105 int maxInsertionFailures=100,
106 double tolerance = DBL_EPSILON*128,
107 double connectionTolerance = DBL_EPSILON*128*10
112 double getTolerance()
const;
114 double getConnectionTolerance()
const;
118 int getMaxInsertionFailures()
const;
120 double getRegularBlockRadius()
const;
122 double getFaultMinRadius()
const;
124 double getFaultMaxRadius()
const;
126 double getGougeMinRadius()
const;
128 double getGougeMaxRadius()
const;
130 const BoolVector &getPeriodicDimensions()
const;
132 BoundingBoxVector getRegularBBoxVector()
const;
134 PackingInfoVector getGougePackingInfoVector()
const;
136 PackingInfoVector getFaultPackingInfoVector()
const;
140 Orientation getOrientation()
const;
142 int getOrientationIndex()
const;
144 double getOrientationSize()
const;
146 double getMaxRadius()
const;
148 double getMinRadius()
const;
155 Orientation m_orientation;
158 BoolVector m_periodicDimensions;
159 int m_maxInsertionFailures;
161 double m_connectionTolerance;
176 virtual void generate();
178 int getNumParticles()
const;
181 typedef boost::shared_ptr<NTable> NTablePtr;
182 typedef boost::shared_ptr<BlockGenerator> GeneratorPtr;
183 typedef std::vector<GeneratorPtr> GeneratorPtrVector;
184 typedef NTable::ParticlePool ParticlePool;
185 typedef NTable::ParticlePoolPtr ParticlePoolPtr;
187 const GeneratorPtrVector &getGougeGeneratorVector()
const;
189 const GeneratorPtrVector &getFaultGeneratorVector()
const;
193 bool areInDifferentFaultBlocks(
198 virtual void write(std::ostream &oStream)
const;
200 void writeToFile(
const std::string &fileName)
const;
202 void tagGougeParticles(
int tag);
204 void tagFaultParticles(
int tag);
206 void tagDrivingPlateParticles(
209 double distanceFromBBoxEdge
212 typedef std::set<BasicInteraction,BILess> InteractionSet;
214 virtual void createInteractionSet();
216 const InteractionSet &getInteractionSet()
const;
218 template <
typename TmplVisitor>
219 void visitParticles(TmplVisitor &visitor)
222 GeneratorPtrVector::iterator it = m_genPtrVector.begin();
223 it != m_genPtrVector.end();
228 while (particleIt.hasNext()) {
229 particleIt.next()->visit(visitor);
234 template <
typename TmplVisitor>
235 void visitParticles(
const TmplVisitor &visitor)
const
238 GeneratorPtrVector::const_iterator it = m_genPtrVector.begin();
239 it != m_genPtrVector.end();
244 while (particleIt.hasNext()) {
245 particleIt.next()->visit(visitor);
250 template <
typename TmplVisitor>
251 void visitInteractions(TmplVisitor &visitor)
const
253 const InteractionSet &interactionSet = getInteractionSet();
255 InteractionSet::const_iterator it = interactionSet.begin();
256 it != interactionSet.end();
270 NTablePtr m_nTablePtr;
272 InteractionSet m_interactionSet;
273 GeneratorPtrVector m_gougeGenPtrVector;
274 GeneratorPtrVector m_genPtrVector;
275 ParticlePoolPtr m_particlePoolPtr;
277 void createRegularBlockGenerators();
278 void createFaultBlockGenerators();
279 virtual void createGougeBlockGenerators();
282 GeneratorPtrVector m_regularGenPtrVector;
283 GeneratorPtrVector m_faultGenPtrVector;