0

My aim is to obtain a transition mapped quad meshing on a long rectangular region which is a parametrised model. The final mesh can be seen as follows:

Transition Mapped Quad Meshing

The only way I could realise this final output mesh was to partition the face with sketch and then, using adequate mesh controls and seeding on the respective edges. For this reason, I started with generating a block on the left hand side of the geometry like this:

Single block created by partioning the face with sketch

Thereafter, a "for" loop was used in the Python script running from the left hand side of the rectangular face to the right-most end and the final partitioned face looks like this:

Final geometry ready to be meshed

So, I tried doing this in three ways.

Option 1: Place the sketcher window using findAt at the left hand side and then generate the block and with a "for" loop push the origin of the coordinate system of the sketcher window to the right incrementally all the way to the right-most side. In other words, the position of the block with respect to the origin stayed the same always and hence, when the origin moved from left to right, the block moved with it. So I had to open and clos "Partition Face with Sketch" as many times as the number of blocks required.

Option 2: The origin of the Sketcher window stayed at the same place (i.e. at 0.0, 0.0, 0.0) and the blocks were pushed to the right incrementally. In comparison with Option 1, here the relative position of the block with respect to the origin changed over each increment. Here also, "Partition Face with Sketch" was opened and closed as many times as the number of blocks required.

Option 3: I opened the "Partition Face with Sketch" only once and the origin stayed at the same place. Then I drew all these horizontal and vertical lines also with a "for" loop resulting in the final partitioned face.

All these methodologies work perfectly but are extremely time-consuming. Each of these methods takes almost from 8-12 minutes to finish generating all the blocks and hence, is not suitable for a convergence study.

Can anyone suggest a better solution to make this entire process faster, like in 3-4 minutes or so? Would really appreciate it. Thanks in advance.

EDIT: Here is the code guys:

# The arguments of the function "block" are the x and y coordinates of the  
# 4 corners of the rectangle where the blocks have to be generated in.
def block(x_left, x_right, y_top, y_bottom):

    # Opens the sketcher window
    p = mdb.models['TDCB'].parts['Part_TDCB']
    f, e, d = p.faces, p.edges, p.datums
    t = p.MakeSketchTransform(sketchPlane=f.findAt(coordinates=(x_left + ((x_right - x_left) / 3), y_bottom + ((y_top - y_bottom) / 3), 0.0), 
    normal=(0.0, 0.0, 1.0)), sketchPlaneSide=SIDE1, origin=(x_left, y_bottom, 0.0))             
    s = mdb.models['TDCB'].ConstrainedSketch(name='__profile__', sheetSize=500.00, 
    gridSpacing=12.00, transform=t)
    g, v, d1, c = s.geometry, s.vertices, s.dimensions, s.constraints
    s.setPrimaryObject(option=SUPERIMPOSE)
    p.projectReferencesOntoSketch(sketch=s, filter=COPLANAR_EDGES)


    # The following block generates the first couple of horizontal lines 
    s.Line(point1=(block_width, 0.0), point2=(block_width, y_top))  # Line No.1

    s.Line(point1=(0.0, y_coord[-2]), point2=(block_width, y_coord[-2]))  # Line No.2

    s.Line(point1=(0.0, y_coord[-3]), point2=(block_width, y_coord[-3]))  # Line No.3

    s.Line(point1=(0.0, y_coord[-4]), point2=(block_width, y_coord[-4]))  # Line No.4

    s.Line(point1=(0.0, y_coord[-5]), point2=(block_width, y_coord[-5]))  # Line No.5

    s.Line(point1=(0.0, y_coord[-6]), point2=(block_width, y_coord[-6]))  # Line No.6

    # Closes the sketcher window
    p = mdb.models['TDCB'].parts['Part_TDCB']
    f = p.faces
    pickedFaces = f.findAt((x_left + ((x_right - x_left) / 3), y_bottom + ((y_top - y_bottom) / 3), 0.0))                     
    e1, d2 = p.edges, p.datums
    p.PartitionFaceBySketch(faces=pickedFaces, sketch=s)
    s.unsetPrimaryObject()
    del mdb.models['TDCB'].sketches['__profile__']    

    return

# Finally the blocks are generated using a "for" loop
for i in range(total_blocks):
    block(x_left, x_right, y_top, y_bottom)
Parvez Ahmed
  • 19
  • 2
  • 7
  • maybe show an example of your code would be useful. – agentp Jul 28 '16 at 13:26
  • You can make all your lines in one sketch and then partition in one go? No need for multiple steps. Also whats wrong with a disorder mesh that transitions from big to small? It doesn't have to be as neat a transition as you have shown it. – will Jul 28 '16 at 17:10
  • @Will: That's a very helpful hint. I'll try it out. Thanks a lot.. About the transition, this is actually what my Supervisor wants because the previous models were generated by another guy with the same transition.. – Parvez Ahmed Jul 28 '16 at 22:27
  • @agentp Sorry for the delay. I have edited my question and included the basis code with which I have tried out all the three options. So, if you do come across a better option, please do let me know. – Parvez Ahmed Jul 29 '16 at 00:37
  • the `set(/unset)PrimaryObject` are not needed, not sure if that impacts speed. I don't think you need `projectReferencesOntoSketch` either. You aren't actually watching the sketcher draw on screen are you? – agentp Jul 29 '16 at 02:33
  • @agentp: Can I buy you a beer mate? Total time required: 7.8 seconds.. Woohooo.. Thanks a lot again.. – Parvez Ahmed Jul 29 '16 at 19:54

1 Answers1

0

It seems you don't have to iterate the process of sketching as in ABAQUS Sketch you can use Linear Pattern to copy/duplicate the initial sketch (first block on the left side). This may make the whole process easier. Thanks.

Regards, Longjie