|
[Sponsors] |
How to close Pointwise in a script if an error occurs |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 15, 2017, 14:13 |
How to close Pointwise in a script if an error occurs
|
#1 |
Member
Mike Lob
Join Date: Oct 2015
Location: It
Posts: 51
Rep Power: 11 |
Hello everyone!
As part of my IRP I need to generate (or, at least, try to generate) 180 different grids. Each one of these, is created by Python, who modifies the value of translation and rotation for two of the three parts of a multi element wing. For some of the cases, intersection between the geometries occurs. I need to automatically close Pointwise in the case this problem occurs. Do you know any way to do so? Thank you! |
|
November 15, 2017, 14:44 |
|
#2 |
Senior Member
Chris Sideroff
Join Date: Mar 2009
Location: Ottawa, ON, CAN
Posts: 434
Rep Power: 22 |
||
November 15, 2017, 14:46 |
|
#3 |
Member
Mike Lob
Join Date: Oct 2015
Location: It
Posts: 51
Rep Power: 11 |
Dear cnsidero,
Thank you for your post. This is not enough. I already use the line you posted in the case the mesh is successfully generated. I need to understand how I can handle the error and close automatically Pointwise if a mesh can not be generated. |
|
November 15, 2017, 15:00 |
|
#4 |
Senior Member
Chris Sideroff
Join Date: Mar 2009
Location: Ottawa, ON, CAN
Posts: 434
Rep Power: 22 |
Ok, you're going to need to be more specific when you say "error". Do you mean, if the intersection test is positive, i.e. geometries overlap, abort the meshing for that particular arrangement? If so, the place to start is
Code:
pw::Database intersect It returns a list of newly created entities. In your case, you want the returned list to be empty so just check the length of the list, e.g. Code:
xsect_ents = [] lappend xsect_ents [pw::Database intersect ent_list1 ent_list2] if [llength $xsect_ents] { pw::Application exit } |
|
November 15, 2017, 15:29 |
|
#5 |
Member
Mike Lob
Join Date: Oct 2015
Location: It
Posts: 51
Rep Power: 11 |
Sorry for being so vague.
I'll explain better. I need to optimize a multi-element wing. For this reason, I'm evaluating how the slat and flap rotation+translation change the lift and drag coefficient. What I'd like to do, is asking to my script to shut down Pointwise if any kind of error occurs, so that any kind of infeasible geometry will not be nor generated nor analyzed by my solver. https://ibb.co/cGdS56 Is there any way I can solve this? Any kind of error handler? Thank you |
|
November 15, 2017, 15:40 |
|
#6 |
Senior Member
Chris Sideroff
Join Date: Mar 2009
Location: Ottawa, ON, CAN
Posts: 434
Rep Power: 22 |
Glyph provides no generic error handling functionality. The are many distinct operations in the meshing process and you must instrument your own error handling for each. In my simple example I was testing if a Glyph operation returned entities or not. You would need to a) determine what data, if any, is return by the Glyph operation and then b) encapsulate the appropriate decision making process on that data into code.
If you are serious about doing this correctly, I would invest some time learning about catch: http://www.tcl.tk/man/tcl8.5/TclCmd/catch.htm |
|
Tags |
multi element wing, optimization, pointwise, script |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[General] Close Paraview after python script execution | taalf | ParaView | 4 | August 29, 2019 22:29 |
[Commercial meshers] Pointwise to Foam - cyclic BC points order | Pj. | OpenFOAM Meshing & Mesh Conversion | 5 | August 14, 2016 05:47 |
[snappyHexMesh] crash sHM | H25E | OpenFOAM Meshing & Mesh Conversion | 11 | November 10, 2014 12:27 |
[Commercial meshers] Native OpenFOAM interface in Pointwise | cnsidero | OpenFOAM Meshing & Mesh Conversion | 41 | May 20, 2012 19:30 |
Native OpenFOAM interface in Pointwise | Chris Sideroff | Main CFD Forum | 0 | January 16, 2009 13:37 |