title: Abaqus: Creating a new FieldOutput (format?)
body: <p>Been struggling with following: I want to create a new FieldOutput (lets say some simple aritmetic operation with the tensors) for a given el. set. Not the whole model as this would be too costly and Im interested in that particular area/set anyway.</p>
  
  <p>I open an odb with the results....</p>
  
  <pre><code>from abaqus import *
  from odbAccess import *
  from abaqusConstants import *
  import visualization
  import fileinput
  import os
  
  # to make prettyPrint work!
  from odbAccess import *
  from textRepr import *
  
  # open odb
  odb_path="analysis45.odb"
  my_odb=session.openOdb(name=odb_path,readOnly=FALSE)
  </code></pre>
  
  <p>Some substitutions that assure that it always opens the step/instance no matter what their name is...</p>
  
  <pre><code># automate the proces of reading the step no matter what its name is
  StepNames=(my_odb.steps.keys() )        #   it is a list of all step names
  lastStep=( StepNames[-1] )  
  
  # automation of an instance naming (in the same way)
  NaseInstance = (my_odb.rootAssembly.instances.keys())
  MojeInstance = ( NaseInstance[-1] ) 
  CelaMojeInstance=my_odb.rootAssembly.instances[MojeInstance]
  </code></pre>
  
  <p>Found somebody elses way to calculate new data and stuff them into a new scalar here: <a href="https://gist.github.com/crmccreary/5015483" rel="nofollow noreferrer">https://gist.github.com/crmccreary/5015483</a> I am, though, not successful in understanding what exactly happens there as this script is much more complicated and Im not a programmer at all.</p>
  
  <p>Tried to simplify the task by hard-prescribing some value directly to the field (with the intention to replace this by a function later on and finally to loop over the whole elset this way). Im getting a message regarding <strong>"illegal argument type for built-in operation"</strong> form which I assume that the format of the data Im trying to insert is not correct. Tried the documentation w/o success. May I ask for a hint/help? Thanks!</p>
  
  <pre><code>NewField =my_odb.steps[lastStep].frames[0].FieldOutput(name='New_scalar_field',description='Our brand new scalar field', type=SCALAR)
  NewField.addData(position=NODAL, instance=CelaMojeInstance, labels=[1657, 1658, 1683, 1684, 14193, 14194, 14195, 14196], data=[(6),(12),(6),(12),(6),(12),(6),(12)])
  
  my_odb.save()
  my_odb.close()
  </code></pre>
  
  <p>This guys solution seems to be quite the same to the mine: <a href="http://abaqus-users.1086179.n5.nabble.com/Writing-Results-to-Existing-ODB-file-td21750.html" rel="nofollow noreferrer">http://abaqus-users.1086179.n5.nabble.com/Writing-Results-to-Existing-ODB-file-td21750.html</a></p>
  
  <p>I understand that the question may be too trivial or too silly for seniors, sorry about that.</p>