bdfInterface Package¶
BDF_Card Module¶
-
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
-
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
-
addCard Module¶
-
class
pyNastran.bdf.bdfInterface.addCard.AddMethods[source]¶ Bases:
object-
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.
-
addDamperElement(elem, allowOverwrites=False)[source]¶ Warning
can dampers have the same ID as a standard element?
-
bdf_Reader Module¶
-
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
-
bdf_cardMethods Module¶
-
class
pyNastran.bdf.bdfInterface.bdf_cardMethods.CardMethods(nCardLinesMax=1000)[source]¶ Bases:
object-
_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
-
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.
-
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()
-
-
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
bdf_writeMesh Module¶
crossReference Module¶
-
class
pyNastran.bdf.bdfInterface.crossReference.XrefMesh[source]¶ Bases:
objectLinks up the various cards in the BDF.
The main BDF class defines all the parameters that are used.
-
_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_materials()[source]¶ Links the materials to materials (e.g. MAT1, CREEP) often this is a pass statement
-