Hi Jonathan,

The lines do remain dashed on successive calls. I guess the viewer keeps
pointing to the right objects even if their properties are retroactively
modified.

Here's what I mean about the diffusion term:

[image: Untitled.png]

On another note, I've posted some stuff on github which may be of interest
regarding the circle diffusion example. I had a hard time visualizing the
mesh so I went with some third-party packages (pyvista, pygmsh) and the
result looks quite nice. https://github.com/usnistgov/fipy/issues/693

I'm now experimenting with cylindrical coordinates as I would like to try
to solve the heat equation in radial terms. I tried repeating the above
procedure to visualize CylindricalGrid1D and CylindricalGrid2D  objects but
without much luck. Here's what I'm doing:

from fipy import Variable, FaceVariable, CellVariable, Grid1D,
CylindricalGrid1D, CylindricalGrid2D, ExplicitDiffusionTerm, TransientTerm,
DiffusionTerm, Viewer
from fipy.tools import numerix
import numpy as np
import pyvista

mesh = CylindricalGrid2D(dr=0.1, dz=0.25, nr=3, nz=0.1)
ugrid= pyvista.UnstructuredGrid(mesh.VTKCellDataSet._vtk_obj)
plotter = pyvista.Plotter()
plotter.set_background('white')
plotter.add_mesh(ugrid, style='wireframe', color='black')
plotter.add_bounding_box(color='red')
plotter.show_grid(color="red")
plotter.view_xy()
plotter.show()

I only get the red bounding box/grid but no cylindrical mesh. Is there
something I'm missing regarding the nature of CylindricalGrid objects? It
seems that fipy is working with/using VTK under the hood so it would be
nice to be able to recover it and take a look at what I'm working with...

Regards,

Amine

On Tue, Jan 21, 2020 at 3:55 PM Guyer, Jonathan E. Dr. (Fed) via fipy <
fipy@nist.gov> wrote:

> I'm curious. Do the lines remain dashed on successive calls to plot()?
>
> As to the third question, where are you seeing exponent n and subscript i?
> I'm not suggesting we don't use them, just that I don't know where.
>
> Is the discussion at
>
> https://www.ctcms.nist.gov/fipy/documentation/numerical/discret.html#higher-order-diffusion
> helpful?
>
> > On Jan 21, 2020, at 1:25 AM, A A <amine.aboufir...@gmail.com> wrote:
> >
> > Hi Martin,
> >
> > Thanks for your response. That's strange that such a "dummy" command
> would be necessary.
> >
> > I was able to answer the second question myself. It is possible to
> retroactively change line and axis properties. For the mesh1D example I did
> the following:
> >
> > viewer = Viewer(vars=(phi, phi_analytical), datamin=-6.0, datamax=6.0)
> > ax = viewer.axes
> > ax.lines[-1].set_dashes((3.5,3.5,3.5,3.5))
> > ax.grid()
> > viewer.plot()
> >
> > Which seemed to work quite well.
> >
> > With regards to the third question, I think the terms in the general
> conservation equation are explained reasonably well in the fipy docs,
> except for the diffusion term. It is unclear what the exponent n and
> subscript i represent and how they are related to one another. Is the
> exponent an arithmetic exponent? Is i part of a sum? I had trouble
> expanding the diffusion term to n>=4.
> >
> > Regards,
> >
> > Amine
> >
> > On Mon, Jan 20, 2020 at 5:23 PM Martinus WERTS <
> martinus.we...@ens-rennes.fr> wrote:
> > Dear Amine,
> >
> > Concerning your second question, I think that this a normal (but in this
> case, annoying) feature of the Jupyter notebook.
> >
> > You might trying adding an extra (dummy) command to the cell, after the
> line in which the Viewer() is instantiated. For example: ``print('Ready')``.
> >
> > Best,
> > Martin
> >
> > On 20/01/2020 17:01, A A wrote:
> >> Dear All,
> >>
> >> I'm just getting back into using fipy after a few months hiatus. I'm
> getting more familiar with how it works, but I have a couple of questions
> about the viewer:
> >>      • Is it possible to control linestyle (specifically dashes)  of
> the cellVariable objects tied to each specific viewer? I'd like to avoid
> the possibility of superimposing very similar plots and thinking they are
> the same
> >>      • I am primarily using jupyter notebook to practice some basic
> concepts. What I've found is that simply instantiating the viewer in
> interactive mode will generate a plot. This renders a viewer.plot() call
> redundant. When I run the whole notebook in non-interactive mode I get the
> expected behavior, namely one plot with a .plot() call. Am I missing
> something here? Why does viewer instantiation generate a plot in jupyter
> notebook?
> >> Thanks for your help and look forward to your reply.
> >>
> >> Regards,
> >>
> >> Amine Aboufirass
> >>
> >>
> >> _______________________________________________
> >> fipy mailing list
> >>
> >> fipy@nist.gov
> >> http://www.ctcms.nist.gov/fipy
> >>
> >>   [ NIST internal ONLY:
> >> https://email.nist.gov/mailman/listinfo/fipy
> >>  ]
> >>
> >
> >
> > _______________________________________________
> > fipy mailing list
> > fipy@nist.gov
> > http://www.ctcms.nist.gov/fipy
> >   [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
> > _______________________________________________
> > fipy mailing list
> > fipy@nist.gov
> > http://www.ctcms.nist.gov/fipy
> >  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
>
>
> _______________________________________________
> fipy mailing list
> fipy@nist.gov
> http://www.ctcms.nist.gov/fipy
>   [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
>
_______________________________________________
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