# 44. `plugins.fe_post` — A class for holding results from Finite Element simulations.

class `plugins.fe_post.``FeResult`(name='__FePost__', datasize={'COORD': 3, 'S': 6, 'U': 3})

  Finite Element Results Database.

  This class can hold a collection of results from a Finite Element simulation. While the class was designed for the post-processing of Abaqus (tm) results, it can be used more generally to store results from any program performing simulations over a mesh.

  pyFormex comes with an included program postabq that scans an Abaqus .fil output file and translates it into a pyFormex script. Use it as follows:

      postabq job.fil > job.py

  Then execute the created script job.py from inside pyFormex. This will create an FeResult instance with all the recognized results.

  The structure of the FeResult class very closely follows that of the Abaqus results database. There are some attributes with general info and with the geometry (mesh) of the domain. The simulation results are divided in ‘steps’ and inside each step in ‘increments’. Increments are usually connected to incremental time and so are often the steps, though it is up to the user to interprete the time. Steps could just as well be different unrelated simulations performed over the same geometry.

  In each step/increment result block, individual values can be accessed by result codes. The naming mostly follows the result codes in Abaqus, but components of vector/tensor values are number starting from 0, as in Python and pyFormex.

  Result codes:

  - U: displacement vector
  - U0, U1, U2 : x, y, resp. z-component of displacement
  - S: stress tensor
  - S0 .. S5: components of the (symmetric) stress tensor:
      0..2 : x, y, z normal stress 3..5 : xy, yz, zx shear stress
  `Increment`(step, inc, **kargs)

    Add a new step/increment to the database.

    This method can be used to add a new increment to an existing step, or to add a new step and set the initial increment, or to just select an existing step/inc combination. If the step/inc combination is new, a new empty result record is created. The result record of the specified step/inc becomes the current result.

  `Export`()

    Align on the last increment and export results

  `do_nothing`(**kargs)

    A do nothing function to stand in for as yet undefined functions.

  `TotalEnergies`(**kargs)

    A do nothing function to stand in for as yet undefined functions.

  `OutputRequest`(**kargs)

    A do nothing function to stand in for as yet undefined functions.

  `Coordinates`(**kargs)

    A do nothing function to stand in for as yet undefined functions.

  `Displacements`(**kargs)

    A do nothing function to stand in for as yet undefined functions.

  `Unknown`(**kargs)

    A do nothing function to stand in for as yet undefined functions.

  `setStepInc`(step, inc=1)

    Set the database pointer to a given step,inc pair.

    This sets the step and inc attributes to the given values, and puts the corresponding results in the R attribute. If the step.inc pair does not exist, an empty results dict is set.

  `getSteps`()

    Return all the step keys.

  `getIncs`(step)

    Return all the incs for given step.

  `nextStep`()

    Skips to the start of the next step.

  `nextInc`()

    Skips to the next increment.

    The next increment is either the next increment of the current step, or the first increment of the next step.

  `prevStep`()

    Skips to the start of the previous step.

  `prevInc`()

    Skips to the previous increment.

    The previous increment is either the previous increment of the current step, or the last increment of the previous step.

  `getres`(key, domain='nodes')

    Return the results of the current step/inc for given key.

    The key may include a component to return only a single column of a multicolumn value.

  `printSteps`()

    Print the steps/increments/resultcodes for which we have results.