esys :: lsm :: geometry :: SphericalGrainGen :: ScaledMaxGrainGen :: Class ScaledMaxGrainGen
[hide private]
[frames] | no frames]

Class ScaledMaxGrainGen

??-92 --+
        |
       ScaledMaxGrainGen

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 maximum particle radius is scaled with respect to grain size, the minimum particle radius is independent of grain size.


See Also: getGrain

Instance Methods [hide private]
 
__init__(self, minGRadius, maxGRadius, do2d=False, minPRadius=None, radiusScale=0.1, 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().
Method Details [hide private]

__init__(self, minGRadius, maxGRadius, do2d=False, minPRadius=None, radiusScale=0.1, 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.
  • radiusScale (float) - Randomly generated spherical particles will have radii which will lie in the range (minPRadius,radiusScale*maxGRadius).

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.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.