pyNastran/bdf

This is the pyNastran.bdf.rst file.

bdf Module

Inheritance diagram of pyNastran.bdf.bdf

Main BDF class. Defines:
  • BDF
class pyNastran.bdf.bdf.BDF(debug=True, log=None)[source]

Bases: pyNastran.bdf.bdf_Methods.BDFMethods, pyNastran.bdf.bdfInterface.getCard.GetMethods, pyNastran.bdf.bdfInterface.addCard.AddMethods, pyNastran.bdf.bdfInterface.bdf_writeMesh.WriteMesh, pyNastran.bdf.bdfInterface.crossReference.XrefMesh, pyNastran.bdf.bdfInterface.attributes.BDFAttributes

NASTRAN BDF Reader/Writer/Editor class.

Attributes

Methods

Initializes the BDF object

Parameters:
  • self – the BDF object
  • debug – used to set the logger if no logger is passed in True: logs debug/info/error messages False: logs info/error messages None: logs error messages
  • log – a python logging module object; if log is set, debug is ignored and uses the settings the logging object has

Attributes

Methods

AEFact(aefact, msg=u'')
AEList(aelist, msg=u'')
AEParam(aid, msg=u'')
AEStat(aid, msg=u'')
Aero(acsid, msg=u'')
Aeros(acsid, msg=u'')
CAero(eid, msg=u'')
CMethod(sid, msg=u'')
Coord(cid, msg=u'')
DConstr(oid, msg=u'')
DDVal(oid, msg=u'')
DLoad(sid, msg=u'')
DMIG(dname, msg=u'')
Desvar(oid, msg=u'')
Element(eid, msg=u'')
Elements(eids, msg=u'')
FLFACT(sid, msg=u'')
Flfact(sid, msg)

Deprecated since version will: be removed in version 0.8

Flutter(fid, msg=u'')
Gust(sid, msg=u'')
HyperelasticMaterial(mid, msg=u'')
Load(sid, msg=u'')
Mass()

See also

mass

MassProperties()

See also

mass_properties

Material(mid, msg=u'')
Materials(mids, msg=u'')
Method(sid, msg=u'')
NLParm(nid, msg=u'')
Node(nid, allowEmptyNodes=False, msg=u'')
Nodes(nids, allowEmptyNodes=False, msg=u'')

Returns a series of node objects given a list of node IDs

PAero(pid, msg=u'')
Phbdy(pid, msg=u'')
Properties(pids, msg=u'')
Property(pid, msg=u'')
PropertyMass(pid, msg=u'')
RandomTable(tid, msg=u'')
RigidElement(eid, msg=u'')
SPC(conid, msg=u'')
Set(sid, msg=u'')
SetSuper(seid, msg=u'')
Spline(eid, msg=u'')
StructuralMaterial(mid, msg=u'')
Table(tid, msg=u'')
ThermalMaterial(mid, msg=u'')
add_AEFACT(aefact, allowOverwrites=False)
add_AELIST(aelist)
add_AEPARM(aeparam)
add_AERO(aero)
add_AEROS(aero)
add_AESTAT(aestat)
add_AESURF(aesurf)
add_ASET(set_obj)
add_BCRPARA(card, allowOverwrites=False)
add_BCTADD(card, allowOverwrites=False)
add_BCTPARA(card, allowOverwrites=False)
add_BCTSET(card, allowOverwrites=False)
add_BSET(set_obj)
add_BSURF(card, allowOverwrites=False)
add_BSURFS(card, allowOverwrites=False)
add_CAERO(caero)
add_CSET(set_obj)
add_DAREA(darea, allowOverwrites=False)
add_DCONSTR(dconstr)
add_DDVAL(ddval)
add_DEQATN(deqatn, allowOverwrites=False)
add_DESVAR(desvar)
add_DMI(dmi, allowOverwrites=False)
add_DMIG(dmig, allowOverwrites=False)
add_DMIJ(dmij, allowOverwrites=False)
add_DMIJI(dmiji, allowOverwrites=False)
add_DMIK(dmik, allowOverwrites=False)
add_DRESP(dresp)
add_DVMREL(dvmrel)
add_DVPREL(dvprel)
add_FLFACT(flfact)
add_FLUTTER(flutter)
add_FREQ(freq)
add_GUST(gust)
add_LSEQ(load)
add_MKAERO(mkaero)
add_NLPARM(nlparm)
add_NLPCI(nlpci)
add_PAERO(paero)
add_PARAM(param, allowOverwrites=False)
add_PBUSHT(prop, allowOverwrites=False)
add_PDAMPT(prop, allowOverwrites=False)
add_PELAST(prop, allowOverwrites=False)
add_PHBDY(prop)
add_QSET(set_obj)
add_SESET(set_obj)
add_SET(set_obj)
add_SPLINE(spline)
add_SPOINT(spoint)
add_TRIM(trim, allowOverwrites=False)
add_TSTEP(tstep, allowOverwrites=False)
add_TSTEPNL(tstepnl, allowOverwrites=False)
add_card(card_lines, card_name, comment=u'', is_list=True)[source]

