简体   繁体   English

是否可以在Abaqus / CAE中使用用户元素定义网格并使用Python指定其属性,而无需编辑输入文件?

[英]Is it possible to define a mesh with User-Elements and specify their properties with Python in Abaqus/CAE without editing the input file?

I am not sure this is possible, but I want to create a mesh with user-defined elements in Abaqus/CAE using the Python scripting interface. 我不确定这是否可行,但是我想使用Python脚本接口在Abaqus / CAE中使用用户定义的元素创建网格。 This will consist of at least two parts on the CAE side of things: defining the nodes & connectivity, and defining the material properties. 这将在事物的CAE方面至少包括两个部分:定义节点和连接性,以及定义材料属性。

So, for example, I'm familiar with creating a part and mesh using standard elements in a couple of different ways. 因此,例如,我熟悉使用标准元素以几种不同方式创建零件和网格的方法。 A fairly readable version of which might be something like: 一个相当易读的版本可能类似于:

m = mdb.models[modelName]
newPart = m.Part(name='NewPart', dimensionality=THREE_D, type=DEFORMABLE_BODY)

for elemLabel,elemNodes in myElementDictionary.items():
    nodeObjectTuple = tuple(newPart.nodes.sequenceFromLabels(elemNodes))
    newPart.Element(nodes=nodeObjectTuple, elemShape=HEX8, label=elemLabel)

Will this work for user-defined elements, provided they match the element shape (eg HEX8)? 如果用户定义的元素与元素形状匹配(例如,HEX8),这对用户定义的元素有效吗? If so, how can the user-element properties be defined? 如果是这样,如何定义用户元素属性? I do not see a command for that in the documentation. 我在文档中没有看到用于该命令的命令。

EDIT: Typically, user element properties are specified via the input file (*USER ELEMENT and *UEL PROPERTY, for example). 编辑:通常,用户元素属性是通过输入文件指定的(例如* USER ELEMENT和* UEL PROPERTY)。 I want to know if there is a way to achieve this via the Python scripting interface without needing to edit an input file in some manner -- ie, within the Abaqus/CAE Model Database. 我想知道是否有一种方法可以通过Python脚本接口实现此功能,而无需以某种方式编辑输入文件-例如,在Abaqus / CAE模型数据库中。 Also, I have have written subroutines for the actual user element definition and behavior, that is not what I'm asking about. 另外,我已经为实际的用户元素定义和行为编写了子例程,这不是我要问的。

The other comments correctly point out that the functionality requested doesn't exist in Abaqus/CAE, and recommend that an input file be generated and then edited to insert the necessary definitions. 其他注释正确地指出,所要求的功能在Abaqus / CAE中不存在,并建议生成一个输入文件,然后对其进行编辑以插入必要的定义。

However, I've discovered that it is possible to use the Python interface within Abaqus/CAE to insert a KeywordBlock object prior to writing the input file. 但是,我发现可以在编写输入文件之前使用Abaqus / CAE中的Python接口插入KeywordBlock对象。 An example to specify a user element: 指定用户元素的示例:

mdb.models['Model-1'].keywordBlock.replace(0, """
** 
** PARTS
*user element, type=u1113, nodes=6, coordinates=2, properties=8, i properties=3, 
 variables=6
 1,2
*element, type=u1113, elset=myUser, input=1113.dat
*uel property, elset=myUser
 1.0e6, 1.0e6, 0.25, 0.25, 0., 0., 650., 0.001,
 1, 1, 0
** ASSEMBLY
**""")

Let's start to answer from the beginning: Mesh and elements are two separate concept in ABAQUS and in Finite Element Modeling in general. 让我们从头开始回答:网格和元素是ABAQUS和一般有限元素建模中的两个独立概念。 Mesh is a geometric discretization of domain into smaller pieces. 网格是将几何形状离散化为较小的区域。 Element is an interpolation space primary variables of the problem. 元素是插值空间问题的主要变量。

Yes, you can have a mesh and then define any element you like for it as soon as the elements you are defining is compatible with mesh. 是的,您可以拥有一个网格,然后在定义的元素与网格兼容后立即为其定义任何所需的元素。 As an instance if you have discretized your domain into hexahedron with 8 nodes (HEX8) you can use only compatible elements for this discretization which are C3D8R, C3D8H, C3D8, .... 例如,如果您将域离散化为具有8个节点(HEX8)的六面体,则只能使用兼容的元素进行离散化,例如C3D8R,C3D8H,C3D8等。

There is a small problem though, ABAQUS/CAE, which is the graphical user interface of ABAQUS and it is controllable with Python, does not offer UEL (User Element) as an option in the element selection dialog box. 但是,有一个小问题,ABAQUS / CAE是ABAQUS的图形用户界面,可以用Python控制,但在元素选择对话框中没有提供UEL(用户元素)作为选项。

This limitation is not a problem if you are familiar with Python and ABAQUS/Standard. 如果您熟悉Python和ABAQUS / Standard,则此限制不是问题。 You can choose any compatible element and then change your input deck, which is your .inp file which will be read by ABAQUS/Standard. 您可以选择任何兼容的元素,然后更改输入卡组,即.inp文件,该文件将由ABAQUS / Standard读取。 You can do it by many of string manipulation tools that Python offers. 您可以使用Python提供的许多字符串处理工具来完成此操作。 You just need to change your element definition in input deck from what you have chosen to your own defined UEL. 您只需要在输入面板中将元素定义从选择的内容更改为自己定义的UEL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM