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

Journaling - Create 2 Point Connector

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 8, 2014, 12:48
Question Journaling - Create 2 Point Connector
  #1
Member
 
Vanessa Herwig
Join Date: May 2014
Posts: 36
Rep Power: 12
v_herw is on a distinguished road
Hi,

I have a question regarding Journaling in Pointwise.
I want to create a script where I connect 2 Points with a Connector. The Journaling gives me this output:

Code:
set _TMP(mode_10) [pw::Application begin Create]
  set _TMP(PW_68) [pw::SegmentSpline create]
  set _CN(8) [pw::GridEntity getByName "con-6"]
  $_TMP(PW_68) addPoint [$_CN(1) getPosition -arc 1]
  $_TMP(PW_68) addPoint [$_CN(4) getPosition -arc 0]
  set _TMP(con_24) [pw::Connector create]
  $_TMP(con_24) addSegment $_TMP(PW_68)
  unset _TMP(PW_68)
  $_TMP(con_24) calculateDimension
$_TMP(mode_10) end
unset _TMP(mode_10)
pw::Application markUndoLevel {Create 2 Point Connector}

set _TMP(mode_10) [pw::Application begin Create]
  set _TMP(PW_69) [pw::SegmentSpline create]
  set _CN(9) [pw::GridEntity getByName "con-7"]
  $_TMP(PW_69) delete
  unset _TMP(PW_69)
$_TMP(mode_10) abort
unset _TMP(mode_10)
unset _TMP(con_24)
_CN(1) and _CN(4) are the two connectors I want to connect.

I am not sure what the second "Application begin Create" is all about. Can anyone explain it to me what it is about and why it is importend to have it in the script.

Thank you for your help.

Vanessa
v_herw is offline   Reply With Quote

Old   May 8, 2014, 15:00
Default
  #2
Senior Member
 
Chris Sideroff
Join Date: Mar 2009
Location: Ottawa, ON, CAN
Posts: 434
Rep Power: 22
cnsidero is on a distinguished road
Quote:
Originally Posted by v_herw View Post
Hi,

I have a question regarding Journaling in Pointwise.
I want to create a script where I connect 2 Points with a Connector. The Journaling gives me this output:

Code:
set _TMP(mode_10) [pw::Application begin Create]
  set _TMP(PW_68) [pw::SegmentSpline create]
  set _CN(8) [pw::GridEntity getByName "con-6"]
  $_TMP(PW_68) addPoint [$_CN(1) getPosition -arc 1]
  $_TMP(PW_68) addPoint [$_CN(4) getPosition -arc 0]
  set _TMP(con_24) [pw::Connector create]
  $_TMP(con_24) addSegment $_TMP(PW_68)
  unset _TMP(PW_68)
  $_TMP(con_24) calculateDimension
$_TMP(mode_10) end
unset _TMP(mode_10)
pw::Application markUndoLevel {Create 2 Point Connector}

set _TMP(mode_10) [pw::Application begin Create] instead
  set _TMP(PW_69) [pw::SegmentSpline create]
  set _CN(9) [pw::GridEntity getByName "con-7"]
  $_TMP(PW_69) delete
  unset _TMP(PW_69)
$_TMP(mode_10) abort
unset _TMP(mode_10)
unset _TMP(con_24)
_CN(1) and _CN(4) are the two connectors I want to connect.

I am not sure what the second "Application begin Create" is all about. Can anyone explain it to me what it is about and why it is importend to have it in the script.

Thank you for your help.

Vanessa
Vanessa,

The "pw::Application begin Create" function is creating a mode to create an entity. In this case a connector. A mode is analogous to entering a panel when using the GUI - think of it like a temporary working state and nothing actually changes until the mode is accepted with Ok or Apply. The "$mode end" command is used to "Apply" the changes. So every time you enter a mode (panel) while journaling, it will add the correspond Glyph mode commands.

Internally Pointwise uses modes for many things. For some simple tasks, there's no requirement a mode be used. And if that operation is only carried out a few times, the effort to code up the mode may not be worth it. However, if the create or modification is being done many times, doing so within a mode can have huge performance benefits.

Here's an example to explain. I want to change the dimension of a connector to a specified avg spacing. Here's how you would do it without a mode:

Code:
set con [pw::Grid getByName "con-1"]
set avgSpacing 0.5
$con setDimensionFromSpacing $avgSpacing
Pretty straightforward. But now imagine I want to modify many (e.g. 100's) connectors - all of which are connected to domains. Every time a connector is modified the domain will reinitialize, which for large, complex domains might take a long time. And if this occurs for 100s of connectors it could taking a really long time. If, however, a modify mode is used, the connector's would be redimensioned without reinitializing the domains each time one is modified. The reinitialization would only occur when the mode ended. Here's how the above would be done in a mode:

Code:
set allCons [pw::Grid getAll -type pw::Connectors]
set conRedimMode [pw::Application begin Modify $cons]
foreach con $allCons {
   $con setDimensionFromSpacing $avgSpacing
}
$conRedimMode end
There's many mode types in Glyph. You best start here: http://www.pointwise.com/glyph2/file...lication.begin and then refer to the specific mode type for the details or journal the operation like you've done.

-Chris
cnsidero is offline   Reply With Quote

Reply

Tags
connector, create, glyph, journaling, script


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
icoFoam - Floating point exception (core dumped) File OpenFOAM Running, Solving & CFD 26 March 6, 2021 05:26
how to set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 07:09
a reconstructPar issue immortality OpenFOAM Post-Processing 8 June 16, 2013 12:25
[blockMesh] Include list of points Hikachu OpenFOAM Meshing & Mesh Conversion 0 June 20, 2011 10:03
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55


All times are GMT -4. The time now is 01:00.