Adds a card object to the BDF object.

Parameters:
  • self – the BDF object
  • card_lines – the list of the card fields
  • card_name – the card_name -> ‘GRID’
  • comment – an optional the comment for the card
  • is_list – changes card_lines from a list of lines to a list of fields
Returns card_object:
 

the card object representation of card

 >>> model = BDF()

 # is_list is a somewhat misleading name; is it a list of card_lines?
 # where a card_line is an unparsed string
 >>> card_lines =['GRID,1,2']
 >>> comment = 'this is a comment'
 >>> model.add_card(card_lines, 'GRID', comment, is_list=True)

 # here is_list=False because it's been parsed
>>> card = ['GRID', 1, 2,]
 >>> model.add_card(card_lines, 'GRID', comment, is_list=False)

Note

this is a very useful method for interfacing with the code

Note

the card_object is not a card-type object...so not a GRID card or CQUAD4 object. It’s a BDFCard Object. However, you know the type (assuming a GRID), so just call the mesh.Node(nid) to get the Node object that was just created.

add_cmethod(cMethod, allowOverwrites=False)
add_constraint(constraint)
add_constraint_MPC(constraint)
add_constraint_MPCADD(constraint)
add_constraint_SPC(constraint)
add_constraint_SPCADD(constraint)
add_convection_property(prop)
add_coord(coord, allowOverwrites=False)
add_creep_material(material, allowOverwrites=False)

Note

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

add_damper(elem, allowOverwrites=False)

Warning

can dampers have the same ID as a standard element?

add_dload(dload)
add_dload_entry(dload)
add_element(elem, allowOverwrites=False)
add_hyperelastic_material(material, allowOverwrites=False)
add_load(load)
add_mass(mass, allowOverwrites=False)
add_material_dependence(material, allowOverwrites=False)
add_method(method, allowOverwrites=False)
add_node(node, allowOverwrites=False)
add_property(prop, allowOverwrites=False)
add_property_mass(prop, allowOverwrites=False)
add_random_table(table)
add_rigid_element(elem, allowOverwrites=False)
add_structural_material(material, allowOverwrites=False)
add_suport(suport)
add_table(table)
add_thermal_BC(bc, key)
add_thermal_element(elem)

same as add_element at the moment...

add_thermal_load(load)
add_thermal_material(material, allowOverwrites=False)
auto_reject_bdf(infile_name)

This method parses supported cards, but does not group them into nodes, elements, properties, etc.

Todo

maybe add the write method

card_count = None

list of all read in cards - useful in determining if entire BDF was read & really useful in debugging

cards_to_read = None

the list of possible cards that will be parsed

case_control_lines = None

list of case control deck lines

coordIDs()

deprecated

coord_ids
create_card_object(card_lines, card_name, is_list=True)[source]
cross_reference(xref=True, xref_elements=True, xref_properties=True, xref_materials=True, xref_loads=True, xref_constraints=True, xref_aero=True)

Links up all the cards to the cards they reference

Parameters:
  • xref – cross references the model (default=True)
  • xref_element – set cross referencing of elements (default=True)
  • xref_properties – set cross referencing of properties (default=True)
  • xref_materials – set cross referencing of materials (default=True)
  • xref_loads – set cross referencing of loads (default=True)
  • xref_constraints – set cross referencing of constraints (default=True)
  • xref_aero – set cross referencing of CAERO/SPLINEs (default=True)

