SteveDoyle2 / pyNastran

A Python-based interface tool for Nastran's file formats
Other
384 stars 147 forks source link

Generalize Nastran GUI result classes, so you can use them outside of the GUI #770

Open SteveDoyle2 opened 5 months ago

SteveDoyle2 commented 5 months ago

This will enable nodal averaging. Note that the CompositeStrainStressResults2 doesn't support nodal averaging and probably doesn't need it.

The big goals are to:

They're found in:

An example of this is the PlateStrainStressResults2 model is the BDF object subcase_id is probably not required, but is used for informational purposes in the annotation (gui corner text) node_id / element_id are all the elements in the model iresult_to_title_annotation_map should probably be brought inside the class and replaced with an is_stress/strain flag plate_cases is a list of plates, so [cquad4_plate_stress, ctria3_plate_stress, cquad8_plate_stress, ...] or similar for strains eid_to_nid_map is used to build to split the nodal and centroidal results. For nodal, we can precalculate some stuff needed for nodal averaging.

res = PlateStrainStressResults2(
    subcase_id, model,
    node_id, element_id,
    plate_cases, iresult_to_title_annotation_map, title,
    data_format='%g', is_variable_data_format=False,
    nlabels=None, labelsize=None, ncolors=None, colormap='',
    set_max_min=False,
    is_fiber_distance=plate_case.is_fiber_distance,
    eid_to_nid_map=eid_to_nid_map,
    uname='PlateStressStrainResults2')

Currently all user interactive data comes from set_sidebar_args, which is probably the least user friendly part of the class. This sets whether you want centroid/corner stress, as well as how you want to process layers (Top/Bottom) into a single stress. Finally, the nodal_combine variable would be Mean/Average for nodal averaging vs Max or Absolute Max.

Part of this generalization should be to allow for updating node_id/element_id to make it possible to look at a subset of nodes/elements. This should probably be done as part of the subsequent step.

SteveDoyle2 commented 5 months ago

@fmamitrotta I'm not sure how to assign you

Also, thank you for offering!

fmamitrotta commented 5 months ago

Got it! No worries, and thanks for the detailed description. I'll post update here as I progress.