Other Examples

FeResPost User Manual presents many examples that illustrate the capabilities of FeResPost libraries. We list below some examples of what can be done, with references to the corresponding pages of FeResPost online HTML manual.

The capabilities that are discussed here can be used with languages like Ruby, Python, C#, C, C++, VBA (Excel). However, the examples referred to in this document are often written in Ruby.

Reading of Nastran models, BDF cards...


Reading a Nastran finite element model from a bulk data file (BDF) is done with the "readBdf" method of the "NastranDb" class. The method is illustrated with an example here. Other methods allow you to read BDF files, or manipulate Nastran BDF cards:

Some of the methods discussed above show that FeResPost can be used as a simple Nastran card reader or formatter. This can be done from the different languages listed above.

Reading of Nastran results

Results can be read from Nastran OP2 files, Nastran XDB files and Nastran HDF5 files (with "h5" extension). In the case of XDB and HDF5 files, random access is possible, but a simple import of the results into the database also works.

The extraction of results is possible from different programming languages (Ruby, Python, VBA in Excel, C#, C, C++...). FeResPost is not only used to extract results: it also allows you to manipulate them. For example:

You should read the description of the Result class for more information on the post-processing capabilities. Examples are also provided to illustrate the different capabilities.

Extracting "raw" information from Nastran XDB files


An extraction of “raw” results from XDB files is also possible thanks to the “each_xdbRaw” and “each_xdbBinRaw” iterators and to the “binDataToValues” method presented here.


FeResPost does not propose the same capability for HDF5 files, because many programming languages, such as Python and Ruby, provide extensions that perform this kind of operation.

The OP2 file can only be read sequentially and FeResPost proposes no method for “raw” access to its content. Note, however, that the model can be read from the OP2 file.

Using FeResPost with Samcef solver


The Samcef solver is also supported by FeResPost, which allows you to:

And in general, most of the manipulations that are possible for Nastran models and results are also possible with Samcef. This is true for the different programming languages like Ruby, Python, C#, C and C++ (COM component on Windows) and VBA (in Excel, for example).

Composite calculations

The FeResPost library performs composite calculations:

These calculations can be done in a "discrete manner" from the supported programming languages (see above), but are also nicely integrated with the FEM "Result" class to perform batch calculations.

The composite manual is accessible here. Several examples are provided in the manual, in chapters IV.3 and VII.2.

← Back to the examples