To only cross-reference nodes:

model = BDF()
model.read_bdf(bdf_filename, xref=False)
model.cross_reference(xref=True, xref_loads=False, xref_constraints=False,
                                 xref_materials=False, xref_properties=False,
                                 xref_aero=False, xref_masses=False)

Warning

be careful if you call this method

debug = None

useful in debugging errors in input

disable_cards(cards)[source]

Method for removing broken cards from the reader

Parameters:
  • self – the BDF object
  • cards – a list/set of cards that should not be read
echo_bdf(infile_name)

This method removes all comment lines from the bdf A write method is stil required.

Todo

maybe add the write method

model = BDF()
model.echo_bdf(bdf_filename)
elementIDs()

deprecated

element_ids
executive_control_lines = None

list of execive control deck lines

getElementIDsWithPID(pid)

Gets all the element IDs with a specific property ID

Parameters:pid – property ID
Returns elementIDs:
 as a list

Deprecated since version will: be removed in version 0.8

The same functionality may be used by calling
>>> self.getElementIDsWithPIDs([pid], mode='list')
getElementIDsWithPIDs(pids, mode='list')

deprecated

getMaterialIDToPropertyIDsMap()

deprecated

getNodeIDToElementIDsMap()

deprecated

getNodeIDsWithElement(eid)

deprecated

getNodeIDsWithElements(eids, msg='')

deprecated

getNodes()

deprecated

getPropertyIDToElementIDsMap()

deprecated

get_bdf_stats(return_type=u'string')[source]

Print statistics for the BDF

Parameters:self – the BDF object

Note

if a card is not supported and not added to the proper lists, this method will fail

get_coord_ids()
get_dload_entries(sid, msg=u'')
get_element_ids()

deprecated

get_element_ids_dict_with_pids(pids)

Gets all the element IDs with a specific property ID.

Parameters:
  • self – the BDF object
  • pids – list of property ID
Returns element_ids:
 

as a dictionary of lists by property

For example, we want all the elements with pids=[4, 5, 6], but we want them in separate groups

model = BDF()
model.read_bdf(bdf_filename)
pids = [4, 5, 6]
eids_dict = model.get_element_ids_with_pids(pids, mode='dict')
get_element_ids_list_with_pids(pids)

Gets all the element IDs with a specific property ID.

Parameters:
  • self – the BDF object
  • pids – list of property ID
Returns element_ids:
 

as a list

For example, we want to get all the element ids with pids=[1, 2, 3]

model = BDF()
model.read_bdf(bdf_filename)
pids = [1, 2, 3]
eids_list = model.get_element_ids_with_pids(pids, mode='list')
get_material_id_to_property_ids_map()

Returns a dictionary that maps a material ID to a list of properties

Returns mid_to_pids_map:
 the mapping
>>> mid_to_pid_map = get_material_id_to_property_ids_map()
>>> mid = 1
>>> pids = get_material_id_to_property_ids_map[mid]
>>> pids
[1, 2, 3]

Note

all properties require an mid to be counted (except for PCOMP, which has multiple mids)

get_material_ids()
get_ncaeros()
get_nelements()

deprecated

get_nnodes()

deprecated

get_node_id_to_element_ids_map()

Returns a dictionary that maps a node ID to a list of elemnents

Todo

support 0d or 1d elements

Todo

support elements with missing nodes (e.g. CQUAD8 with missing nodes)

get_node_ids()

deprecated

get_node_ids_with_element(eid, msg=u'')
get_node_ids_with_elements(eids, msg=u'')

Get the node IDs associated with a list of element IDs

Parameters:
  • self – the BDF object
  • eids – list of element ID
  • msg – a additional message to print out if an element is not found
Returns node_ids:
 

set of node IDs

For example

>>> eids = [1, 2, 3]  # list of elements with pid=1
>>> msg = ' which are required for pid=1'
>>> node_ids = bdf.get_node_ids_with_elements(eids, msg=msg)
get_property_id_to_element_ids_map()

Returns a dictionary that maps a property ID to a list of elemnents

get_property_ids()

deprecated

get_structural_material_ids()
get_thermal_material_ids()
get_x_associated_with_y(xdict, xkeys, ykeys, stop_on_failure=True)

