A Ruby script that reads Nastran HDF file

Purpose of the script

The script illustrates the reading of Nastran Results from an HDF file.

Script

Ruby
require "FeResPost"
include FeResPost
require "../UTIL/util"

Post.loadHDFLibrary("C:/NewProgs/HDF/HDF-1.8.20-win32/bin/HDF.dll")
#~ Post.loadHDFLibrary("C:/NewProgs/HDF/HDF-1.8.20-win64/bin/HDF.dll")

dirName="D:/SHARED/FERESPOST/TESTSAT/MODEL/EXEC_HDF"

baseName="unit_xyz"

lcIndex=0
scIndex=0

bdfName=format("%s/%s.dat",dirName,baseName)
hdfName=format("%s/%s.h5",dirName,baseName)
xdbName=format("%s/%s.xdb",dirName,baseName)

db=NastranDb.new()
db.readBdf(bdfName)

db.attachHdf(hdfName)

lcNames=db.getHdfAttachmentLcNames(hdfName)
lcName=lcNames[lcIndex]
scNames=db.getHdfAttachmentScNames(hdfName,lcName)
scName=scNames[scIndex]
resNames=db.getHdfAttachmentResNames(hdfName,lcName)
hdfResNames=resNames.clone

db.readHdfAttachmentResults(hdfName,lcName,scName,resNames)


...

Explanation

The different steps of the access to Nastran results from an HDF file are:

References

More information on this example, and on the functions it uses, is given in the FeResPost User Manual.

← Back to the examples