I've added comments to your https://github.com/usnistgov/fipy/issues/693, but 
the short answer is that FiPy's not exporting a VTK cell type that pyvista 
understands. FiPy should put out VTK_PIXELs or VTK_QUADs in this case.

> On Jan 22, 2020, at 6:22 AM, A A <amine.aboufir...@gmail.com> wrote:
> 
> 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...


_______________________________________________
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