Get the range of sub-properties of a card.

Note

Assumes you’re taking a single path through the cards. You could probably explicitly code these queries faster, but this method has a lot of flexibility with very little user code.

Parameters:
  • self – the BDF object
  • xdict – the BDF attribute that should be querried (e.g. self.elements)
  • xkeys – the list of object keys that should be stepped through associated with xdict (e.g. eids=[1, 2, 3])
  • ykeys – the list of response keys that should be stepped through (e.g. [‘pid’, ‘mid’, ‘mid’])
  • stop_on_failure – Should an error be raised if there is an invalid key? For example, get all material used by elements, but don’t crash on CONRODs.
Returns results:
 

The set of all values used

# Get nodes associated with eid=[1, 2, 3]
nodes = self.get_x_associated_with_y(
    self.elements, [1, 2, 3], ['nodes'])

# Get node IDs associated with eid=[1, 2, 3]
nodesIDs = self.get_x_associated_with_y(
    self.elements, [1, 2, 3], ['nodes', 'nid'])

# Get coord IDs associated with eid=[1, 2, 3]
coordIDs = self.get_x_associated_with_y(
    self.elements, [1, 2, 3], ['nodes', 'cp', 'cid'])

# Get properties associated with eid=[1, 2, 3]
properties = self.get_x_associated_with_y(
    self.elements, [1, 2, 3], ['pid'])

# Get materials associated with eid=[1, 2, 3]
materials = self.get_x_associated_with_y(
    self.elements, [1, 2, 3], ['pid', 'mid'])

# Get material IDs associated with eid=[1, 2, 3]
materialIDs = self.get_x_associated_with_y(
    self.elements, [1, 2, 3], ['pid', 'mid', 'mid'])

# Get the values for Young's Modulus
E = self.get_x_associated_with_y(
    self.elements, None, ['pid', 'mid', 'e'])
is_reject(card_name)[source]

Can the card be read.

If the card is rejected, it’s added to self.reject_count

Parameters:
  • self – the BDF object
  • card_name – the card_name -> ‘GRID’
mass(element_ids=None, sym_axis=None)

Calculates mass in the global coordinate system

mass_properties(element_ids=None, reference_point=None, sym_axis=None, num_cpus=1, scale=None)

Caclulates mass properties in the global system about the reference point.

Parameters:
  • self – the BDF object
  • element_ids – an array of element ids
  • reference_point – an array that defines the origin of the frame. default = <0,0,0>.
  • sym_axis – the axis to which the model is symmetric. If AERO cards are used, this can be left blank allowed_values = ‘x’, ‘y’, ‘z’, ‘xy’, ‘yz’, ‘xz’, ‘xyz’
  • scale – the WTMASS scaling value default=None -> PARAM, WTMASS is used float > 0.0
Returns mass:

the mass of the model

Returns cg:

the cg of the model as an array.

Returns I:

moment of inertia array([Ixx, Iyy, Izz, Ixy, Ixz, Iyz])

I = mass * centroid * centroid

\[I_{xx} = m (dy^2 + dz^2)\]
\[I_{yz} = -m * dy * dz\]

where:

\[dx = x_{element} - x_{ref}\]

Note

This doesn’t use the mass matrix formulation like Nastran. It assumes m*r^2 is the dominant term. If you’re trying to get the mass of a single element, it will be wrong, but for real models will be correct.

materialIDs()

deprecated

material_ids
modelType = u'nastran'

this is a nastran model

nCAeros()

deprecated

nElements()

deprecated

nNodes()

deprecated

ncaeros
ncoords
nelements
nmaterials
nnodes
nodeIDs()

deprecated

node_ids
nproperties
pop_parse_errors()[source]
pop_xref_errors()[source]
process_card(card_lines)[source]

Converts card_lines into a card. Considers dynamic syntax and removes empty fields

Parameters:
  • self – the BDF object
  • card_lines – list of strings that represent the card’s lines
Returns fields:

the parsed card’s fields

Returns card_name:
 

the card’s name


>>> card_lines = ['GRID,1,,1.0,2.0,3.0,,']
>>> model = BDF()
>>> fields, card_name = model.process_card(card_lines)
>>> fields
['GRID', '1', '', '1.0', '2.0', '3.0']
>>> card_name
'GRID'
propertyIDs()

