On Thu, Dec 3, 2009 at 12:21 PM, Ryan Paul <[email protected]> wrote:
> Hello,
>
> I am a graduate student who has just discovered FiPy, and I am working
> through the helpful examples.  However, I am uncertain how to describe an
> initial microstructure using FiPy (e.g. spherical particles randomly
> dispersed in a matrix).

What exactly is the issue? Is the problem writing down the initial
conditions in maths or translating the initial conditions into code?
Of the top of my head, you probably need something like this:

    var[:] = 0
    for i in range(numberOfParticles):
         a = random.random() * L
         b = random,random() * L
         r = random.random() * L / 20.0
         var[((x - a)**2 + (y - b)**2) < r] = 1

if the domain size is L * L and maximum radius is L / 20 for example.
Of course, this will give a flat distribution of radii, there are
other kinds of distributions either in scipy and numpy.

Hope this helps.

Cheers

-- 
Daniel Wheeler

Reply via email to