subcase_utils
Module¶
- defines:
expand_thru_case_control(set_value)
write_set(set_id, values, spaces=’’)
write_stress_type(key, options, value, spaces=’’)
-
pyNastran.bdf.bdf_interface.subcase_utils.
expand_float
(data)[source]¶ helper method for
expand_thru_case_control
-
pyNastran.bdf.bdf_interface.subcase_utils.
expand_thru_case_control
(data_in)[source]¶ Expands a case control SET card
- Parameters
- set_valuestr???
???
- Returns
- valuesList[int] / List[float]
the values in the SET
Examples
set_value = [‘1 THRU 5’, ‘20 THRU 30 BY 2’] >>> values = expand_thru_case_control(set_value) [1, 2, 3, 4, 5, 20, 22, 24, 26, 28, 30]
- Odd behavior:
1 THRU 10 EXCEPT 4,5,6,11 results in [1,2,3,7,8,9,10,11] the EXCEPT is active while the value is less than the THRU value of 10 and the values are in ascending order
- What happens when:
a value is excluded and later added or
a value is included and later excluded
-
pyNastran.bdf.bdf_interface.subcase_utils.
get_except
(data, i, ndata, end_value)[source]¶ helper method for expand that gets the values until the end of an EXCEPT chain
-
pyNastran.bdf.bdf_interface.subcase_utils.
isinteger
(astring)[source]¶ Is the given string an integer?
-
pyNastran.bdf.bdf_interface.subcase_utils.
setup_data
(data_in)[source]¶ helper method for
expand_thru_case_control
-
pyNastran.bdf.bdf_interface.subcase_utils.
split_comma_space
(datai)[source]¶ normalizes the form of a SET into a comma separated list instead of being mixed
-
pyNastran.bdf.bdf_interface.subcase_utils.
write_set
(set_id: int, values: List[int], spaces: str = '') → str[source]¶ writes SET 80 = 3926, 3927, 3928, 4141, 4142, 4143, 4356, 4357, 4358, 4571,
4572, 4573, 3323 THRU 3462, 3464 THRU 3603, 3605 THRU 3683, 3910 THRU 3921, 4125 THRU 4136, 4340 THRU 4351
- Parameters
- set_idint / str?
the Set ID
- valuesList[int]
the Set values
- spacesstr; default=’’
indentation
- Returns
- msgstr
the string of the set
Examples
Example 1 >>> set_id = 80 >>> values = [1, 2, 3, 4, 5, 7] >>> set = write_set(set_id, values, spaces=’’) >>> set SET 80 = 1 THRU 5, 7
Example 2 >>> set_id = ‘’ >>> values = [‘ALL’] >>> set = write_set(set_id, values, spaces=’’) >>> set SET = ALL