How to request nodal stress output in ABAQUS Pytho

2019-08-12 05:26发布

I need nodal stresses in the odb. I am aware that I can simply generate a query in the visualization module and therefore can obtain the averaged nodal stress (which I dont think will be of use as its performed after the analysis and I cannot do that in the odb as there is no nodal information for stresses). I can also edit the input file and use Position = NODES in the element output and then running the analysis by calling the input file as source. It generates stresses with nodal data and then every node has multiple stress values corresponding to every element. I have also averaged out those values in the script as its done in the visualization module. But now I need to automate this script for multiple simulations and the only place I am stuck is the to request the nodal output for the next iteration. I dont know whats an equivalent python command for Position = NODES which is written in the input file. I cannot keep calling the same input file as my nodal position for the next simulation is different that earlier model. Any thoughts on how do I go about it?

1条回答
我命由我不由天
2楼-- · 2019-08-12 05:40

Here's an example scripting the keyword editor. The trick to it is you need to search for an existing keyword and insert your new text before or after that.

model.keywordBlock.synchVersions()
def GetBlockPosition(model,blockPrefix):
 pos = 0
 for block in model.keywordBlock.sieBlocks:
  if string.lower(block[0:len(blockPrefix)])==string.lower(blockPrefix):return pos
  pos=pos+1
 return -1
model.keywordBlock.insert(GetBlockPosition(model,'*Restart')-1, """
*EL FILE,POSITION=AVERAGED AT NODES
S
""")

Do this as the very last thing before creating/submitting the job.

查看更多
登录 后发表回答