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:
- The “each_bdf” iterator
in NastranDb class iterates on
the BDF cards read from one or several BDF files (if include statements are considered). The method is presented here.
- Methods “writeBdfLines”, “writeNastranCard”, “writeNastranCards, “writeNastranCardToVectStr”, “writeNastranCardsToVectStr” in NastranDb can be used to write BDF
cards. These methods are discussed here.
- Methods allow the
extraction of BDF cards corresponding to FEM entities stored in the NastranDb database. For
example, “fillCard” and “fillCards” methods are discussed here.
In the same section, we explain how the finite element model can be modified by inserting new BDF cards into the NastranDb database.
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:
- Modify the reference coordinate system in which vectorial or tensorial result components are expressed.
- Derive other kinds of results (magnitude of vectors, Von Mises stress, eigen-values, interface global forces and moments...)
- Perform CLA (Classical Laminate Analysis) calculations.
- Extract maximum or minimum values.
- Remap results from element centers to nodes, from element corners to centers,...
- Perform operations that involve several
results (additions, subtractions, multiplications, merging of results...)
- Manipulate complex results in
real-imaginary or magnitude-phase format.
- ...
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.
Using FeResPost with Samcef solver
The Samcef solver is also supported by FeResPost, which allows you to:
- Build a "SamcefDb" database by reading a
Samcef model (banque file obtained with the ".sauve banque" Bacon command).
- Import additional groups from a Patran session file containing the definition of groups.
- Read results, or access them randomly, from DES & FAC result files.
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:
- Calculation of laminate properties from the laminate and material definitions.
- Calculation of laminate load response considering mechanical, thermoelastic and hygroelastic contributions.
- Calculation of failure criteria.
- ...
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.