# Obtaining Solved Solution Data in vtk Format

**URL:** <https://bempp.discourse.group/t/obtaining-solved-solution-data-in-vtk-format/37>\
**Category:** Uncategorized\
**Created:** [12 October 2020 07:38 UTC](https://bempp.discourse.group/t/obtaining-solved-solution-data-in-vtk-format/37 "2020-10-12T07:38:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gwang4](https://avatars.discourse-cdn.com/v4/letter/g/47e85d/32.png) [@gwang4](https://bempp.discourse.group/u/gwang4)\
**Post date:** [12 October 2020 07:38 UTC](https://bempp.discourse.group/t/obtaining-solved-solution-data-in-vtk-format/37/1 "2020-10-12T07:38:58Z")

</div>

Hello,

I am working on simulating Laplace’s equation with Dirichlet Boundary Conditions, specifying the electric potential on the surface. I’m importing a grid I generated in .vtk format and following the documentation for Bempp on “Solving your first problem with Bempp”. My solution is stored in “sol” after calling bempp.api.linalg.gmres (sol, info = bempp.api.linalg.gmres(slp, rhs)), and I would like to obtain data on the calculated vector fields (electric field) in 3D space. Is there a way to obtain this data, perhaps a collection of arrays that store numbers representing vector components in a lattice?

In addition, I’m trying to export the solution to a .msh or .vtk file using bempp.api.export(‘grid\_function.vtk’, grid\_function=sol), but I’m obtaining “TypeError: write() got multiple values for keyword argument ‘binary’”. I included the full error message below. I’m using Python 3.7.6 and Jupyter Notebook.

Thank you very much.

* * *

TypeError Traceback (most recent call last)  
 in   
----\> 1 bempp.api.export(‘grid\_function.vtk’, grid\_function=sol)

/opt/anaconda3/lib/python3.7/site-packages/bempp/api/grid/io.py in export(filename, grid, grid\_function, data\_type, transformation, write\_binary)  
141 cell\_data=cell\_data,  
142 binary=write\_binary,  
–\> 143 file\_format=file\_format,  
144 )  
145

/opt/anaconda3/lib/python3.7/site-packages/meshio/\_helpers.py in write\_points\_cells(filename, points, cells, point\_data, cell\_data, field\_data, file\_format, \*\*kwargs)  
83 points, cells, point\_data=point\_data, cell\_data=cell\_data, field\_data=field\_data  
84 )  
—\> 85 return write(filename, mesh, file\_format=file\_format, \*\*kwargs)  
86  
87

/opt/anaconda3/lib/python3.7/site-packages/meshio/\_helpers.py in write(filename, mesh, file\_format, \*\*kwargs)  
131  
132 # Write  
–\> 133 return writer(filename, mesh, \*\*kwargs)

/opt/anaconda3/lib/python3.7/site-packages/meshio/vtk/\_vtk.py in (f, m, \*\*kwargs)  
724 read,  
725 {  
–\> 726 “vtk”: lambda f, m, \*\*kwargs: write(f, m, \*\*kwargs, binary=True),  
727 “vtk-ascii”: lambda f, m, \*\*kwargs: write(f, m, \*\*kwargs, binary=False),  
728 “vtk-binary”: lambda f, m, \*\*kwargs: write(f, m, \*\*kwargs, binary=True),

TypeError: write() got multiple values for keyword argument ‘binary’

---

<div class="post-metadata">

**Author:** ![timo](https://yyz2.discourse-cdn.com/free1/user_avatar/bempp.discourse.group/timo/32/7_2.png) [@timo](https://bempp.discourse.group/u/timo)\
**Post date:** [12 October 2020 08:46 UTC](https://bempp.discourse.group/t/obtaining-solved-solution-data-in-vtk-format/37/2 "2020-10-12T08:46:28Z")

</div>

Hi. Are you running the newest version Bempp-cl 0.2.2? We had this issue. But it should be fixed. Let me know if it isn’t and I will check this again.

Timo

---

<div class="post-metadata">

**Author:** ![mscroggs](https://yyz2.discourse-cdn.com/free1/user_avatar/bempp.discourse.group/mscroggs/32/3_2.png) [@mscroggs](https://bempp.discourse.group/u/mscroggs)\
**Post date:** [12 October 2020 09:26 UTC](https://bempp.discourse.group/t/obtaining-solved-solution-data-in-vtk-format/37/3 "2020-10-12T09:26:31Z")

</div>

If you’re using the latest Bempp, this issue is caused by an old version of meshio. Can you update meshio and see if that fixes it?
