Return to examples

 

A Python script To extract information from Nastran XDB file

 

 

Purpose of the script

 

The script illustrates the extraction of information from Nastran XDB file.

 

Script

import sys
sys.stdout=open(__file__+".log", 'w')

from FeResPost import *
import sys

sys.path.insert(0, '../UTIL')
import Util

# Creates and initializes the DataBase :

db=NastranDb()
db.Name="tmpDB"
db.readBdf("../../MODEL/MAINS/unit_xyz.bdf")
db.readGroupsFromPatranSession("../../MODEL/PATRAN/groups.ses")
   
# Accessing Results :

xdbFileName="../../MODEL/EXEC_XDB/sol111_ri_xyz.xdb"

db.attachXdb(xdbFileName)

infos=db.getAttachmentLcInfos(xdbFileName)
for tab in infos:
    sys.stdout.write("%-20s %-25s %-6d %-6d %-15g %-15g\n"%(tab[0],tab[1],tab[3],tab[4],tab[5],tab[6]))

resNames=db.getAttachmentResNames(xdbFileName)
for resName in resNames:
    sys.stdout.write("%-20s\n"%(resName))

 

Explanation

 

The different steps of the Nastran FEM importation 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