seveas / python-hpilo

Accessing the HP iLO XML interface from python

Home Page:https://seveas.github.io/python-hpilo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pygmsh: TypeError: write() got an unexpected keyword argument 'cell_data'

FloHache opened this issue · comments

Deall,

I am trying to learn how to use pygmsh and I have some issues. Hopefully, you will accept to help me.

Below is the (very simple) program that I try to use:

import pygmsh
import numpy as np
import sys
import os

geom = pygmsh.opencascade.Geometry(characteristic_length_min=0.1,characteristic_length_max=0.1)
geom
rectangle = geom.add_rectangle([-1.0, -1.0, 0.0], 2.0, 2.0)
disk1 = geom.add_disk([-1.2, 0.0, 0.0], 0.5)
disk2 = geom.add_disk([+1.2, 0.0, 0.0], 0.5)
union = geom.boolean_union([rectangle, disk1, disk2])

disk3 = geom.add_disk([0.0, -0.9, 0.0], 0.5)
disk4 = geom.add_disk([0.0, +0.9, 0.0], 0.5)
flat = geom.boolean_difference([union], [disk3, disk4])

geom.extrude(flat, [0, 0, 0.3])

points, cells, point_data, cell_data, field_data =pygmsh.generate_mesh(geom)

meshio.write('test.vtu', points, cells, cell_data=cell_data)

When I run the program, it says

meshio.write('test.vtu', points, cells, cell_data=cell_data) #The output file can be visualized with various tools, e.g., ParaView.
Traceback (most recent call last):

File "", line 1, in
meshio.write('test.vtu', points, cells, cell_data=cell_data) #The output file can be visualized with various tools, e.g., ParaView.

TypeError: write() got an unexpected keyword argument 'cell_data'

I am confused and if you have any suggestion to solve the problem, it would be great.

Hi @FloHache,

This is the python-hpilo repository, I believe you may be looking for https://github.com/nschloe/pygmsh