Skip to content

Update inp2rad.py to add dload pressure#104

Merged
sebastienVilleneuve merged 1 commit into
OpenRadioss:mainfrom
PaulAltair:PaulAltair-pressureloads_wip
May 12, 2026
Merged

Update inp2rad.py to add dload pressure#104
sebastienVilleneuve merged 1 commit into
OpenRadioss:mainfrom
PaulAltair:PaulAltair-pressureloads_wip

Conversation

@PaulAltair
Copy link
Copy Markdown
Contributor

Draft:

includes a number of updates to add support for dload/dsload pressure definition, with amplitude, for set or surf reference

also incorporates change to dcoup3d support, allowing for newer HM export standard (set separated from dcoup3d element definition) improves robustness this slows down read/conversion if dcoup3ds present, could be specifically recoded for HM in future to speed back up

shell property output corrected in the 2025 output format, to move ipos field (was on new line in Radioss 2025 documentation, moved to end of previous line in 2025.1)

segments are generated for all elsets instead of only when surfs are present (since mapping may be needed for dload/dsload pressure definition, relatively low overhead)

skipgrav section in dload grav deactivated/commented out (may revert later)

@PaulAltair PaulAltair marked this pull request as ready for review April 1, 2026 23:34
@PaulAltair PaulAltair marked this pull request as draft April 1, 2026 23:35
@laurent-altr laurent-altr requested a review from Copilot April 2, 2026 07:19
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Abaqus .inp → Radioss .rad converter to support additional load and formatting cases, primarily adding pressure (*DLOAD/*DSLOAD) conversion to Radioss /PLOAD/ and improving compatibility with newer export/format variants.

Changes:

  • Add conversion of *DLOAD/*DSLOAD pressure definitions (with optional amplitude) into Radioss /PLOAD/ blocks, generating /SURF/SEG/ when needed.
  • Adjust shell property output formatting for Radioss 2025 output and broaden segment generation to run even without explicit *SURFACE definitions.
  • Improve preprocessing/robustness for DCOUP3D / distributing coupling and related placeholder ELSET handling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread input_converters/inp2rad/inp2rad/inp2rad.py
if not existing_surf_id:
surf_id += 1
new_surf_id = surf_id
surf_name_key = f"{elset_name}_{load_type}_pload"
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The newly created pressure surface is stored in surf_name_to_id under surf_name_key = f"{elset_name}_{load_type}_pload", but later lookups use surf_name_to_id.get(elset_name, 0). This prevents reuse of generated surfaces and will create duplicate /SURF/SEG blocks for repeated pressure loads on the same region. Use a consistent key for both storing and lookup (either store under elset_name when the input region is an ELSET, or look up using the same constructed key).

Suggested change
surf_name_key = f"{elset_name}_{load_type}_pload"
surf_name_key = elset_name

Copilot uses AI. Check for mistakes.
Comment on lines +3364 to +3370

if matchelement and not segments_converted_already:
#if matchelement and not segments_converted_already:
if not segments_converted_already:
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

convert_segments() now returns on the first iteration regardless of whether a *SURFACE section exists, but it still loops over input_lines and computes stype_pattern/matchelement which are no longer used. Consider removing the loop/regex entirely and just build segment_dictionary from element_dicts once; this will simplify the control flow and avoid unnecessary per-line regex work.

Copilot uses AI. Check for mistakes.
Comment on lines 4794 to 4797
elset_values = []
if dload_name.isdigit():
skipgrav = True
skipgrav = False # modified 31st March 2026, to (temp) prevent skip for digit, don't recall why this was added?
continue
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This branch is contradictory: the comment says it was modified to prevent skipping digit-named regions, but the continue still skips processing numeric dload_name entries entirely. Either implement numeric-region handling here (e.g., treat it as an element/part identifier) or remove the misleading skipgrav assignment/comment to avoid silently ignoring valid inputs.

Copilot uses AI. Check for mistakes.


####################################################################################################
# Function to convert *DLOAD or *DSlOAD pressure loads to Radioss /PLOAD/ cards #
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in the header comment: *DSlOAD should be *DSLOAD (uppercase S).

Suggested change
# Function to convert *DLOAD or *DSlOAD pressure loads to Radioss /PLOAD/ cards #
# Function to convert *DLOAD or *DSLOAD pressure loads to Radioss /PLOAD/ cards #

Copilot uses AI. Check for mistakes.
Comment thread input_converters/inp2rad/inp2rad/inp2rad.py
@PaulAltair PaulAltair force-pushed the PaulAltair-pressureloads_wip branch from 4421b9a to 28e8bee Compare April 28, 2026 13:07
includes a number of wip updates for dload/dsload pressure

also incorporates wip change to dcoup3d support

skipgrav section commented out (may revert later)

testing comments

Revised 12th May 2026

Updates to Gravity and Pressure Dload and Dsload parsing

Grav Dload section cleaned up and reworked, previous 'skipgrav' workaround removed completely

Cleaned up some Warning comments
@PaulAltair PaulAltair force-pushed the PaulAltair-pressureloads_wip branch from 28e8bee to 7b0ffa6 Compare May 12, 2026 08:28
Copy link
Copy Markdown
Contributor Author

@PaulAltair PaulAltair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed previous comments and made changes where appropriate

@sebastienVilleneuve sebastienVilleneuve marked this pull request as ready for review May 12, 2026 10:13
@sebastienVilleneuve sebastienVilleneuve merged commit 21d5729 into OpenRadioss:main May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants