Package esys :: Package lsm :: Package geometry :: Module SphericalGrainGen :: Class ScaledMinMaxGrainGen
[hide private]
[frames] | no frames]

Class ScaledMinMaxGrainGen

        object --+        
                 |        
       ??.instance --+    
                     |    
GeometryPy.RndGrainGen --+
                         |
                        ScaledMinMaxGrainGen

Grain generator which can be used in conjunction with the GougeConfigPrms and GrainRandomBoxPacker classes. Generates grains which consist of a particles packed into a circle/sphere. The minimum and maximum particle radii are scaled with respect to grain size.


See Also: getGrain

Instance Methods [hide private]
 
__init__(self, minGRadius, maxGRadius, do2d=False, radiusScale=(0.1, 0.4), maxInsertFails=5000)
Initialise the generator.
Grain
getGrain(self, p)
Uses RandomSpherePacker to create a grain consisting of randomly sized particles packed into a sphere with centre p.getPosn() and radius p.getRadius().

Inherited from GeometryPy.RndGrainGen: __reduce__, getMaxGrainRadius, getMaxParticleRadius, getMinGrainRadius, getMinParticleRadius

Inherited from unreachable.instance: __new__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from GeometryPy.RndGrainGen: __instance_size__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, minGRadius, maxGRadius, do2d=False, radiusScale=(0.1, 0.4), maxInsertFails=5000)
(Constructor)

 

Initialise the generator.

Parameters:
  • minGRadius (float) - minimum grain radius
  • maxGRadius (float) - maximum grain radius
  • do2d (bool) - If True, grain particles all occur on the z=0 plane (ie particles packed into a circle).
  • radiusScale (tuple of two floats) - Randomly generated spherical particles will have radii which will lie in the range (radiusScale[0]*minGRadius,radiusScale[1]*maxGRadius).
Overrides: object.__init__

getGrain(self, p)

 

Uses RandomSpherePacker to create a grain consisting of randomly sized particles packed into a sphere with centre p.getPosn() and radius p.getRadius(). The random particle radii will lie in the range (self.minPRadiusScale*p.getRadius(),self.maxPRadiusScale*p.getRadius())

Parameters:
  • p (SimpleSphere) - p.getPosn() and p.getRadius() determine the size and position of the returned grain.
Returns: Grain
A spherical grain of randomly sized particles.
Overrides: GeometryPy.RndGrainGen.getGrain