On Tue, Sep 13, 2016 at 12:59 PM, Guyer, Jonathan E. Dr. (Fed)
<jonathan.gu...@nist.gov> wrote:
> I'm not sure; Daniel might have a better idea.
>
> One thing you can do to manage this (if the anisotropic diffusion is 
> necessary) is change 2c) to:
>
>    c) eq1 = fp.DiffusionTerm(coeff=S * [[[1., 0], [0., 0.]]]) == f(w, a)     
> # matrix co-oeff has now been simplified by using a single facevariable whose 
> values are appropriately zeroed out in the 2D grid

Krishna, the above is correct the coefficient can be both a rank 2
cell (or face) variable and have it's value vary in space. You could
do

    my_coeff = fp.CellVariable(mesh=mesh, rank=2, value=0.)

and then set the value explicitly

   my_coeff[0, 0]  = x**2 ## or however you want to set the values

and then set the coeff in the diffusion term to be "my_coeff". This is
exactly equivalent to what Jon is saying and similar to what you
suggested. It should work fine.

-- 
Daniel Wheeler
_______________________________________________
fipy mailing list
fipy@nist.gov
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to