deprecated

property_ids
read_bdf(bdf_filename=None, include_dir=None, xref=True, punch=False)[source]

Read method for the bdf files

Parameters:
  • self – the BDF object
  • bdf_filename – the input bdf (default=None; popup a dialog)
  • include_dir – the relative path to any include files (default=None if no include files)
  • xref – should the bdf be cross referenced (default=True)
  • punch – indicates whether the file is a punch file (default=False)
>>> bdf = BDF()
>>> bdf.read_bdf(bdf_filename, xref=True)
>>> g1 = bdf.Node(1)
>>> print(g1.Position())
[10.0, 12.0, 42.0]
>>> bdf.write_card(bdf_filename2)
>>> print(bdf.card_stats())

---BDF Statistics---
SOL 101
bdf.nodes = 20
bdf.elements = 10
etc.
reject_cards = None

cards that were created, but not processed

reject_count = None

stores the card_count of cards that have been rejected

rejects = None

lines that were rejected b/c they were for a card that isnt supported

resolveGrids(cid=0)

See also

resolve_grids

resolve_grids(cid=0)

Puts all nodes in a common coordinate system (mainly for cid testing)

Parameters:
  • self – the object pointer
  • cid – the cid to resolve the nodes to (default=0)

Note

loses association with previous coordinate systems so to go back requires another fem

set_dynamic_syntax(dict_of_vars)[source]

Uses the OpenMDAO syntax of %varName in an embedded BDF to update the values for an optimization study.

Parameters:
  • self – the BDF object
  • dict_of_vars – dictionary of 7 character variable names to map.
  GRID, 1, %xVar, %yVar, %zVar

>>> dict_of_vars = {'xVar': 1.0, 'yVar', 2.0, 'zVar':3.0}
>>> bdf = BDF()
>>> bdf.set_dynamic_syntax(dict_of_vars)
>>> bdf,read_bdf(bdf_filename, xref=True)
>>>

Note

Case sensitivity is supported.

Note

Variables should be 7 characters or less to fit in an 8-character field.

Warning

Type matters!

set_error_storage(nparse_errors=100, stop_on_parsing_error=True, nxref_errors=100, stop_on_xref_error=True)[source]

Catch parsing errors and store them up to print them out all at once (not all errors are caught).

Parameters:
  • self – the BDF object
  • nparse_errors – how many parse errors should be stored (default=0; all=None; no storage=0)
  • stop_on_parsing_error – should an error be raised if there are parsing errors (default=True)
  • nxref_errors – how many cross-reference errors should be stored (default=0; all=None; no storage=0)
  • stop_on_xref_error – should an error be raised if there are cross-reference errors (default=True)
specialCards = None

/ is the delete from restart card

structuralMaterialIDs()

deprecated

sum_forces_moments(p0, loadcase_id, include_grav=False)

Sums applied forces & moments about a reference point p0 for all load cases. Considers:

  • FORCE, FORCE1, FORCE2
  • MOMENT, MOMENT1, MOMENT2
  • PLOAD, PLOAD2, PLOAD4
  • LOAD
Parameters:
  • p0 (NUMPY.NDARRAY shape=(3,) or integer (node ID)) – the reference point
  • loadcase_id (integer) – the LOAD=ID to analyze
  • include_grav (bool) – includes gravity in the summation (not supported)
Returns Forces:

the forces

Returns Moments:
 

the moments

Warning

not full validated

Todo

It’s super slow for cid != 0. We can speed this up a lot if we calculate the normal, area, centroid based on precomputed node locations.

Pressure acts in the normal direction per model/real/loads.bdf and loads.f06

sum_forces_moments_elements(p0, loadcase_id, eids, nids, include_grav=False)

Sum the forces/moments based on a list of nodes and elements.

Parameters:
  • eids – the list of elements to include (e.g. the loads due to a PLOAD4)
  • nids – the list of nodes to include (e.g. the loads due to a FORCE card)
  • p0

    the point to sum moments about type = int

    sum moments about the specified grid point
    type = (3, ) ndarray/list (e.g. [10., 20., 30]):
    the x, y, z location in the global frame
Nodal Types : FORCE, FORCE1, FORCE2,
MOMENT, MOMENT1, MOMENT2, PLOAD

