On Feb 21, 2015, at 4:40 PM, Dhisa Minerva <[email protected]> wrote:

> I am having a problem here in defining the variable name if using vector 
> form. For example I have 3 components, v1, v2, and v3. I define them in the 
> vector form as v. I want to put the name v1_sol, v2_sol, and v3_sol for 
> variable v1, v2, and v3, respectively. I tried to use list, it doesn`t work. 
> Hope someone can help me.

There's no direct way to do this. You can name v, but then you just get 
"v[index]", "v[index]", and "v[index]" for the three components, which is not 
very informative. I think I had an experimental branch where you would get 
"v[0]", "v[1]", and "v[2]", but I haven't touched it in ages and it involved a 
lot of other incomplete modifications to the code.


> Other thing is how to just show the plot one or some components in the 
> variable instead of showing all of them? I don`t understand how to work with 
> viewer and plot in fipy.

>>> vw = fp.Viewer(vars=(v[0], v[1]))
>>> vw.plot()

will show you, e.g., individual plots of the x and y components, but not z.

What you can do, to get meaningful names, too, is

>>> v0 = v[0]
>>> v0.name = "v1_sol"
>>> v1 = v[1]
>>> v1.name = "v2_sol"
>>> vw = fp.Viewer(vars=(v0, v1))
>>> vw.plot()


_______________________________________________
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