8000 Avoid shared default control points in mat foundations by Tonylo-lab · Pull Request #368 · JWock82/Pynite · GitHub
[go: up one dir, main page]

Skip to content

Avoid shared default control points in mat foundations - #368

Open
Tonylo-lab wants to merge 1 commit into
JWock82:mainfrom
Tonylo-lab:fix/mat-foundation-default-controls
Open

Tonylo-lab wants to merge 1 commit into
JWock82:mainfrom
Tonylo-lab:fix/mat-foundation-default-controls

Conversation

@Tonylo-lab
Copy link
Copy Markdown

FEModel3D.add_mat_foundation() uses shared mutable defaults for x_control and y_control. Adding a point load to one mat appends control points that affect unrelated mats, including mats in separate models. In a minimal example, a second 2x3 mat with mesh_size=1 and no requested control points generates 12 elements instead of 6 after a load at [1.5, 2.5] is added to the first mat.

Use None defaults, matching the underlying MatFoundation constructor, so each mat receives its own control lists. Add four parameterized cases to the existing mesh tests (same/separate models and omitted/explicit controls), checking actual node coordinates and element counts, plus one short changelog entry.

Validation on Windows (Python 3.12.15, NumPy 2.5.5, SciPy 1.18.1):

  • New tests against unmodified production code: 2 failed, 2 passed.
  • pytest Testing/test_meshes.py Testing/test_needs_update_flag.py Testing/test_analysis_regeneration.py Testing/test_loads.py -q: 27 passed, 2 subtests passed.
  • Ruff 0.14.9 on both changed Python files and git diff --check: passed.

Not run: the full test suite, graphical visualization validation, or tests on other platforms/Python versions.

AI assistance: OpenAI Codex assisted with investigation, the patch, and the regression tests. The concrete diff was presented for approval before submission, and the targeted checks above were run locally.

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.

1 participant

0