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

Class AbsGrainGen

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

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. Spherical particle radii are generated independent of grain size.


See Also: getGrain

Instance Methods [hide private]
 
__init__(self, minGRadius, maxGRadius, do2d=False, minPRadius=None, maxPRadius=None, 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, minPRadius=None, maxPRadius=None, 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).
  • minPRadius (float) - The minimum radius of randomly generated particles.
  • maxPRadius (float) - The maximum radius of randomly generated particles.
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.minPRadius,self.maxPRadius)

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