bdf Package¶
bdf Module¶
bdf_Methods Module¶
caseControlDeck Module¶
-
class
pyNastran.bdf.caseControlDeck.CaseControlDeck(lines, log=None)[source]¶ Bases:
objectParameters: - self – the case control deck object
- lines – list of lines that represent the case control deck ending with BEGIN BULK
- log – a logger object
-
_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
-
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???
-
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.
-
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¶
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
subcase Module¶
-
class
pyNastran.bdf.subcase.Subcase(id=0)[source]¶ Bases:
object-
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_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_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...
-
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
-
Subpackages¶
- bdfInterface Package
- cards Package
- dmap Package