bdf Package

bdf Module

bdf_Methods Module

caseControlDeck Module

Inheritance diagram of pyNastran.bdf.caseControlDeck
class pyNastran.bdf.caseControlDeck.CaseControlDeck(lines, log=None)[source]

Bases: object

Parameters:
  • self – the case control deck object
  • lines – list of lines that represent the case control deck ending with BEGIN BULK
  • log – a logger object
_add_parameter_to_subcase(key, value, options, param_type, isubcase)[source]

internal method

_clean_lines(lines)[source]

removes comment characters $

_parse_data_from_user(param)[source]
_parse_entry(lines)[source]
@brief

internal method for parsing a card of the case control deck

parses a single case control deck card into 4 sections 1. paramName - obvious 2. Value - still kind of obvious 3. options - rarely used data 4. paramType - STRESS-type, SUBCASE-type, PARAM-type, SET-type, BEGIN_BULK-type

It’s easier with examples:

paramType = SUBCASE-type
SUBCASE 1 -> paramName=SUBCASE value=1 options=[]
paramType = STRESS-type
STRESS = ALL -> paramName=STRESS value=ALL options=[] STRAIN(PLOT) = 5 -> paramName=STRAIN value=5 options=[PLOT] TITLE = stuff -> paramName=TITLE value=stuff options=[]
paramType = SET-type
SET 1 = 10,20,30 -> paramName=SET value=[10,20,30] options = 1
paramType = BEGIN_BULK-type
BEGIN BULK -> paramName=BEGIN value=BULK options = []
paramType = CSV-type
PARAM,FIXEDB,-1 -> paramName=PARAM value=FIXEDB options = [-1]

The paramType is the “macro” form of the data (similar to integer, float, string). The value is generally whats on the RHS of the equals sign (assuming it’s there). Options are modifiers on the data. Form things like the PARAM card or the SET card they arent as clear, but the paramType lets the program know how to format it when writing it out.

Parameters:
  • self – the case control deck object
  • lines – list of lines
Returns:

paramName see brief

Returns:

value see brief

Returns:

options see brief

Returns:

paramType see brief

_read(lines)[source]

reads the case control deck

Note

supports comment lines

Warning

doesnt check for 72 character width lines, but will follow that when it’s written out

add_parameter_to_global_subcase(param)[source]

takes in a single-lined string

Note

dont worry about overbounding the line

add_parameter_to_local_subcase(isubcase, param)[source]
convert_to_sol_200(model)[source]

Takes a case control deck and changes it from a

Todo

not done...

copy_subcase(i_from_subcase, i_to_subcase, overwrite_subcase=True)[source]

Overwrites the parameters from one subcase to another.

Parameters:
  • self – the case control deck object
  • i_from_subcase – the subcase to pull the data from
  • i_to_subcase – the subcase to map the data to
  • overwrite_subcase – NULLs i_to_subcase before copying i_from_subcase
create_new_subcase(isubcase)[source]

Method create_new_subcase:

Warning

be careful you dont add data to the global subcase after running this...is this True???

cross_reference(model)[source]
delete_subcase(isubcase)[source]
finish_subcases()[source]

removes any unwanted data in the subcase...specifically the SUBCASE data member. Otherwise it will print out after a key like stress.

get_local_subcase_list()[source]
get_op2_data()[source]

returns the relevant op2 parameters required for a given subcase

get_subcase_list()[source]
get_subcase_parameter(isubcase, param_name)[source]
has_parameter(isubcase, param_name)[source]

Checks to see if a parameter (e.g. STRESS) is defined in a certain subcase ID.

Parameters:
  • self – the CaseControl object
  • isubcase – the subcase ID to check
  • param_name – the parameter name to look for
has_subcase(isubcase)[source]

Checks to see if a subcase exists.

Parameters:
  • self – the case control deck object
  • isubcase – the subcase ID
Returns:

does_subcase_exist (type = bool)

nlines_max = 10000
update_solution(isubcase, sol)[source]

sol = STATICS, FLUTTER, MODAL, etc.

fieldWriter Module

fieldWriter16 Module

pyNastran.bdf.fieldWriter16.printCard_16(fields, tol=0.0)[source]

Prints a nastran-style card with 16-character width fields.

Parameters:
  • fields – all the fields in the BDF card (no blanks)
  • tol – the abs(tol) to consider value=0 (default=0.)

Note

A large field format follows the 8-16-16-16-16-8 = 80 format where the first 8 is the card name or blank (continuation). The last 8-character field indicates an optional continuation, but because it’s a left-justified unneccessary field, printCard doesnt use it.

pyNastran.bdf.fieldWriter16.printField16(value, tol=0.0)[source]

prints a single 16-character width field

Parameters:
  • value – the value to print
  • tol – the abs(tol) to consider value=0 (default=0.)
Returns:

field an 16-character (tested) string

pyNastran.bdf.fieldWriter16.printFloat16(value, tol=1e-08)[source]

Prints a float in nastran 16-character width syntax using the highest precision possbile.

See also

see printFloat8()

Warning

completely unimplemented & untested

pyNastran.bdf.fieldWriter16.printScientific16(value)[source]

Prints a value in 16-character scientific notation. This is a sub-method and shouldnt typically be called

Warning

not tested...

subcase Module

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

Bases: object

_add_data(key, value, options, param_type)[source]
_simplify_data(key, value, options, param_type)[source]
crossReference(mesh)[source]

Method crossReference:

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

get_analysis_code(sol)[source]

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]
get_format_code(options, value)[source]

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

Todo

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

get_op2_data(sol, solmap_toValue)[source]
get_parameter(paramName)[source]
get_sort_code(options, value)[source]
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, tableName, options)[source]
has_parameter(paramName)[source]
print_param(key, param, printBeginBulk=True)[source]

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

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(listA)[source]

does a “smart” sort on the keys such that SET cards increment in numerical order.

Parameters:
  • self – the subcase object
  • listA – the list of subcase list objects
Returns:

listB the sorted version of listA

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:
  • self – the subcase object
  • param_name – the parameter name to be standardized (e.g. DISP vs. DIPLACEMENT)

Todo

not a complete list

write_subcase(subcase0)[source]

internal method to print a subcase

Parameters:
  • self – the subcase object
  • subcase0 – the global subcase