Hello All, This exchange with Luca on the vmtkboundaryreferencesystem script may be of interest:
*******************************************************************
Dear Luca,
I have a question regarding the python function
vmtkboundaryreferencesystems. I hope you do not mind me sending this
question directly to you. If it is better to submit to the mailing
list please let me know and I will use that alternative. To be
honest, I'm not sure how to properly use the function
vmtkboundaryreferencesystems. My desire is to use VMTK to assist me in
specifying boundary conditions for CFD and I believe this is the
proper function to use. Firstly, to this email I have attached the
output file which resulted from my call using PypePad:
vmtkboundaryreferencesystems -ifile
"C:\\Users\\Mark\\Documents\\python\\fenics\\myNS3d_2\\surface_3_clip.vtp"
-ofile
"C:\\Users\\Mark\\Documents\\python\\fenics\\myNS3d_2\\surface_3_clip_ref.vtp"
The resulting data seems to be compressed and I'm not sure how to
decode the results. So I thought I'd try to make the call from within
python and extract the boundary information. Here is the python
script I used:
import sys
sys.path.append('C:\\Program Files (x86)\\vmtk 0.9.0\\lib\\vmtk')
from vmtk import pypes
import os
os.environ['PATH'] = 'C:\\Program Files (x86)\\vmtk 0.9.0\\bin' + ';'
+ os.environ['PATH']
from vmtk import vmtkboundaryreferencesystems
myArg = 'vmtksurfacereader -ifile
"C:\\Users\\Mark\\Documents\\python\\\\fenics\\myNS3d_2\\surface_3_clip.vtp"'
myType = pypes.PypeRun(myArg)
mySurface = myType.GetScriptObject('vmtksurfacereader','0').Surface
from vmtk import vmtkscripts
myRef = vmtkscripts.vmtkBoundaryReferenceSystems()
myRef.Surface = mySurface
myRef.Execute()
but when I execute this script I obtain the following output and error:
Creating vmtkSurfaceReader instance.
Automatic piping vmtksurfacereader
Parsing options vmtksurfacereader
InputFileName = C:\Users\Mark\Documents\python\fenics\myNS3d_2\surface_3_cli
p.vtp
Explicit piping vmtksurfacereader
Input vmtksurfacereader members:
Id = 0
Disabled = 0
Format =
GuessFormat = 1
Surface = 0
InputFileName = C:\Users\Mark\Documents\python\fenics\myNS3d_2\surface_3_cli
p.vtp
SurfaceOutputFileName =
Executing vmtksurfacereader ...
Reading VTK XML surface file.
Done executing vmtksurfacereader.
Output vmtksurfacereader members:
Id = 0
Surface = vtkPolyData
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "boundary.py", line 14, in <module>
myRef.Execute()
File "C:\Program Files (x86)\vmtk 0.9.0\lib\vmtk\vmtk\vmtkboundaryreferencesys
tems.py", line 62, in Execute
boundaryReferenceSystems.SetInput(self.Surface)
TypeError: function takes exactly 2 arguments (1 given)
Luca, thank you in advance for any insight!
Sincerely,
Mark Ettinger
***************************************************
Dear Mark,
(yes, it would be great if you could post this question on the list
along with my response)
you are right, the script is the appropriate one to use. In fact,
there is another one you could
use once you have the mesh, which is vmtkmeshboundaryinspector, which
is the one I
customarily use.
Anyway, I opened your file, e.g., in Paraview and passed it through
the Glyph filter, and
could visualize the normals and radius correctly. It's a good way of
finding out if the
reference systems make sense. I have in mind to equip vmtk with a few
more visualization
scripts, so that one can bypass the Paraview check.
You may not know that you can output data in csv-like format directly
from vmtk, just use
a .dat extension:
vmtksurfacereader -ifile surface_3_clip_ref.vtp -ofile surface_3_clip_ref.dat
You can then open the .dat file with any text editor or spreadsheet.
Hope this helps
Luca
PS: I have no idea why your script doesn't work in your case, I cut
and pasted it, changed paths
and it works for me...
surface_3_clip_ref.vtp
Description: Binary data
------------------------------------------------------------------------------ Achieve unprecedented app performance and reliability What every C/C++ and Fortran developer should know. Learn how Intel has extended the reach of its next-generation tools to help boost performance applications - inlcuding clusters. http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________ vmtk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/vmtk-users
