CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > FloEFD, FloWorks & FloTHERM

FloEFD API from Python script. Set2DTableData problem.

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By dmitry.grigoryev
  • 1 Post By Boris_M
  • 2 Post By dmitry.grigoryev

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 6, 2018, 08:00
Default FloEFD API from Python script. Set2DTableData problem.
  #1
New Member
 
Dmitry Grigoryev
Join Date: Feb 2018
Posts: 2
Rep Power: 0
dmitry.grigoryev is on a distinguished road
Hello,

A try to set up boundary conditions in FloEFD project from python script and I have a problem with setting up the data for Table dependency parameter. I call the FloEFD API function like this(for example, arrays of length 1):
Code:
 error = param.Set2DTableData([0.015], [2.0])
After I call the API getter function:
Code:
_, valueX, valueF = param.Get2DTableData()
Received output:
Code:
valueX  = (2.5e-323,)
valueF = (2.5e-323,)
I don't have any idea about this behavior. Thanks for any tip
Elaine He likes this.
dmitry.grigoryev is offline   Reply With Quote

Old   March 28, 2018, 08:51
Default
  #2
Disabled
 
Join Date: Jul 2009
Posts: 616
Rep Power: 24
Boris_M will become famous soon enough
Hi Dmitry,

The API is meant for VBA, VB, and VC++.
I cannot tell if there is any compatibility with Python and wouldn't trust it delivering correct values. Have you tried it in the supported languages in a simple example to see what the feedback there is?

Regards,
Boris
Elaine He likes this.
Boris_M is offline   Reply With Quote

Old   May 4, 2018, 09:41
Default
  #3
New Member
 
Dmitry Grigoryev
Join Date: Feb 2018
Posts: 2
Rep Power: 0
dmitry.grigoryev is on a distinguished road
Quote:
Originally Posted by dmitry.grigoryev View Post
Hello,

A try to set up boundary conditions in FloEFD project from python script and I have a problem with setting up the data for Table dependency parameter. I call the FloEFD API function like this(for example, arrays of length 1):
Code:
 error = param.Set2DTableData([0.015], [2.0])
After I call the API getter function:
Code:
_, valueX, valueF = param.Get2DTableData()
Received output:
Code:
valueX  = (2.5e-323,)
valueF = (2.5e-323,)
I don't have any idea about this behavior. Thanks for any tip
I had solved this problem by explicit casting input data for Set2dTableData to VT_ARRAY object(FloEFD documentation says the input data type is VARIANT).

Python example:
Code:
win32com.client.VARIANT(pythoncom.VT_ARRAY | pythoncom.VT_R8, value)

Boris, thanks for your advice, it was really helpful for me.
Boris_M and Elaine He like this.
dmitry.grigoryev is offline   Reply With Quote

Reply

Tags
api, floefd, floefd api, python


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Slicing extracted part of a volume in Python script wilmbas OpenFOAM Post-Processing 4 April 28, 2016 18:14
[ICEM] Automatic mesh generation script surface intersection problem stuart23 ANSYS Meshing & Geometry 0 May 13, 2011 02:10
FloEFD API - SolidWorks Modeling j.gerber FloEFD, FloWorks & FloTHERM 10 December 7, 2010 22:14
[ICEM] Problem in geometry creation by script lavoz ANSYS Meshing & Geometry 4 March 12, 2010 11:56
ICEM script problem Zbynek CFX 0 October 12, 2004 08:05


All times are GMT -4. The time now is 09:53.