[petsc-dev] Problem in viewer for surface for 3D problem

gouarin loic.gouarin at math.u-psud.fr
Wed Mar 16 07:23:54 CDT 2016


Hi,

I try to use PETSc to solve BEM problem so I need to construct a surface 
with 3D coordinates. First of all, I would like to plot the mesh and I 
think that the output of the viewer is completely wrong.

Here is a Python example

import sys, petsc4py
petsc4py.init(sys.argv)
import numpy as np
import petsc4py.PETSc as petsc


coords = np.array([[0, 0, 0],
                    [1, 0, 0],
                    [0, 1, 0],
                    [1, 1, 0],
                    [0, 0, 1],
                    [1, 0, 1],
                    [0, 1, 1],
                    [1, 1, 1],
                   ], dtype=np.double)

cells = np.array([[0, 1, 3, 2],
                   [1, 5, 7, 3],
                   [0, 4, 6, 2],
                   [2, 3, 6, 7],
                   [0, 1, 5, 4],
                   [4, 5, 7, 6],
                  ], dtype=np.int32)

dm = petsc.DMPlex().createFromCellList(2, cells, coords, 
interpolate=False, comm=petsc.COMM_WORLD)

viewer = petsc.Viewer().createHDF5('cube.h5', 'w')
dm.view(viewer)

If you look at the cells in the cube.h5, the numbering of the points is 
wrong.

Thanks,
Loic
-- 
Loic Gouarin
Laboratoire de Mathématiques
Université Paris-Sud
Bâtiment 425
91405 Orsay Cedex
France
Tel: (+33) 1 69 15 60 14
Fax: (+33) 1 69 15 67 18



More information about the petsc-dev mailing list