case_control_deck Module

Inheritance diagram of pyNastran.bdf.case_control_deck

CaseControlDeck parsing and extraction class

CaseControlDeck:

get_subcase_parameter(self, isubcase, param_name) has_subcase(self, isubcase) create_new_subcase(self, isubcase) delete_subcase(self, isubcase) copy_subcase(self, i_from_subcase, i_to_subcase, overwrite_subcase=True) get_subcase_list(self) get_local_subcase_list(self) update_solution(self, isubcase, sol) add_parameter_to_global_subcase(self, param) add_parameter_to_local_subcase(self, isubcase, param) finish_subcases(self) convert_to_sol_200(self, model)
class pyNastran.bdf.case_control_deck.CaseControlDeck(lines, log=None)[source]

Bases: object

CaseControlDeck parsing and extraction class

Parameters:
lines : List[str]

list of lines that represent the case control deck ending with BEGIN BULK

log : log()

a :mod: logging object

add_parameter_to_global_subcase(self, param)[source]

Takes in a single-lined string and adds it to the global subcase.

Parameters:
param : str

the variable to add

Notes

dont worry about overbounding the line

Examples

>>> bdf = BDF()
>>> bdf.read_bdf(bdf_filename)
>>> bdf.case_control.add_parameter_to_global_subcase('DISP=ALL')
>>> bdf.case_control
TITLE = DUMMY LINE
DISP = ALL
add_parameter_to_local_subcase(self, isubcase, param)[source]

Takes in a single-lined string and adds it to a single Subcase.

Parameters:
isubcase : int

the subcase ID to add

param_name : List[str]

the parameter name to add

Notes

dont worry about overbounding the line

Examples

>>> bdf = BDF()
>>> bdf.read_bdf(bdf_filename)
>>> bdf.case_control.add_parameter_to_local_subcase(1, 'DISP=ALL')
>>> print(bdf.case_control)
TITLE = DUMMY LINE
SUBCASE 1
    DISP = ALL
>>>
convert_to_sol_200(self, model)[source]

Takes a case control deck and changes it from a SOL xxx to a SOL 200

Parameters:
model : BDF()

the BDF object

.. todo:: not done…
copy_subcase(self, i_from_subcase, i_to_subcase, overwrite_subcase=True)[source]

Overwrites the parameters from one subcase to another.

Parameters:
i_from_subcase : int

the Subcase to pull the data from

i_to_subcase : int

the Subcase to map the data to

overwrite_subcase : bool; default=True

NULLs i_to_subcase before copying i_from_subcase

Returns:
subcase : Subcase()

the new subcase

create_new_subcase(self, isubcase)[source]

Method create_new_subcase:

Parameters:
isubcase : int

the subcase ID

Returns:
subcase : Subcase()

the new subcase

Warning

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

cross_reference(self, model)[source]

Cross links the card so referenced cards can be extracted directly

Parameters:
model : BDF()

the BDF object

delete_subcase(self, isubcase)[source]

Deletes a subcase.

Parameters:
isubcase : int

the Subcase to delete

export_to_hdf5(self, hdf5_file, model, encoding)[source]

exports the case control deck section to an hdf5 file

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

Gets the list of subcases that aren’t the global subcase ID

get_op2_data(self)[source]

Gets the relevant op2 parameters required for a given subcase

Todo

not done…

get_subcase_list(self)[source]

Gets the list of subcases including the global subcase ID (0)

get_subcase_parameter(self, isubcase, param_name, obj=False)[source]

Get the [value, options] of a subcase’s parameter. For example, for STRESS(PLOT,POST)=ALL:

param_name=STRESS value=ALL options=[‘PLOT’, ‘POST’]
Parameters:
isubcase : int

the subcase ID to check

param_name : str

the parameter name to look for

obj : bool; default=False

should the object be returned

has_parameter(self, isubcase, *param_names)[source]

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

Parameters:
isubcase : int

the subcase ID to check

param_names : List[str]

the parameter name to look for

has_subcase(self, isubcase)[source]

Checks to see if a subcase exists.

Parameters:
isubcase : int

the subcase ID

Returns:
val : bool

does_subcase_exist (type = bool)

load_hdf5_file(self, hdf5_file, encoding)[source]

loads the case control deck section from a hdf5 file

reject_lines = None

stores a single copy of ‘BEGIN BULK’ or ‘BEGIN SUPER’

suppress_output(self)[source]

Replaces F06 printing with OP2 printing

Converts:
STRESS(PRINT,SORT1,REAL) FORCE(PRINT,PLOT,SORT1,REAL)
to:
STRESS(PLOT,SORT1,REAL) FORCE(PLOT,SORT1,REAL)

Warning

most case control types are not supported

type = 'CaseControlDeck'
update_solution(self, isubcase, sol)[source]

sol = STATICS, FLUTTER, MODAL, etc.

Parameters:
isubcase : int

the subcase ID to update

sol : str

the solution type to change the solution to

>>> bdf.case_control
SUBCASE 1

DISP = ALL

>>> bdf.case_control.update_solution(1, ‘FLUTTER’)
>>> bdf.case_control
SUBCASE 1

ANALYSIS FLUTTER DISP = ALL

>>>
write(self, write_begin_bulk=None)[source]
pyNastran.bdf.case_control_deck.integer(str_value, line)[source]

casts the value as an integer

pyNastran.bdf.case_control_deck.split_equal_space(line, word, example)[source]

Splits a case insensative line by an

reads:
  • ‘SUBCASE = 5’
  • ‘SUBCASE 5’
pyNastran.bdf.case_control_deck.verify_card(key, value, options, line)[source]

Make sure there are no obvious errors

pyNastran.bdf.case_control_deck.verify_card2(key, value, options, line)[source]

Make sure there are no obvious errors