# Python or Ruby post-processing scripts for Nastran or Samcef

A Library distributed under LGPL license that allows you to automate the post-processing of Nastran and Samcef  finite element results

FeResPost library

A library that allows you to read Nastran and Samcef finite element models and results, and to automate post-processing operations.

Depending on the programming language being used (Ruby, Python, VBA...), FeResPost allows to program a wide variety of programs ranging from small scripts to large programs containing user-defined Classes and Modules, and allow to perform complex operations.

(The scripting capability of FeResPost can be very useful to automate simple tasks as automating the creation of connections, modifying element properties, creating temperature or force fields...)

Purpose of FeResPost

FeResPost is a library that allows the rapid development of small programs to be used to automate the post-processing of structural analysis finite element results.

Structural analysis

The structure analysis of complex structures often leads to repetitive tasks. This is related to :

  1. The nature of the structure that is being analysed. Identical or similar components are often present several times, and sometimes many times, in the same structure (beams, panels, interfaces, connections...). These different parts or components are generally justified exactly the same way, and the corresponding calculation is often automated (with a programming language, excel...).

  2. A structure is rarely sized for a single event, or checked again a single requirement. Generally, for static analysis, numerous load case are defined to ensure that the structure's strength is sufficient to sustain severel events in its life. This means that for each component, or each type of failure mode, the calculations is often done as many times as the number of defined load cases.

  3. During the development of the structure, the design will be updated several times. Sometimes, several versions of a structure may be justified simultaneously, or consecutively. (Think, for example, at the different versions of the B737 Boeing  or A320 Airbus planes that are flying nowadays.) This also contribute to the repititiveness of structural analysis calculations.

This explains why engineers involved in structural analysis are often also programmers. The need for automation leads them to use spreadsheets, use third party programs to accelerate the justification, or write its own post-processing programs. FeResPost can help in the development of these small programs!

How we can help?

The main purpose of the program is to download and manipulate Result entities in order to calculate margins of safety. Possible operations that can be performed on ``Result'' objects are, for example :

So far, these results can be read from Nastran XDB or OP2 files, or from Samcef DES/FAC files. The corresponding finite element models can also be important from Nastran Bulk BDF files, or Samcef Bacon DAT files.

The groups of elements and nodes can be read from Samcef DAT or Patran session files. Manipulation of these Groups, by addition, substraction, intersection, associations are possible.

FeResPost allows the simultaneous manipulation of several models by defining several NastranDb  and SamcefDb objects, and different Nastran and Samcef models can be manipulated simultaneously.

FeResPost also allows the calculation of composite structure by providing severeal classes for the Classical Laminate Analysis (CLA). Among other things, the CLA classes of FeResPost allow to :

The CLA classes can be used separately from the finite element results, but also used together with  finite element results. This allows for example to:

Classes and Modules

The library provides an access to 7 classes and 2 module allowing the manipulation of FE entities and results. The 7 classes are :

The ``Post'' module gives access to several additional functions.

Four classes used to perform Classical Laminate Analysis calculations are also provided:

The CLA classes are interfaced with the rest of FeResPost and allow to post-process very efficiently composite finite element Results.

The program is mainly written in C++, and the ruby extension is build as a wrapping around a C++ library. This solution ensures that the program is easy to manage and that the program remains efficient because costly operations are done at C++ level (compiled language efficiency).


FeResPost is distributed as a LGPL resource. This means that it is free, and that you can modify and re-distribute it gratis as long as you comply with ther therms of the LGPL license. (These are given in an Appendix of the User Manual. See below.)


System requirements


So far, Results of Nastran and Samcef solvers can be post-processed.


Finite element models can be read either from a BDF (bulk data file), or an op2 file. Groups can be build by reading Patran sessions files obtained with the utilities of Patran.

Results can be read from OP2 or XDB files. The most commonly used types of elements are supported. For XDB files, it is also possible to extract results by random access (XDB attachment).


Finite element models can be read from a dat file obtained by a ".sauve banque" Bacon command.

Results can be read or accessed randomly from DES/FAC files.

Operating systems and programming languages

The library is distributed as a ruby extension (LINUX and Windows), as a COM component (Windows only) and as a .NET assembly (Windows only).  In order to use FeResPost you need to install first one of the corresponding programming languages :

  • Ruby if you wish to use the ruby extension. (Binaries are distributed for Linux and Windows operating systems, but a recompilation of the sources allow the installation of FeResPost on other OSs.)

  • Python compiled libraries are also distributed. For some language versions/OS combinations, you might need to compile it yourself.

  • The COM component can be used with many languages, but on Windows OS only. Tests have been done with Ruby, Python, C++, VBA (in excel). Other languages like C, Java should also be capable of using the COM component.

  • All the .NET languages should be able to use the .NET assembly. This includes VB.NET, IronRuby, Java.NET, C#. Tests have been done with C# language only. (See the examples.)

The programming language in which all those operations are programmed is object oriented and allows the development of very sophisticated and large post-processing programs, or very small tools, according to the wishes of the programmer.

Other resources

Besides the installation of the programming language you wish to use, a few other programs may help you to develop scripts using FeResPost. The examples distributed on this web site and discussed in the User Manual sometimes assume that thos programs have been installed on your computer. For example:



Latest version is version 4.4.2!


An online HTML manual is available, but we advise to download the PDF version :

The manual presents the different classes defined in FeResPost library, with the associated properties and methods. It also illustrates the use of different FeResPost objects with examples. (See below.)


One distributes two archives containing the examples. (The content of these two files are the same.)

The examples contain a small satellite Nastran finite element model, and numerous post-processing examples :

Some of these examples are very small and illustrate simple extraction of results from XDB or OP2 files, with a very limited number of manipulations. But one also proposes examples corresponding to entire post-processing projects that could be used readily in a real project. (These examples are provided as Ruby programs, or in excel workbooks.)

One suggest however, that the user reads the examples in the order in which they are defined, starting with the ruby examples, as this is the only way to really understand the use of FeResPost objects.


As FeResPost is distributed under the LGPL license, the sources are also distributed for re-compilation or modification and re-distribution :

Binaries and older versions

Binaries are distributed for several versions of FeResPost and include ruby extensions for Linux and Windows, COM component for Windows, and a .NET assembly. The FeResPost C++ library is also distributed for latest versions, but one recommends to use static linking for your own programs and to recompile yourself the FeResPost classes.

Sources of FeResPost are distributed for the different published versions of the library. These include the C/C++ sources, the examples, and possibly the PDF manual.

Third party contributions

One also distributes a third-party contribution, but without any support :


Mailing lists

You can visit or subscribe to FeResPost Google group :

Subscribe to FeResPost Group

E-mail :

Visit this group

If you have a question to ask, a bug to report, we would appreciate that you do it via FeResPost google group, so that others can benefit of your remarks as well.

Examples of Scripts Using FeResPost (Python, Ruby, VBA, C#,...)

Examples of Scripts Using FeResPost



Examples with Ruby


Ruby script for reading Nastran BDF file


Examples with Python


Python script for reading Nastran BDF file


Python script for the manipulation of Groups


Examples with VBA

Examples with C#


More information on this example, and the manual explaining the functions used in this example are given in FeResPost Reference Manual.



FeResPost Home Page



Bonjour le monde Bonjour le monde Bonjour le monde Bonjour le monde Bonjour le monde Bonjour le monde Bonjour le monde