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

Scripting - Create Unstructured Mesh

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 9, 2014, 12:34
Question Scripting - Create Unstructured Mesh
  #1
Member
 
Vanessa Herwig
Join Date: May 2014
Posts: 36
Rep Power: 12
v_herw is on a distinguished road
Hi All,

again a scripting question. I am trying to create an Unstructured Domain.

I did it by Hand while Journaling and the Output was:

Code:
set _TMP(mode_10) [pw::Application begin Create]
  set _CN(3) [pw::GridEntity getByName "con-1"]
  set _TMP(edge_3) [pw::Edge create]
  $_TMP(edge_3) addConnector $_CN(3)
  set _CN(2) [pw::GridEntity getByName "Boundary Layer Con"]
  $_TMP(edge_3) addConnector $_CN(2)
  $_TMP(edge_3) addConnector $_CN(3)
  set _CN(4) [pw::GridEntity getByName "con-2"]
  $_TMP(edge_3) addConnector $_CN(4)
  set _CN(5) [pw::GridEntity getByName "con-3"]
  $_TMP(edge_3) addConnector $_CN(5)
  set _CN(6) [pw::GridEntity getByName "con-4"]
  $_TMP(edge_3) addConnector $_CN(6)
  set _CN(7) [pw::GridEntity getByName "con-5"]
  $_TMP(edge_3) addConnector $_CN(7)
  set _CN(8) [pw::GridEntity getByName "con-6"]
  $_TMP(edge_3) addConnector $_CN(8)
  set _TMP(dom_1) [pw::DomainUnstructured create]
  $_TMP(dom_1) addEdge $_TMP(edge_3)
  unset _TMP(edge_3)
$_TMP(mode_10) end
unset _TMP(mode_10)
unset _TMP(dom_1)
pw::Application markUndoLevel {Assemble Domain}

set _TMP(mode_10) [pw::Application begin Create]
$_TMP(mode_10) abort
unset _TMP(mode_10)
I tried to modify it like this:

Code:
set DomCon[list $_CN(2) $_CN(3) $_CN(4) $_CN(5) $_CN(6) $_CN(7) $_CN(8) $_CN(3)]

set UnstrDomMode [pw::Application begin Create]
	foreach con $DomCon {
		set EdgeCreate [pw::Edge create]
		$EdgeCreate addConnector $con
		set DomCreate [pw::DomainUnstructured create]
		$DomCreate addEdge $EdgeCreate
	}
$UnstrDomMode end
Can somebody help me with this? The fault is that the grid is not closed. I tried to modify my list that it should be closed - but it is not working...


Is the Mode created in the right way or is it completely not what it should look like. Unfortunately I didn't find anything on the Glyph2 homepage.

Thanks for your help.

Vanessa
v_herw is offline   Reply With Quote

Old   May 9, 2014, 13:12
Default
  #2
Senior Member
 
Travis Carrigan
Join Date: Jul 2010
Location: Arlington, TX
Posts: 161
Rep Power: 16
tcarrigan is on a distinguished road
Hello Vanessa,

You're close, but you wrapped up too much in your foreach loop. Also, I noticed your connector list has duplicates.

Here's a general procedure for creating an unstructured domain from a list of connectors:

Code:
proc DomUnsConnectors { conList } {

  set edge [pw::Edge create]

  foreach con $conList {
    $edge addConnector $con
  }

  set domain [pw::DomainUnstructured create]
  $domain addEdge $edge

  return $domain
}
An unstructured domain consists of at least one edge. This code will take a connector list and begin by creating an edge object. Next, it will loop through all the connectors and add them one at a time to the edge object. Remember, an edge can consist of multiple connectors. Once the edge has been defined, you can now create the unstructured domain object and add the edge.

I want to mention that this code can be found by browsing the GlyphUtilityLibrary repository on GitHub. There are many functions for creating and manipulating the various entities that Pointwise supports.
tcarrigan is offline   Reply With Quote

Old   May 12, 2014, 05:09
Cool
  #3
Member
 
Vanessa Herwig
Join Date: May 2014
Posts: 36
Rep Power: 12
v_herw is on a distinguished road
Hi Travis,

this procedure looks much nicer than my created one..

I put some of the connectors twice in the list because PW told me that the edge is not closed (I get the same when I proceed with your procedure):

Code:
Script: ----- TCL TRACE -----
Script: ERROR: (EXCEPTION) Edge is not closed
Script: 
Script:     while executing
Script: "$domain addEdge $edge"
Script:     (file "C:/temporary/Workstation/pointwise/journaling/Farfield.jrn" line 130)
I created a Farfield like it is created in the 2d T-Rex tutorial - I have a wake connector behind my foil and around the foil an boundary layer.. To close the edge i thought I have to add the wake con twice in the list.

How can i ensure that i don't include my database cons and also have my wake con twice in it. (In the original code it is _CN(3))

Thank you.

Vanessa

ps: I didn't find the library yet - thank you for giving me the link to it.
v_herw is offline   Reply With Quote

Reply

Tags
glyph2, mode, unstructured mesh


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
[ICEM] Creating unstructured mesh and setting mesh sizes cfdworks ANSYS Meshing & Geometry 0 February 25, 2014 23:23
[ICEM] Orthogonality/Skew issues in 3D unstructured mesh eddyy19g ANSYS Meshing & Geometry 3 February 13, 2014 10:36
[mesh manipulation] polyDualMesh, create a tetrahedral mesh from a polyhedral mesh Martin80 OpenFOAM Meshing & Mesh Conversion 5 January 30, 2013 23:07
[ICEM] Why do I have to convert my mesh to an unstructured mesh? iznish ANSYS Meshing & Geometry 1 November 2, 2012 09:29
Where's the singularity/mesh flaw? audrich FLUENT 3 August 4, 2009 02:07


All times are GMT -4. The time now is 06:24.