You'll need to give us a bit more to work with. As much as possible, FiPy 
Variable's just work with numpy. Please use our fipy.tools.numerix library 
instead of importing numpy directly, as we patch a few things, but largely you 
can just pass our Variables to numpy and get Variables back. If you show us 
what expression you're trying to represent, we'll help get it to work.

- Jon

On Sep 1, 2015, at 10:09 PM, vahid ettehadi <[email protected]> wrote:

> Thanks Daniel for your reply and I would apologize if my question was 
> unclear. I'll try to do it in your way. 
> Btw, I would be appreciated if you could give me a quick snippet.
> 
> Also, I have another question. I use FiPy to model a light propagation in a 
> medium and for this purpose I need to define a source term in the 
> time-domain, for example a Gaussian pulse source. I was wondering is it 
> possible in FiPy? if yes, could you refer me to an example? because I found 
> an example with a transient source term, but I wasn't sure it's the right way.
> 
> Thank you,
> Vahid
> 
> 
> 
> On Tuesday, September 1, 2015 2:45 PM, Daniel Lewis <[email protected]> wrote:
> 
> 
> I hope I understand your comment correctly -  If you have a cell variable 
> named "field"
> you can use field.value to return a numpy array.  You can then set the values 
> using numpy 
> broadcasting or boolean indexing...
> 
> from one of my codes (where I have a list of CellVariables called "varrs", 
> e.g. varrs = [grain1, grain2, grain3]
> 
> varrs[0].value = 0.0
> varrs[0].value[x<length/4.0] = 1.0
> 
> where x is another numpy array of x values so that the masking works...
> 
> Anyone else want to weigh in on this?  If this is unclear - I can try and 
> give a quick snippet
> in a ipynb...
> 
> 
> 
> On Sep 1, 2015, at 11:09 AM, vahid ettehadi <[email protected]> wrote:
> 
> > Hi FiPy users,
> > 
> > In my problem, I need to export the CellVariable values to a numpy array to 
> > do some simple math on each of them and then import them back to the mesh 
> > as CellVaribale. I tried to find a function or a example similar to my 
> > problem but I couldn't find anything similar. I was wondering is there a 
> > function for this purpose or I need write a code on my own? Thanks in 
> > advance
> > 
> > Vahid,
> 
> > _______________________________________________
> > fipy mailing list
> > [email protected]
> > http://www.ctcms.nist.gov/fipy
> >  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
> 
> 
> _______________________________________________
> fipy mailing list
> [email protected]
> http://www.ctcms.nist.gov/fipy
>   [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy
> ]
> 
> 
> _______________________________________________
> fipy mailing list
> [email protected]
> http://www.ctcms.nist.gov/fipy
>  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]


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

Reply via email to