简体   繁体   中英

How to update nodal value of Abaqus odb file using python script?

I want to update nodal values of an existing Abaqus odb file using python script. I already have new nodal valued, but don't how to put them into odb file instead of previous data.

I might be wrong about this, but there is no way of calling some method to replace the existing values in the odb. What you can do, though, is to create a new step and frame (or just a frame in an existing step) and then create a new field output object with the new values.

If you can live with this approach, check documentation for FieldOutput object. You would probably do something like this:

odb = session.odbs['yourOdbName']
instance = odb.rootAssembly.instances['nameOfYourInstance']

field_output = odb.steps['stepName'].frames[frameId].FieldOutput(
    name='DefineTheName', description='WhatItRepresents',
    type=SCALAR # or whatever other type you need
)

field.addData(
    position=NODAL, instance=instance, labels=your_node_labels,
    data=your_data
)

After you're done with this, or even better before, try calling the following:

odb = session.odbs['yourOdbName']
del odb.steps['stepWithResults'].frames[frameId].fieldOutputs['variableName']

This is a wild guess but it might work. If it does, you can simply delete the existing field output, create a new one and then save the odb.

Whatever you choose, make sure not to open odb in read-only mode and save the odb and then open it because probably nothing will be visible in the current session.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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