bdfInterface Package

BDF_Card Module

Inheritance diagram of pyNastran.bdf.bdfInterface.BDF_Card
class pyNastran.bdf.bdfInterface.BDF_Card.BDFCard(card=None, oldCardObj=None, debug=False)[source]

Bases: object

Is(cardName)[source]

Returns True if the card is of type cardName

Parameters:
  • self – the object pointer
  • cardName – the cardName to compare against
Returns:

IsACardName True/False

_wipeEmptyFields(card)[source]

Removes an trailing Nones from the card. Also converts empty strings to None.

Parameters:
  • self – the object pointer
  • card – the fields on the card as a list
Returns:

shortCard the card with no trailing blank fields

applyOldFields(cardCount=0)[source]

used for nastran = format

field(i, default=None)[source]

gets the ith field on the card

Parameters:
  • self – the object pointer
  • i – the ith field on the card (following list notation)
  • default – the default value for the field
Returns:

the value on the ith field

fields(i=0, j=None, defaults=None, debug=False)[source]

gets multiple fields on the card

Parameters:
  • self – the object pointer
  • i – the ith field on the card (following list notation)
  • j – the jth field on the card (None means till the end of the card)
  • defaults – the default value for the field (as a list) len(defaults)=i-j-1
  • debug – prints out the values at intermediate steps
Returns:

the values on the ith-jth fields

getOldField(i)[source]

used for nastran = format

isSameName()[source]

used for nastran = format

nFields()[source]

gets how many fields are on the card

Parameters:self – the object pointer
Returns:nFields the number of fields on the card
replaceExpression(fieldNew, fieldOld, replaceChar=u'=', replaceChar2=u'')[source]

used for nastran = format

pyNastran.bdf.bdfInterface.BDF_Card.wipeEmptyFields(card)[source]

Removes an trailing Nones from the card. Also converts empty strings to None.

Parameters:
  • self – the object pointer
  • card – the fields on the card as a list
Returns:

shortCard the card with no trailing blank fields

addCard Module

Inheritance diagram of pyNastran.bdf.bdfInterface.addCard
class pyNastran.bdf.bdfInterface.addCard.AddMethods[source]

Bases: object

addAEFact(aefact, allowOverwrites=False)[source]
addAEList(aelist)[source]
addAEParam(aeparam)[source]
addAEStat(aestat)[source]
addAESurf(aesurf)[source]
addASet(setObj)[source]
addAero(aero)[source]
addAeros(aero)[source]
addBSet(setObj)[source]
addCAero(caero)[source]
addCMethod(cMethod, allowOverwrites=False)[source]
addCSet(setObj)[source]
addConstraint(constraint)[source]
addConstraint_MPC(constraint)[source]
addConstraint_MPCADD(constraint)[source]
addConstraint_SPC(constraint)[source]
addConstraint_SPCADD(constraint)[source]
addConvectionProperty(prop)[source]
addCoord(coord, allowOverwrites=False)[source]
addCreepMaterial(material, allowOverwrites=False)[source]

Method addCreepMaterial:

Note

May be removed in the future. Are CREEP cards materials? They have an MID, but reference structural materials.

addDArea(darea, allowOverwrites=False)[source]
addDConstr(dconstr)[source]
addDDVal(ddval)[source]
addDEQATN(deqatn, allowOverwrites=False)[source]
addDMI(dmi, allowOverwrites=False)[source]
addDMIG(dmig, allowOverwrites=False)[source]
addDMIJ(dmij, allowOverwrites=False)[source]
addDMIJI(dmiji, allowOverwrites=False)[source]
addDMIK(dmik, allowOverwrites=False)[source]
addDResp(dresp)[source]
addDamperElement(elem, allowOverwrites=False)[source]

Warning

can dampers have the same ID as a standard element?

addDesvar(desvar)[source]
addDvmrel(dvmrel)[source]
addDvprel(dvprel)[source]
addElement(elem, allowOverwrites=False)[source]
addFLFACT(flfact)[source]
addFREQ(freq)[source]
addFlutter(flutter)[source]
addGUST(gust)[source]
addLSeq(load)[source]
addLoad(load)[source]
addMKAero(mkaero)[source]
addMassElement(elem, allowOverwrites=False)[source]
addMaterial(material, allowOverwrites=False)[source]

only for adding structural materials

Deprecated since version this: method will be renamed in v0.3 to addStructuralMaterial.

addMaterialDependence(material, allowOverwrites=False)[source]
addMethod(method, allowOverwrites=False)[source]
addNLParm(nlparm)[source]
addNode(node, allowOverwrites=False)[source]
addPAero(paero)[source]
addPHBDY(prop)[source]
addParam(param, allowOverwrites=False)[source]
addProperty(prop, allowOverwrites=False)[source]
addQSet(setObj)[source]
addRandomTable(table)[source]
addRigidElement(elem, allowOverwrites=False)[source]
addSPoint(spoint)[source]
addSet(setObj)[source]
addSetSuper(setObj)[source]
addSpline(spline)[source]
addStructuralMaterial(material, allowOverwrites=False)[source]
addSuport(suport)[source]
addTSTEP(tstep, allowOverwrites=False)[source]
addTSTEPNL(tstepnl, allowOverwrites=False)[source]
addTable(table)[source]
addThermalBC(bc, key)[source]
addThermalElement(elem)[source]

same as addElement at the moment...