Element Types: PLOAD1, PLOAD2, PLOAD4, GRAV

If you have a CQUAD4 (eid=3) with a PLOAD4 (eid=3) and a FORCE card (nid=5) acting on it, you can incldue the PLOAD4, but not the FORCE card by using:

For just pressure:

eids = [3]
nids = []

For just force:

eids = []
nids = [5]

or both:

eids = [3]
nids = [5]

Note

If you split the model into sections and sum the loads on each section, you may not get the same result as if you summed the loads on the total model. This is due to the fact that nodal loads on the boundary are double/triple/etc. counted depending on how many breaks you have.

Todo

not done...

thermalMaterialIDs()

deprecated

unresolveGrids(femOld)

See also

unresolve_grids

unresolve_grids(model_old)

Puts all nodes back to original coordinate system.

Parameters:
  • self – the object pointer
  • model_old – the old model that hasnt lost it’s connection to the node cids

Warning

hasnt been tested well...

update_solution(sol, method, isol_line)[source]

Updates the overall solution type (e.g. 101,200,600)

Parameters:
  • self – the object pointer
  • sol – the solution type (101,103, etc)
  • method – the solution method (only for SOL=600)
  • isol_line – the line to put the SOL/method on
write_bdf(out_filename=None, size=8, is_double=False, interspersed=True, enddata=None)

Writes the BDF.

Parameters:
  • self – the BDF object
  • out_filename – the name to call the output bdf (default=None; pops a dialog)
  • size – the field size (8 is recommended)
  • is_double – small field (False) or large field (True); default=False
  • interspersed – Writes a bdf with properties & elements interspersed like how Patran writes the bdf. This takes slightly longer than if interspersed=False, but makes it much easier to compare to a Patran-formatted bdf and is more clear. (default=True)
  • enddata – Flag to enable/disable writing ENDDATA (default=None -> depends on input BDF)

bdf_methods Module

bdf_replacer Module

Inheritance diagram of pyNastran.bdf.bdf_replacer

class pyNastran.bdf.bdf_replacer.BDFReplacer(bdf_out_filename, debug=True, log=None)[source]

Bases: pyNastran.bdf.bdf.BDF

This class demonstates OpenMDAO find-replace streaming coupled with some Python black magic (see _read_bulk_data_deck).

TODO: this needs to be tested with include files...

Attributes

Methods

_finish_writing()[source]
_read_bulk_data_deck()[source]

Hacks the _read_bulk_data_deck method to do some pre/post processing, but still calls the orignal function.

..see:: BDF._read_bulk_data_deck()

_start_writing()[source]
add_card(card_lines, card_name, comment=u'', is_list=True)[source]

Adds a card object to the BDF object using a streaming approach.

Parameters:
  • self – the BDF object
  • card_lines – the list of the card fields >>> [‘GRID,1,2’,] # (is_list = False) >>> [‘GRID’,1,2,] # (is_list = True; default)
  • card_name – the card_name -> ‘GRID’
  • comment – an optional the comment for the card
  • is_list – changes card_lines from a list of lines to a list of fields
Returns card_object:
 

the card object representation of card

Note

this is a very useful method for interfacing with the code

Note

the cardObject is not a card-type object...so not a GRID card or CQUAD4 object. It’s a BDFCard Object. However, you know the type (assuming a GRID), so just call the mesh.Node(nid) to get the Node object that was just created.

Warning

cardObject is not returned

is_reject(card_name)[source]

case_control_deck Module

deprecated Module

Inheritance diagram of pyNastran.bdf.deprecated

class pyNastran.bdf.deprecated.AeroDeprecated[source]

Bases: object

defines deprecated methods for Aero

Methods

DisableGroundEffect()[source]
EnableGroundEffect()[source]
IsAntiSymmetricalXY()[source]
IsAntiSymmetricalXZ()[source]
IsSymmetricalXY()[source]
IsSymmetricalXZ()[source]
class pyNastran.bdf.deprecated.BDFMethodsDeprecated[source]

Bases: object

defines deprecated methods for BDFMethods

Methods

Mass()[source]

See also

mass

MassProperties()[source]

See also

mass_properties

mass(element_ids=None, sym_axis=None)[source]

