Abaqus Python Scripting - Create ODB without submitting Job
Question: I'm looking to create a simple ODB file using my model in session so that I
can display an orientation tensor in a custom field. I'm able to create an ODB
for a 2d part (made of s4 elements), but my system crashes whenever I load the
ODB for my 3d part (made of c3d8 elements).

Here is my script. Any help would be greatly appreciated!

    
    
    from abaqusConstants import * 
    from odbAccess import *
    from textRepr import *
    
    odb = Odb(name='4',
        analysisTitle='derived data',
        description='test problem',
        path='4.odb')
    
    sCat = odb.SectionCategory(name='solid', 
        description='Test')
    
    part1 = odb.Part(name='part-1',embeddedSpace=THREE_D, type=DEFORMABLE_BODY)
    
    nodeData = [(1, -5.0, -5.0, 10.0), (2, -5.0, 5.0, 10.0), (3, -5.0, -5.0, 0.0), (4, -5.0, 5.0, 0.0), (5, 5.0, -5.0, 10.0), (6, 5.0, 5.0, 10.0), (7, 5.0, -5.0, 0.0), (8, 5.0, 5.0, 0.0)]
    part1.addNodes(nodeData=nodeData, nodeSetName='nset-1') 
    
    elementData = [(1, 4, 5, 7, 6, 0, 1, 3, 2)]
    part1.addElements(elementData=elementData, type='C3D8',
        elementSetName='eset-1', sectionCategory=sCat)
    
    assembly = odb.rootAssembly
    instance1 = assembly.Instance(name='part-1-1', object=part1)
    
    # An element set on an instance
    eLabels = [1]
    elementSet = instance1.ElementSetFromElementLabels(
        name='eall',elementLabels=eLabels)
    # A node set on the rootAssembly
    instance1.NodeSetFromNodeLabels('nall', (1,2,3,4,5,6,7,8))
    
    step1 = odb.Step(name='step-1', description='', domain=TIME, timePeriod=1.0)
    frame1 = step1.Frame(incrementNumber=1, frameValue=0.1, description='')
    fieldout = frame1.FieldOutput(name="FO", description="Fiber Orientation Data", type=TENSOR_3D_FULL, isEngineeringTensor=TRUE, validInvariants=[MAX_PRINCIPAL,])
    elist = [1]
    strs = [[0.72539, 0.19255, 0.082066, -0.12808, -0.1158, 0.042058]]
    fieldout.addData(position=CENTROID, instance=instance1, labels=elist, data=strs)
    
    odb.save()
    odb.close()
    


Answer: In your command "odb= Odb(...)", I think there is a problem. Odb(...) method
is a member of session object, so I would modify the code like the following:

    
    
    odb=session.Odb(name='4',analysisTitle='derived data', description='test  problem,path='C:\temp\4.odb')
    

Also, note the file location where you want to create. It is a good practice
to write the complete file path.

