Abaqus Surface getSequenceFromMask [英] Abaqus Surface getSequenceFromMask

查看:108
本文介绍了Abaqus Surface getSequenceFromMask的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Abaqus中编写脚本,在其中我用切圆(如奶酪)压碎圆圈和正方形.我需要在零件之间放置接触,所以我需要曲面.

I am writing script in Abaqus, where I crush circle and square with cut circle (like cheese). I need to put Contact between parts so I need Surface.

宏管理器生成:

s1 = a.instances['kolo-1'].edges
side1Edges1 = s1.getSequenceFromMask(mask=('[#1 ]', ), )
a.Surface(side1Edges=side1Edges1 , name='kolkoSurf')

问题是:getSequenceFromMask(mask =('[#1]',),)如何获得此#1?我可以更换它吗?我搜索很少,有一些想法可以使用:查找",面部","COORDS",但我无法管理.请帮我.我梦想得到一个简单的示例,说明如何使用X,Y或其他方式提取此Surface.

The problem is: getSequenceFromMask(mask=('[#1 ]', ), ) How to get this #1? Can I replace it? I searched little and there were some ideas to use: 'find', 'face', 'COORDS' but I cannot manage it. Please help me. I dream to get an simple example how to extract this Surface using X, Y or anyway.

BR,元满

推荐答案

您使用带有默认日志选项的宏管理器记录了上述日志.因此,变量 side1Edges1 是使用 getSequenceFromMask()-方法在日记中定义的.此方法是录制过程中通过单击GUI进行的选择的录制.这意味着您单击了GUI来选择一条边,结果是 getSequenceFromMask()方法作用于 s1 ,这是实例的所有边的集合'kolo-1'.

You recorded the above journal using the macro manager with default journal options. Therefore, the variable side1Edges1 is defined in your journal using the getSequenceFromMask()-method. This method is the recording of the selection you performed by clicking the GUI during the recording. This means you clicked the GUI to select an edge and the result is the getSequenceFromMask()-method acting on s1 which is a set of all edges of the instance 'kolo-1'.

根据Abaqus脚本参考指南6.14-7.2.2,当涉及大量对象时,方法 getSequenceFromMask()非常高效.但是,如果您尝试自定义日记文件以选择另一个要使用的几何元素,这不是很有帮助.有两种解决方案:

According to Abaqus Scripting Reference Guide 6.14 - 7.2.2 the method getSequenceFromMask() is highly efficient when a large number of objects are involved. However, this is not very helpful if your trying to customize your journal file to select another geometry element to work with. There are two solutions:

  1. 解决方案:粘贴命令

  1. Solution: Paste the command

session.journalOptions.setValues(replayGeometry=COORDINATE, recoverGeometry=COORDINATE)

进入Abaqus CAE底部的Abaqus命令行,将JournalOptions对象的成员 replayGeometry recoverGeometry 设置为 COORDINATE 并重复记录日记.在大多数情况下,发出上述命令后,通过执行旧日记,可以省略再次单击GUI的操作.然后,您可以保存您的项目(最好使用新名称),并使用新创建的日志.在新日记中,命令 getSequenceFromMask(mask =('[#1]',),)将被基于坐标的选择所替代,以代表您记录的GUI单击.然后您可以修改坐标以自定义您的日志文件并选择您喜欢在后续建模步骤中使用的边.

into the Abaqus command line at the bottom of Abaqus CAE to set the members replayGeometry and recoverGeometry of your JournalOptions object to COORDINATE and repeat the recording of your journal. You can, most of the time, omit clicking the GUI again by executing your old journal after issuing the command above. You can then save your project, preferably with a new name, and use the newly created journal. In the new journal the command getSequenceFromMask(mask=('[#1 ]', ), ) will by replaced by a selection based on coordinates to represent your recorded GUI-click. You can then modify the coordinates in order to customize your journal file and to select the edge you like to use in subsequent modeling steps.

解决方案:使用在Python脚本的前几行中从头开始定义的变量定义 side1Edges1 .我建议将日志文件用作蓝图,其中必须使用您自己定义的众所周知的变量来替换所有单击事件.例如,使用您自己的逻辑定义点列表 myPoints = [(0,0),(0,1)] ,然后将这些点用作方法的参数,例如 myLine = mySketch.Line(point1 = myPoints [0],point2 = myPoints [1]),构造诸如 myLine 之类的新变量以用于后续建模步骤.

Solution: Define side1Edges1 using variables you defined from Scratch in the preceding lines of your python script. I recommend using the journal file as a blueprint in which all click-events have to be replaced using well known variables, defined by yourself. For example, define a list of points myPoints = [(0,0), (0,1) ] using your own logic and then use these points as arguments of the methods e.g. myLine = mySketch.Line(point1=myPoints[0], point2=myPoints[1]), constructing new variables like myLine for the usage in subsequent modeling steps.

要对使用Abaqus Python API的建模工作流程有基本的了解,我可以建议Puri,G. M.,2011年.Abaqus的Python脚本:通过示例学习,第1版,在大多数大学中也几乎没有.

To get a basic understanding of the modeling workflow using the Abaqus Python API, i can recommend Puri, G. M., 2011. Python scripts for Abaqus : learn by example, 1st Edition, also it is hardly available in most universities.

查看Abaqus基准指南可能会有所帮助,因为一些较新的基准包含Python脚本(例如,断裂力学).

Looking at the Abaqus Benchmark Guide can be helpful, as some newer Benchmarks contain Python scripts (e.g. Fracture Mechanics).

这篇关于Abaqus Surface getSequenceFromMask的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