- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我无法使用 Abaqus 中零件对象的 Element() 构造函数创建元素。 Node() 构造函数没有问题,但是当您尝试使用之前生成的节点创建元素时,它会显示以下错误警告:
运行脚本之前,零件网格在 Abaqus CAE 树(Recuadro 部分)中显示为空,运行脚本后不再为空,因此我知道网格已生成。
这是我的脚本:
import sys
import mesh
import part
from abaqus import *
from odbAccess import *
from abaqusConstants import *
from caeModules import *
from driverUtils import executeOnCaeStartup
#
# Función que da el número del nodo en función de las fila y columna de elementos
#
def nnodo(i,j,ne):
n = (2*ne+1)*(i-1)+j
return n
filecae= 'E:\ESI\Fatiga\Cotacto Cilindrico\ABQ\CC-Crack-0.cae'
openMdb(filecae)
# Coordenadas del arranque de la grieta en "Recuadro"
x0 =0.0
y0 = -0.002
z0 = 0.0
delta=[0]
# Dimensiones del recuadro x € [x0-a,x0+a] y € [y0-b, y0]
a=0.2
b=0.2
# Tamaño deseado de los elementos ~ le x le
le = 0.05
# Tamaño inicial de los elementos ~ dx x dy
Nex = 2*int(a/le)
Ney = int(b/le)
Nnx = 2*Nex+1
Nny = 2*Ney+1
dx = 2*a/Nex
dy = b/Ney
Nnodos = Nnx*Nny
Nelems = Nex*Ney
inod = range(Nnodos-1)
ielm = range(Nelems-1)
for i in range(Nny):
delta.append(0)
# Coordenadas de los nodos de la malla inicial
recuadro=mdb.models['P22'].parts['Recuadro']
recuadro1=mdb.models['P22'].rootAssembly.instances['Recuadro-1']
recuadro.generateMesh(regions=(recuadro.faces[0],))
for i in range(1,Nny+1):
dx1 = (Nex*dx/2 - delta[i])/Nex
dx2 = (Nex*dx/2 + delta[i])/Nex
y = y0 - (i-1)*dy/2
for j in range(1,Nnx+1):
if float(i)/2. <> int(float(i)/2. ) or float(j)/2. <>int(float(j)/2. ):
k = (2*Nex+1)*(i-1)+j
if j<=Nex+1:
x = x0 - Nex*dx/2 + (j-1)*dx1
else:
x = x0 - delta[i] + (j-Nex-1)*dx2
recuadro.Node(label = k, coordinates=(x, y, 0.))
# Conectividades de los elementos de la malla inicial
for i in range(1,Ney+1):
for j in range(1,Nex+1):
k = Nex*(i-1)+j
n1 = recuadro.nodes[nnodo(2*i+1, 2*j-1, Nex)]
n2 = recuadro.nodes[nnodo(2*i+1, 2*j , Nex)]
n3 = recuadro.nodes[nnodo(2*i+1, 2*j+1, Nex)]
n4 = recuadro.nodes[nnodo(2*i , 2*j+1, Nex)]
n5 = recuadro.nodes[nnodo(2*i-1, 2*j+1, Nex)]
n6 = recuadro.nodes[nnodo(2*i-1, 2*j , Nex)]
n7 = recuadro.nodes[nnodo(2*i-1, 2*j-1, Nex)]
n8 = recuadro.nodes[nnodo(2*i , 2*j-1, Nex)]
recuadro.Element(label = k, elemShape= QUAD8, nodes=(n1, n2, n3, n4, n5, n6, n7, n8))
最佳答案
我记得我也对这个问题感到困惑。嗯,事情是这样的 - Part 实例实际上尚未分配给您刚刚创建的元素。尝试 mdb.models[MODELNAME].parts[PARTNAME].elements[ELEMENTLABEL].instanceName
,您会看到它是 None
,因为没有返回值。我不确定这是设计使然,还是一个错误。但基本上,Part 对象有一个方法可以解决这个问题:
p = mdb.models[MODELNAME].parts[PARTNAME].PartFromMesh(name=PARTNAME, copySets=True)
你就完成了。
PS:不过,我可能会补充一点 - 对于中型到大型网格,以这种方式循环创建节点和元素对我来说似乎非常慢。 (提示:还有更快的方法!)
关于python - 在 abaqus python 中使用 Element() 构造函数创建零件元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36689793/
下面两个CSS选择器有什么区别? 来自解释here ,它们听起来一样吗? div p{} 选择div元素内的所有p元素 div > p{} 选择父级为 div 元素的所有 p 元素。 最佳答案 区别在
我需要怎么做: 目前,事实证明: 我更喜欢它看起来像: 最佳答案 有了这些空行,看起来您的 select 语句是(正确地)选择您
用替换元素是否有效至 .在这种情况下,我想要, 这样我就可以在...中附加验证数据。这也可以从 中实现吗?或 等等? 最佳答案 标签没有 而且不需要一个。同样适用于 和 .您可以将验证数据作为
我刚刚发现了 Angular 1.2.1 的一个奇怪问题,在 this fiddle 中进行了演示。 (在 IE、FF 和 Chrome 中测试):如果我创建一个非常简单的模板化指令,它无法像 那样
我正在尝试使用 Jsoup 迭代 java 中的两个元素,但是,我收到运行时异常错误。看来我无法将nodes.Element 的类型转换为element.Element。 非常感谢您的帮助,谢谢。 代
假设我的文档中有一组元素,它们是单个对象的子元素。这些元素中的每一个都使用不同的参数注册一个新的事件监听器。如果我丢弃父对象,是否需要手动取消注册所有 eventListener?或者浏览器是否跟踪所
我不应该在我的应用程序中使用 jQuery,但我有一个场景,我需要元素的偏移量,而不是使用 $(element).offset() 我已经使用了 angular.element(element).of
我是TS的新手,我想知道为什么我在以下代码中遇到类型错误(简化):。错误在`{iconMap[名称]}中:。“元素隐式具有‘any’类型,因为‘字符串’类型的表达式不能用于索引类型‘{Categori
我是TS的新手,我想知道为什么我在以下代码中遇到类型错误(简化):。错误在`{iconMap[名称]}中:。“元素隐式具有”any“类型,因为”string“类型的表达式不能用于索引类型”{ Cate
什么意思: Separator.Iterator.Element == Self.Iterator.Element.Iterator.Element 在this (Swift 标准库)swift 实例
是否可以在 img 元素上使用前后伪选择器?认为它是但没有任何运气,将 css 切换到 div 并且它工作正常。 .page-overhang 类是 img 元素。 // page overhang
我在 UI 中的按钮 Click 事件上有以下代码,它返回一个 MS-Excel 文件。它在第一次点击事件中完美运行,但之后返回以下错误。 任何建议,我怎样才能摆脱它? ERROR: Uncaught
如何在 CSS 中编写这个想法: 选择 ElementA 内但不在 ElementB 内且 ElementB 在 ElementA 内的每个元素。 这是一个例子:
关闭。这个问题需要debugging details .它目前不接受答案。 编辑问题以包含 desired behavior, a specific problem or error, and th
如果我在 C# 中的 XElement myXML 变量中有以下 XML, myvalue 要获得“myvalue”,我需要执行以下操作: myXML.Element(
我找不到用户名和密码字段。我检查元素,并尝试通过 id、xpath 或 css 选择器查找它,但它给出错误 NoSuchElementException: Message: no such eleme
我的任务是在用户点击它时从输入框中删除占位符并使标签可见。如果用户未在其中再次填写任何内容,请放回占位符并使标签不可见。 我可以隐藏它但不能重新分配它。我试过 element.setAttribute
我正在编写一个 c# 类来编写一个 XML 文件,该文件需要与我们使用的现有 XML 的结构完全匹配,这样一些遗留系统就不会混淆。 当一个元素的InnerText值为null时,我需要xml元素的元素
自定义元素的一个常见做法,至少在 Polymer(最流行的 Web 组件框架)中,是定义一个新的自定义元素。恕我直言,这对 来说不是一个好习惯呈现 元素,因为该元素无法逐步呈现,必须等到它被加载(注册
我正在尝试跟踪元素的可见性及其显示的控制台错误:“元素“a[data-vars-ei]”必须是 AMP 元素”。 但是在点击跟踪的情况下,类似的事情工作正常。 我无法理解为什么会发生这种情况以及我应该
我是一名优秀的程序员,十分优秀!