CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Mesh Generation & Pre-Processing Software > Pointwise & Gridgen

How to close Pointwise in a script if an error occurs

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 15, 2017, 14:13
Default 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: 9
lpz_michele is on a distinguished road
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!
lpz_michele is offline   Reply With Quote

Old   November 15, 2017, 14:44
Default
  #2
Senior Member
 
Chris Sideroff
Join Date: Mar 2009
Location: Ottawa, ON, CAN
Posts: 423
Rep Power: 20
cnsidero is on a distinguished road
pw::Application exit

In the Glyph docs: http://www.pointwise.com/glyph2/file...plication.exit
cnsidero is offline   Reply With Quote

Old   November 15, 2017, 14:46
Default
  #3
Member
 
Mike Lob
Join Date: Oct 2015
Location: It
Posts: 51
Rep Power: 9
lpz_michele is on a distinguished road
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.
lpz_michele is offline   Reply With Quote

Old   November 15, 2017, 15:00
Default
  #4
Senior Member
 
Chris Sideroff
Join Date: Mar 2009
Location: Ottawa, ON, CAN
Posts: 423
Rep Power: 20
cnsidero is on a distinguished road
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
http://www.pointwise.com/glyph2/file...base.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
}
Completely untested so considered it pseudo-code.
cnsidero is offline   Reply With Quote

Old   November 15, 2017, 15:29
Default
  #5
Member
 
Mike Lob
Join Date: Oct 2015
Location: It
Posts: 51
Rep Power: 9
lpz_michele is on a distinguished road
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
lpz_michele is offline   Reply With Quote

Old   November 15, 2017, 15:40
Default
  #6
Senior Member
 
Chris Sideroff
Join Date: Mar 2009
Location: Ottawa, ON, CAN
Posts: 423
Rep Power: 20
cnsidero is on a distinguished road
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
cnsidero is offline   Reply With Quote

Reply

Tags
multi element wing, optimization, pointwise, script

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[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


All times are GMT -4. The time now is 17:54.