Calculates mass in the global coordinate system

resolveGrids(cid=0)[source]

See also

resolve_grids

unresolveGrids(femOld)[source]

See also

unresolve_grids

class pyNastran.bdf.deprecated.BaseCardDeprecated[source]

Bases: object

Deprecated in:
  • version 0.7
Removed in:
  • version 0.8

Methods

printRawFields(size=8)[source]
rawFields()[source]
reprCard()[source]
reprFields()[source]
repr_card()[source]
class pyNastran.bdf.deprecated.CAERO1Deprecated[source]

Bases: object

defines deprecated methods for CAERO1

Methods

Points()[source]
SetPoints(points)[source]
class pyNastran.bdf.deprecated.CAERO2Deprecated[source]

Bases: object

defines deprecated methods for CAERO2

Methods

Points()[source]
SetPoints(points)[source]
class pyNastran.bdf.deprecated.CoordDeprecated[source]

Bases: object

defines deprecated methods for Coord

Methods

T()[source]

Gets the 6 x 6 transformation

\[[\lambda] = [B_{ij}]\]
\[\begin{split}[T] = \left[ \begin{array}{cc} \lambda & 0 \\ 0 & \lambda \\ \end{array} \right]\end{split}\]
transformNodeToGlobal(p)[source]
transformToGlobal(p, debug=False)[source]

Transforms a node from the local frame to the global frame

Parameters:
  • p – the xyz point in the local frame
  • debug – debug flag (default=False; unused)
Retval p2:

the xyz point in the global frame

Retval matrix:

the transformation matrix

transformToLocal(p, beta, debug=False)[source]
transformVectorToGlobal(p)[source]
transform_to_local(p, beta, debug=False)[source]
class pyNastran.bdf.deprecated.DeprecatedCompositeShellProperty[source]

Bases: object

To be deprecated in:
  • Version 0.7
To be removed in:
  • Version 0.8

Methods

MassPerArea(iply='all', method='nplies')[source]
Nsm()[source]
Rho(iply)[source]
Theta(iply)[source]
Thickness(iply='all')[source]
isSymmetrical()[source]
nPlies()[source]
sout(iply)[source]
class pyNastran.bdf.deprecated.ElementDeprecated[source]

Bases: object

defines deprecated methods for Element

Methods

nodePositions(nodes=None)[source]
class pyNastran.bdf.deprecated.GetMethodsDeprecated[source]

Bases: object

defines deprecated methods for GetMethods

Methods

Flfact(sid, msg)[source]

Deprecated since version will: be removed in version 0.8

coordIDs()[source]

deprecated

elementIDs()[source]

deprecated

getElementIDsWithPID(pid)[source]

Gets all the element IDs with a specific property ID

Parameters:pid – property ID
Returns elementIDs:
 as a list

Deprecated since version will: be removed in version 0.8

The same functionality may be used by calling
>>> self.getElementIDsWithPIDs([pid], mode='list')
getElementIDsWithPIDs(pids, mode='list')[source]

deprecated

getMaterialIDToPropertyIDsMap()[source]

deprecated

getNodeIDToElementIDsMap()[source]

deprecated

getNodeIDsWithElement(eid)[source]

deprecated

getNodeIDsWithElements(eids, msg='')[source]

deprecated

getNodes()[source]

deprecated

getPropertyIDToElementIDsMap()[source]

deprecated

get_coord_ids()[source]
get_element_ids()[source]

deprecated

get_ncaeros()[source]
get_nelements()[source]

deprecated

get_nnodes()[source]

deprecated

get_node_ids()[source]

deprecated

get_property_ids()[source]

deprecated

materialIDs()[source]

deprecated

nCAeros()[source]

deprecated

nElements()[source]

deprecated

nNodes()[source]

deprecated

nodeIDs()[source]

deprecated

propertyIDs()[source]

deprecated

structuralMaterialIDs()[source]

deprecated

thermalMaterialIDs()[source]

deprecated

class pyNastran.bdf.deprecated.GridDeprecated[source]

Bases: object

Methods

Position(debug=False)[source]
PositionWRT(model, cid, debug=False)[source]
UpdatePosition(model, xyz, cid=0)[source]
class pyNastran.bdf.deprecated.PointDeprecated[source]

