Return to examples


A Ruby script that reads Nastran HDF file

 

 

Purpose of the script

 

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

 

Script

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 Nastran Results access from HDF file are


 

References

 

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

 


 

FeResPost Home Page

 

ferespost_gg.gif