addThermalLoad(load)[source]
addThermalMaterial(material, allowOverwrites=False)[source]
addTrim(trim, allowOverwrites=False)[source]

bdf_Reader Module

Inheritance diagram of pyNastran.bdf.bdfInterface.bdf_Reader
class pyNastran.bdf.bdfInterface.bdf_Reader.BDFReader(debug, log)[source]

Bases: object

_set_infile(bdf_filename, includeDir=None)[source]

Sets up the basic file/lines/cardCounting operations

Parameters:
  • self – the BDF object
  • bdf_filename – the input BDF filename
  • includeDir – the location of include files if an absolute/relative path is not used (not supported in Nastran)
close_file(debug=False)[source]

Closes the active file object. If no files are open, the function is skipped. This method is used in order to support INCLUDE files.

Parameters:
  • self – the object pointer
  • debug – developer debug
get_file_stats()[source]

gets information about the active BDF file being read

Parameters:self – the object pointer
Returns:lineNumber the active file’s line number
get_line_number()[source]

Gets the line number of the active BDF (used for debugging).

Parameters:self – the object pointer
Returns:returns the line number of the active BDF filename
get_next_line(debug=False)[source]

Gets the next line in the BDF

Parameters:
  • self – the BDF object
  • debug – developer debug
Returns:

line the next line in the BDF or None if it’s the end of the current file

open_file(infileName)[source]

Takes a filename and opens the file. This method is used in order to support INCLUDE files.

print_filename(filename)[source]

Takes a path such as C:/work/fem.bdf and locates the file using relative paths. If it’s on another drive, the path is not modified.

Parameters:
  • self – the object pointer
  • filename – a filename string
Returns:

filenameString a shortened representation of the filename

bdf_cardMethods Module

Inheritance diagram of pyNastran.bdf.bdfInterface.bdf_cardMethods
class pyNastran.bdf.bdfInterface.bdf_cardMethods.CardMethods(nCardLinesMax=1000)[source]

Bases: object

_get_card(debug=False)[source]

gets a single unparsed card

_get_multi_line_card(i, tempcard, isCSV=False, debug=False)[source]
_increaseCardCount(cardName)[source]

Used for testing to check that the number of cards going in is the same as each time the model is read verifies proper writing of cards

Warning

this wont guarantee proper reading of cards, but will help

_make_lines_pack(debug=False)[source]
expandTabCommas(line)[source]

The only valid tab/commas format in nastran is having the first field be a tab and the rest of the fields be separated by commas.

Parameters:
  • self – the object pointer
  • line – a BDF line
getValue(valueRaw, card, debug=False)[source]

converts a value from nastran format into python format.

isLargeField(card)[source]

returns True if the card is in 16-character width fields

parseDynamicSyntax(key)[source]

Applies the dynamic syntax for %varName

Parameters:
  • self – the object pointer
  • key – the uppercased key
Returns:

value the dynamic value defined by dictOfVars

Note

%varName is actually %VARNAME b/c of auto-uppercasing the string, so the setDynamicSyntax method uppercases the key prior to this step.

See also

see setDynamicSyntax()

processCard(tempcard, debug=False)[source]

takes a list of strings and returns a list with the proper value in the fields of the list

update_card_lines(lines)[source]

expands a card with tabs in it

pyNastran.bdf.bdfInterface.bdf_cardMethods.interpretValue(valueRaw, card=u'', debug=False)[source]

converts a value from nastran format into python format.

pyNastran.bdf.bdfInterface.bdf_cardMethods.make_single_streamed_card(log, card, debug=False)[source]

takes a card that has been split b/c it’s a multiline card and gets rid of the required blanks in it.

pyNastran.bdf.bdfInterface.bdf_cardMethods.nastran_split(log, line, isLargeField, debug=False)[source]

Splits a single BDF line into large field or small field format

Parameters:
  • self – the object pointer
  • line – the BDF line
  • a – flag indicating small/large field format (True/False)
  • debug – extra developer debug
Returns:

fields the 9 (small) or 5 (large) fields for the line

Note

CSV Format is handled by parse_csv

Note

tabs are handled prior to running this

pyNastran.bdf.bdfInterface.bdf_cardMethods.parse_csv(sline)[source]
pyNastran.bdf.bdfInterface.bdf_cardMethods.stringParser(stringIn)[source]

not used

bdf_writeMesh Module

crossReference Module

Inheritance diagram of pyNastran.bdf.bdfInterface.crossReference
class pyNastran.bdf.bdfInterface.crossReference.XrefMesh[source]

Bases: object

Links up the various cards in the BDF.

The main BDF class defines all the parameters that are used.

_cross_reference_aero()[source]

Links up all the aero cards

_cross_reference_constraints()[source]

Links the SPCADD, SPC, SPCAX, SPCD, MPCADD, MPC cards.

_cross_reference_coordinates()[source]

Links up all the coordinate cards to other coordinate cards and nodes

_cross_reference_elements()[source]

Links the elements to nodes, properties (and materials depending on the card).

_cross_reference_loads()[source]

Links the loads to nodes, coordinate systems, and other loads.

_cross_reference_materials()[source]

Links the materials to materials (e.g. MAT1, CREEP) often this is a pass statement

_cross_reference_nodes()[source]

Links the nodes to coordinate systems

_cross_reference_properties()[source]

Links the properties to materials

crossReference(xref=True)[source]

See also

see cross_reference()

cross_reference(xref=True)[source]

Links up all the cards to the cards they reference

getCard Module