Bases: object

Methods

Position(debug=False)[source]
PositionWRT(model, cid, debug=False)[source]
UpdatePosition(model, xyz, cid=0)[source]
class pyNastran.bdf.deprecated.SPOINTsDeprecated[source]

Bases: object

Methods

nDOF()[source]
class pyNastran.bdf.deprecated.ShellElementDeprecated[source]

Bases: object

Methods

Rho()[source]

Returns the density

subcase Module

Inheritance diagram of pyNastran.bdf.subcase

Subcase creation/extraction class

class pyNastran.bdf.subcase.Subcase(id=0)[source]

Bases: object

Subcase creation/extraction class

Methods

cross_reference(model)[source]

Method crossReference:

Parameters:
  • self – the Subcase object
  • model – the BDF object

Note

this is not integrated and probably never will be as it’s not really that necessary. it’s only really useful when running an analysis.

finish_subcase()[source]

Removes the subcase parameter from the subcase to avoid printing it in a funny spot

Parameters:self – the Subcase object
get_analysis_code(sol)[source]

Maps the solution number to the OP2 analysis code.

  • 8 - post-buckling (maybe 7 depending on NLPARM???)
# not important
  • 3/4 - differential stiffness (obsolete)
  • 11 - old geometric nonlinear statics
  • 12 - contran (???)

Todo

verify

get_device_code(options, value)[source]

Gets the device code of a given set of options and value

Parameters:
  • self – the Subcase object
  • options – the options for a parameter
  • value – the value of the parameter
get_format_code(options, value)[source]

Gets the format code that will be used by the op2 based on the options.

Parameters:
  • self – the Subcase object
  • options – the options for a parameter
  • value – the value of the parameter

Todo

not done...only supports REAL, IMAG, PHASE, not RANDOM

get_op2_data(sol, solmap_toValue)[source]
get_parameter(param_name)[source]

Gets the [value, options] for a subcase.

Parameters:
  • self – the Subcase object
  • param_name – the case control parameter to check for
model = BDF()
model.read_bdf(bdf_filename)
case_control = model.caseControlDeck
subcase1 = case_control.subcases[1]
value, options = subcase1['LOAD']
get_sort_code(options, value)[source]

Gets the sort code of a given set of options and value

Parameters:
  • self – the Subcase object
  • options – the options for a parameter
  • value – the value of the parameter
get_stress_code(key, options, value)[source]

Method get_stress_code:

Note

the individual element must take the stress_code and reduce

it to what the element can return. For example, for an isotropic CQUAD4 the fiber field doesnt mean anything.

BAR - no von mises/fiber ISOTROPIC - no fiber

Todo

how does the MATERIAL bit get turned on? I’m assuming it’s element dependent...

get_table_code(sol, table_name, options)[source]

Gets the table code of a given parameter. For example, the DISPLACMENT(PLOT,POST)=ALL makes an OUGV1 table and stores the displacement. This has an OP2 table code of 1, unless you’re running a modal solution, in which case it makes an OUGV1 table of eigenvectors and has a table code of 7.

Parameters:
  • self – the Subcase object
  • options – the options for a parameter
  • value – the value of the parameter
has_parameter(param_name)[source]

see __contains__

print_param(key, param)[source]

Prints a single entry of the a subcase from the global or local subcase list.

Parameters:self – the Subcase object
solCodeMap = {64: 106, 1: 101, 66: 106, 68: 106, 76: 101, 144: 101, 21: 101, 24: 101, 26: 101, 99: 129, 187: 101, 61: 101}
subcase_sorted(lst)[source]

Does a “smart” sort on the keys such that SET cards increment in numerical order. Also puts the sets first.

Parameters:
  • self – the Subcase object
  • lst – the list of subcase list objects
Returns listB:

the sorted version of listA

write_subcase(subcase0)[source]

Internal method to print a subcase

Parameters:
  • self – the Subcase object
  • subcase0 – the global Subcase object
pyNastran.bdf.subcase.update_param_name(param_name)[source]

Takes an abbreviated name and expands it so the user can type DISP or DISPLACEMENT and get the same answer

Parameters:param_name – the parameter name to be standardized (e.g. DISP vs. DIPLACEMENT)

Todo

not a complete list