TUI script for grouping elements/nodes belonging to a Geom

More
13 years 9 months ago #4383 by JMB
Hello,

I have read the documentation and tried to look in the examples, but have been unable to figure out how to create a group of edge elements in a 2D mesh that belong to a geometrical edge. Here is what I have so far:

[code:1]
# Create the Mesh groups for BC
aFilterManager = smesh.CreateFilterManager()
Filter_M1_Fixed = aFilterManager.CreateFilter()
aCriteria = []
aCriterion = SMESH.Filter.Criterion(16,32,0,'M1_Fixed','',32,32,1e-07,SMESH.EDGE,-1)
aBelongToGeom_M1_Fixed = aFilterManager.CreateBelongToGeom()
aBelongToGeom_M1_Fixed.SetElementType(SMESH.EDGE)
aBelongToGeom_M1_Fixed.SetTolerance(1e-07)
aCriteria.append(aCriterion)
Filter_M1_Fixed.SetCriteria(aCriteria)
Filter_M1_Fixed.SetPredicate(aBelongToGeom_M1_Fixed)
Fixed1 = Mesh_1.CreateEmptyGroup( SMESH.EDGE, 'Fixed1' )
[/code:1]

I am not sure I am on the right path above. Also I am unsure about the next steps such as:

[code:1]
nbAdd = Fixed1.Add( [ 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 ] )
aBelongToGeom_M1_Fixed.SetMesh(Mesh_1.GetMesh())
[/code:1]

because I don't want to specify the nodes or element numbers, the script should select them if they belong to the edge called "Fixed1". Would somebody kindly assist me with the snippet of code I should be using here. Thanks.


Regards,
JMB<br /><br />Post edited by: JMB, at: 2010/07/21 15:21

Please Log in or Create an account to join the conversation.

Moderators: catux
Time to create page: 0.141 seconds
Powered by Kunena Forum