diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index f7354e9bc5..63ed7c445f 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -16,7 +16,7 @@ on: env: DOCKER_IMAGE_NAME: ghcr.io/ansys/prime - DOCKER_IMAGE_TAG: '25.2.0' + DOCKER_IMAGE_TAG: '25.2.2' MAIN_PYTHON_VERSION: '3.13' PACKAGE_NAME: 'ansys-meshing-prime' PACKAGE_NAMESPACE: 'ansys.meshing.prime' @@ -144,7 +144,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} - maximum-pr-doc-deployments: 10 + maximum-pr-doc-deployments: 20 testing: name: Run Unit Tests @@ -207,6 +207,9 @@ jobs: if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') needs: [package, update-changelog] runs-on: ubuntu-latest + permissions: + id-token: write + contents: write steps: - name: Release to the public PyPI repository uses: ansys/actions/release-pypi-public@v10 @@ -218,6 +221,7 @@ jobs: - name: Release to GitHub uses: ansys/actions/release-github@v10 with: + token: ${{ secrets.GITHUB_TOKEN }} library-name: ${{ env.PACKAGE_NAME }} upload_dev_docs: diff --git a/CHANGELOG.md b/CHANGELOG.md index 715503d285..44b3cd7693 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,111 @@ This project uses [towncrier](https://towncrier.readthedocs.io/) and the changes +## [0.9.3](https://github.com/ansys/pyprimemesh/releases/tag/v0.9.3) - September 23, 2025 + + +### Miscellaneous + +- Updates the pyproj.toml [#1158](https://github.com/ansys/pyprimemesh/pull/1158) +- Fix for search bar issue [#1160](https://github.com/ansys/pyprimemesh/pull/1160) + + +### Maintenance + +- Update the conf.py file for pyansys tags & update the ansys-sphinx-theme version [#1159](https://github.com/ansys/pyprimemesh/pull/1159) + +## [0.9.2](https://github.com/ansys/pyprimemesh/releases/tag/v0.9.2) - September 18, 2025 + + +### Miscellaneous + +- Revert the index.rst code [#1156](https://github.com/ansys/pyprimemesh/pull/1156) + +## [0.9.2](https://github.com/ansys/pyprimemesh/releases/tag/v0.9.2) - September 17, 2025 + + +### Miscellaneous + +- Include fix for broken methods links in api [#1109](https://github.com/ansys/pyprimemesh/pull/1109) +- Removed the dev4 version from pyproj.toml [#1110](https://github.com/ansys/pyprimemesh/pull/1110) +- Include changes for SP1 release for dev0 [#1118](https://github.com/ansys/pyprimemesh/pull/1118) +- Update the version for sp1 stable release [#1121](https://github.com/ansys/pyprimemesh/pull/1121) +- Ado to GitHub 252 sp2 [#1142](https://github.com/ansys/pyprimemesh/pull/1142) +- Updates to the version [#1143](https://github.com/ansys/pyprimemesh/pull/1143) +- Stable release for 2025 R2 SP02 [#1153](https://github.com/ansys/pyprimemesh/pull/1153) + +## [0.9.0.dev4](https://github.com/ansys/pyprimemesh/releases/tag/v0.9.0.dev4) - July 15, 2025 + + +### Miscellaneous + +- Fix for v0.9.0.dev4 pipeline issue [#1107](https://github.com/ansys/pyprimemesh/pull/1107) + +## [0.9.0.dev4](https://github.com/ansys/pyprimemesh/releases/tag/v0.9.0.dev4) - July 14, 2025 + + +### Fixed + +- fix: Revert napoleon extension [#1052](https://github.com/ansys/pyprimemesh/pull/1052) + + +### Dependencies + +- build(deps): bump sphinx from 8.2.1 to 8.2.3 in the doc-dependencies group [#990](https://github.com/ansys/pyprimemesh/pull/990) +- build(deps): bump ansys-sphinx-theme[autoapi] from 1.3.2 to 1.3.3 in the doc-dependencies group [#992](https://github.com/ansys/pyprimemesh/pull/992) +- build(deps): bump the test-dependencies group across 1 directory with 2 updates [#993](https://github.com/ansys/pyprimemesh/pull/993), [#1060](https://github.com/ansys/pyprimemesh/pull/1060) +- build(deps): bump ansys-sphinx-theme[autoapi] from 1.3.3 to 1.4.2 in the doc-dependencies group [#994](https://github.com/ansys/pyprimemesh/pull/994) +- build(deps): bump pytest-cov from 6.0.0 to 6.1.1 in the test-dependencies group [#996](https://github.com/ansys/pyprimemesh/pull/996) +- build(deps): bump ansys/actions from 8 to 9 [#999](https://github.com/ansys/pyprimemesh/pull/999) +- build(deps): bump the pyvista group with 2 updates [#1005](https://github.com/ansys/pyprimemesh/pull/1005), [#1021](https://github.com/ansys/pyprimemesh/pull/1021) +- build(deps): bump ansys-tools-visualization-interface from 0.8.3 to 0.9.1 in the general-dependencies group [#1006](https://github.com/ansys/pyprimemesh/pull/1006) +- build(deps): bump pyvista/setup-headless-display-action from 3 to 4 [#1011](https://github.com/ansys/pyprimemesh/pull/1011) +- build(deps): bump ansys-sphinx-theme[autoapi] from 1.4.2 to 1.4.4 in the doc-dependencies group [#1022](https://github.com/ansys/pyprimemesh/pull/1022) +- build(deps): bump ansys-sphinx-theme[autoapi] from 1.4.4 to 1.5.2 in the doc-dependencies group [#1032](https://github.com/ansys/pyprimemesh/pull/1032) + + +### Miscellaneous + +- Update Dockerfile [#1015](https://github.com/ansys/pyprimemesh/pull/1015) +- fix to remove %s string while printing the server name [#1026](https://github.com/ansys/pyprimemesh/pull/1026) +- doc fix [#1033](https://github.com/ansys/pyprimemesh/pull/1033) +- Build(deps): bump ansys/actions from 9 to 10 [#1048](https://github.com/ansys/pyprimemesh/pull/1048) +- Build(deps): bump pytest from 8.4.0 to 8.4.1 in the test-dependencies group [#1065](https://github.com/ansys/pyprimemesh/pull/1065) +- Chore: update security.md [#1068](https://github.com/ansys/pyprimemesh/pull/1068) +- Doc: adding deep wiki link [#1071](https://github.com/ansys/pyprimemesh/pull/1071) +- Update pyproj.toml to 0.9.0.dev4 [#1104](https://github.com/ansys/pyprimemesh/pull/1104) + + +### Documentation + +- Update fileio.rst [#980](https://github.com/ansys/pyprimemesh/pull/980) +- Update index.rst [#1008](https://github.com/ansys/pyprimemesh/pull/1008), [#1023](https://github.com/ansys/pyprimemesh/pull/1023) +- Sraj/getting started [#1009](https://github.com/ansys/pyprimemesh/pull/1009) +- Maint/python 3.13 [#1018](https://github.com/ansys/pyprimemesh/pull/1018) +- Docker image [#1025](https://github.com/ansys/pyprimemesh/pull/1025) +- Update shellblcontrolstructs.py [#1027](https://github.com/ansys/pyprimemesh/pull/1027) +- Doc/changes [#1028](https://github.com/ansys/pyprimemesh/pull/1028) +- Fix docstring [#1034](https://github.com/ansys/pyprimemesh/pull/1034) +- doc: remove attributes from docs [#1035](https://github.com/ansys/pyprimemesh/pull/1035) +- fix: Avoid bad `trame-vtk` version [#1037](https://github.com/ansys/pyprimemesh/pull/1037) +- docs: remove extra colon in api docs [#1051](https://github.com/ansys/pyprimemesh/pull/1051) + + +### Maintenance + +- chore: update CHANGELOG for v0.8.0 [#988](https://github.com/ansys/pyprimemesh/pull/988) +- docs: Update ``CONTRIBUTORS.md`` with the latest contributors [#995](https://github.com/ansys/pyprimemesh/pull/995), [#1045](https://github.com/ansys/pyprimemesh/pull/1045) +- Sync ADO Changes for 252 [#1010](https://github.com/ansys/pyprimemesh/pull/1010) +- Maint/migrate examples to main [#1017](https://github.com/ansys/pyprimemesh/pull/1017) +- Update LICENSE [#1019](https://github.com/ansys/pyprimemesh/pull/1019) +- chore: update CHANGELOG for v0.8.1 [#1020](https://github.com/ansys/pyprimemesh/pull/1020) +- sync up client side changes from release/release-252 [#1029](https://github.com/ansys/pyprimemesh/pull/1029) +- revert the pyproj toml file [#1031](https://github.com/ansys/pyprimemesh/pull/1031) +- maint: check vulnerabilities [#1038](https://github.com/ansys/pyprimemesh/pull/1038) +- maint: create pull_request_template.md [#1039](https://github.com/ansys/pyprimemesh/pull/1039) +- maint: deploy pr docs [#1041](https://github.com/ansys/pyprimemesh/pull/1041) +- maint: temporary numpy fix [#1050](https://github.com/ansys/pyprimemesh/pull/1050) + ## [0.8.1](https://github.com/ansys/pyprimemesh/releases/tag/v0.8.1) - May 09, 2025 diff --git a/doc/changelog.d/1005.dependencies.md b/doc/changelog.d/1005.dependencies.md deleted file mode 100644 index c889568751..0000000000 --- a/doc/changelog.d/1005.dependencies.md +++ /dev/null @@ -1 +0,0 @@ -build(deps): bump the pyvista group with 2 updates \ No newline at end of file diff --git a/doc/changelog.d/1006.dependencies.md b/doc/changelog.d/1006.dependencies.md deleted file mode 100644 index 9e8c82b4cf..0000000000 --- a/doc/changelog.d/1006.dependencies.md +++ /dev/null @@ -1 +0,0 @@ -build(deps): bump ansys-tools-visualization-interface from 0.8.3 to 0.9.1 in the general-dependencies group \ No newline at end of file diff --git a/doc/changelog.d/1008.documentation.md b/doc/changelog.d/1008.documentation.md deleted file mode 100644 index 93489183ca..0000000000 --- a/doc/changelog.d/1008.documentation.md +++ /dev/null @@ -1 +0,0 @@ -Update index.rst \ No newline at end of file diff --git a/doc/changelog.d/1009.documentation.md b/doc/changelog.d/1009.documentation.md deleted file mode 100644 index cb208a2905..0000000000 --- a/doc/changelog.d/1009.documentation.md +++ /dev/null @@ -1 +0,0 @@ -Sraj/getting started \ No newline at end of file diff --git a/doc/changelog.d/1010.maintenance.md b/doc/changelog.d/1010.maintenance.md deleted file mode 100644 index 7415d38c5d..0000000000 --- a/doc/changelog.d/1010.maintenance.md +++ /dev/null @@ -1 +0,0 @@ -Sync ADO Changes for 252 \ No newline at end of file diff --git a/doc/changelog.d/1011.dependencies.md b/doc/changelog.d/1011.dependencies.md deleted file mode 100644 index 32f0fbb06f..0000000000 --- a/doc/changelog.d/1011.dependencies.md +++ /dev/null @@ -1 +0,0 @@ -build(deps): bump pyvista/setup-headless-display-action from 3 to 4 \ No newline at end of file diff --git a/doc/changelog.d/1015.miscellaneous.md b/doc/changelog.d/1015.miscellaneous.md deleted file mode 100644 index 93b13d9336..0000000000 --- a/doc/changelog.d/1015.miscellaneous.md +++ /dev/null @@ -1 +0,0 @@ -Update Dockerfile \ No newline at end of file diff --git a/doc/changelog.d/1017.maintenance.md b/doc/changelog.d/1017.maintenance.md deleted file mode 100644 index 3ae7699c90..0000000000 --- a/doc/changelog.d/1017.maintenance.md +++ /dev/null @@ -1 +0,0 @@ -Maint/migrate examples to main \ No newline at end of file diff --git a/doc/changelog.d/1018.documentation.md b/doc/changelog.d/1018.documentation.md deleted file mode 100644 index 7c7ccd07ae..0000000000 --- a/doc/changelog.d/1018.documentation.md +++ /dev/null @@ -1 +0,0 @@ -Maint/python 3.13 \ No newline at end of file diff --git a/doc/changelog.d/1019.maintenance.md b/doc/changelog.d/1019.maintenance.md deleted file mode 100644 index 3b6309972f..0000000000 --- a/doc/changelog.d/1019.maintenance.md +++ /dev/null @@ -1 +0,0 @@ -Update LICENSE \ No newline at end of file diff --git a/doc/changelog.d/1020.maintenance.md b/doc/changelog.d/1020.maintenance.md deleted file mode 100644 index e1ddf4c471..0000000000 --- a/doc/changelog.d/1020.maintenance.md +++ /dev/null @@ -1 +0,0 @@ -chore: update CHANGELOG for v0.8.1 \ No newline at end of file diff --git a/doc/changelog.d/1021.dependencies.md b/doc/changelog.d/1021.dependencies.md deleted file mode 100644 index c889568751..0000000000 --- a/doc/changelog.d/1021.dependencies.md +++ /dev/null @@ -1 +0,0 @@ -build(deps): bump the pyvista group with 2 updates \ No newline at end of file diff --git a/doc/changelog.d/1022.dependencies.md b/doc/changelog.d/1022.dependencies.md deleted file mode 100644 index 4b73f70ec7..0000000000 --- a/doc/changelog.d/1022.dependencies.md +++ /dev/null @@ -1 +0,0 @@ -build(deps): bump ansys-sphinx-theme[autoapi] from 1.4.2 to 1.4.4 in the doc-dependencies group \ No newline at end of file diff --git a/doc/changelog.d/1023.documentation.md b/doc/changelog.d/1023.documentation.md deleted file mode 100644 index 93489183ca..0000000000 --- a/doc/changelog.d/1023.documentation.md +++ /dev/null @@ -1 +0,0 @@ -Update index.rst \ No newline at end of file diff --git a/doc/changelog.d/1025.documentation.md b/doc/changelog.d/1025.documentation.md deleted file mode 100644 index c669f3feee..0000000000 --- a/doc/changelog.d/1025.documentation.md +++ /dev/null @@ -1 +0,0 @@ -Docker image \ No newline at end of file diff --git a/doc/changelog.d/1026.miscellaneous.md b/doc/changelog.d/1026.miscellaneous.md deleted file mode 100644 index b6ddcbdade..0000000000 --- a/doc/changelog.d/1026.miscellaneous.md +++ /dev/null @@ -1 +0,0 @@ -fix to remove %s string while printing the server name \ No newline at end of file diff --git a/doc/changelog.d/1027.documentation.md b/doc/changelog.d/1027.documentation.md deleted file mode 100644 index bbef122a0c..0000000000 --- a/doc/changelog.d/1027.documentation.md +++ /dev/null @@ -1 +0,0 @@ -Update shellblcontrolstructs.py \ No newline at end of file diff --git a/doc/changelog.d/1028.documentation.md b/doc/changelog.d/1028.documentation.md deleted file mode 100644 index 4b7148ffcd..0000000000 --- a/doc/changelog.d/1028.documentation.md +++ /dev/null @@ -1 +0,0 @@ -Doc/changes \ No newline at end of file diff --git a/doc/changelog.d/1029.maintenance.md b/doc/changelog.d/1029.maintenance.md deleted file mode 100644 index ff4219e4ea..0000000000 --- a/doc/changelog.d/1029.maintenance.md +++ /dev/null @@ -1 +0,0 @@ -sync up client side changes from release/release-252 \ No newline at end of file diff --git a/doc/changelog.d/1031.maintenance.md b/doc/changelog.d/1031.maintenance.md deleted file mode 100644 index b909647a6a..0000000000 --- a/doc/changelog.d/1031.maintenance.md +++ /dev/null @@ -1 +0,0 @@ -revert the pyproj toml file \ No newline at end of file diff --git a/doc/changelog.d/1032.dependencies.md b/doc/changelog.d/1032.dependencies.md deleted file mode 100644 index 8c7abcba39..0000000000 --- a/doc/changelog.d/1032.dependencies.md +++ /dev/null @@ -1 +0,0 @@ -build(deps): bump ansys-sphinx-theme[autoapi] from 1.4.4 to 1.5.2 in the doc-dependencies group \ No newline at end of file diff --git a/doc/changelog.d/1033.miscellaneous.md b/doc/changelog.d/1033.miscellaneous.md deleted file mode 100644 index 795649406e..0000000000 --- a/doc/changelog.d/1033.miscellaneous.md +++ /dev/null @@ -1 +0,0 @@ -doc fix \ No newline at end of file diff --git a/doc/changelog.d/1034.documentation.md b/doc/changelog.d/1034.documentation.md deleted file mode 100644 index 669619ba68..0000000000 --- a/doc/changelog.d/1034.documentation.md +++ /dev/null @@ -1 +0,0 @@ -Fix docstring \ No newline at end of file diff --git a/doc/changelog.d/1035.documentation.md b/doc/changelog.d/1035.documentation.md deleted file mode 100644 index 0883c6c749..0000000000 --- a/doc/changelog.d/1035.documentation.md +++ /dev/null @@ -1 +0,0 @@ -doc: remove attributes from docs \ No newline at end of file diff --git a/doc/changelog.d/1037.documentation.md b/doc/changelog.d/1037.documentation.md deleted file mode 100644 index 7df19cd975..0000000000 --- a/doc/changelog.d/1037.documentation.md +++ /dev/null @@ -1 +0,0 @@ -fix: Avoid bad `trame-vtk` version \ No newline at end of file diff --git a/doc/changelog.d/1038.maintenance.md b/doc/changelog.d/1038.maintenance.md deleted file mode 100644 index 9071e45eec..0000000000 --- a/doc/changelog.d/1038.maintenance.md +++ /dev/null @@ -1 +0,0 @@ -maint: check vulnerabilities \ No newline at end of file diff --git a/doc/changelog.d/1039.maintenance.md b/doc/changelog.d/1039.maintenance.md deleted file mode 100644 index c1ba7ab0fa..0000000000 --- a/doc/changelog.d/1039.maintenance.md +++ /dev/null @@ -1 +0,0 @@ -maint: create pull_request_template.md \ No newline at end of file diff --git a/doc/changelog.d/1041.maintenance.md b/doc/changelog.d/1041.maintenance.md deleted file mode 100644 index 6ce0b6d34a..0000000000 --- a/doc/changelog.d/1041.maintenance.md +++ /dev/null @@ -1 +0,0 @@ -maint: deploy pr docs \ No newline at end of file diff --git a/doc/changelog.d/1045.maintenance.md b/doc/changelog.d/1045.maintenance.md deleted file mode 100644 index 9e0131f237..0000000000 --- a/doc/changelog.d/1045.maintenance.md +++ /dev/null @@ -1 +0,0 @@ -docs: Update ``CONTRIBUTORS.md`` with the latest contributors \ No newline at end of file diff --git a/doc/changelog.d/1048.miscellaneous.md b/doc/changelog.d/1048.miscellaneous.md deleted file mode 100644 index 08ec7252a8..0000000000 --- a/doc/changelog.d/1048.miscellaneous.md +++ /dev/null @@ -1 +0,0 @@ -Build(deps): bump ansys/actions from 9 to 10 \ No newline at end of file diff --git a/doc/changelog.d/1050.maintenance.md b/doc/changelog.d/1050.maintenance.md deleted file mode 100644 index 123895c039..0000000000 --- a/doc/changelog.d/1050.maintenance.md +++ /dev/null @@ -1 +0,0 @@ -maint: temporary numpy fix \ No newline at end of file diff --git a/doc/changelog.d/1051.documentation.md b/doc/changelog.d/1051.documentation.md deleted file mode 100644 index 8fd6a5ce01..0000000000 --- a/doc/changelog.d/1051.documentation.md +++ /dev/null @@ -1 +0,0 @@ -docs: remove extra colon in api docs \ No newline at end of file diff --git a/doc/changelog.d/1052.fixed.md b/doc/changelog.d/1052.fixed.md deleted file mode 100644 index dd7871e3f2..0000000000 --- a/doc/changelog.d/1052.fixed.md +++ /dev/null @@ -1 +0,0 @@ -fix: Revert napoleon extension \ No newline at end of file diff --git a/doc/changelog.d/1060.dependencies.md b/doc/changelog.d/1060.dependencies.md deleted file mode 100644 index f7544789e4..0000000000 --- a/doc/changelog.d/1060.dependencies.md +++ /dev/null @@ -1 +0,0 @@ -build(deps): bump the test-dependencies group across 1 directory with 2 updates \ No newline at end of file diff --git a/doc/changelog.d/1065.miscellaneous.md b/doc/changelog.d/1065.miscellaneous.md deleted file mode 100644 index a04218191e..0000000000 --- a/doc/changelog.d/1065.miscellaneous.md +++ /dev/null @@ -1 +0,0 @@ -Build(deps): bump pytest from 8.4.0 to 8.4.1 in the test-dependencies group \ No newline at end of file diff --git a/doc/changelog.d/1068.miscellaneous.md b/doc/changelog.d/1068.miscellaneous.md deleted file mode 100644 index 21db96383b..0000000000 --- a/doc/changelog.d/1068.miscellaneous.md +++ /dev/null @@ -1 +0,0 @@ -Chore: update security.md \ No newline at end of file diff --git a/doc/changelog.d/1071.miscellaneous.md b/doc/changelog.d/1071.miscellaneous.md deleted file mode 100644 index c4a2b4bfea..0000000000 --- a/doc/changelog.d/1071.miscellaneous.md +++ /dev/null @@ -1 +0,0 @@ -Doc: adding deep wiki link \ No newline at end of file diff --git a/doc/changelog.d/980.documentation.md b/doc/changelog.d/980.documentation.md deleted file mode 100644 index e6eaf87075..0000000000 --- a/doc/changelog.d/980.documentation.md +++ /dev/null @@ -1 +0,0 @@ -Update fileio.rst \ No newline at end of file diff --git a/doc/changelog.d/988.maintenance.md b/doc/changelog.d/988.maintenance.md deleted file mode 100644 index bf6ebae267..0000000000 --- a/doc/changelog.d/988.maintenance.md +++ /dev/null @@ -1 +0,0 @@ -chore: update CHANGELOG for v0.8.0 \ No newline at end of file diff --git a/doc/changelog.d/990.dependencies.md b/doc/changelog.d/990.dependencies.md deleted file mode 100644 index 4d741d4940..0000000000 --- a/doc/changelog.d/990.dependencies.md +++ /dev/null @@ -1 +0,0 @@ -build(deps): bump sphinx from 8.2.1 to 8.2.3 in the doc-dependencies group \ No newline at end of file diff --git a/doc/changelog.d/992.dependencies.md b/doc/changelog.d/992.dependencies.md deleted file mode 100644 index 4272ef36cd..0000000000 --- a/doc/changelog.d/992.dependencies.md +++ /dev/null @@ -1 +0,0 @@ -build(deps): bump ansys-sphinx-theme[autoapi] from 1.3.2 to 1.3.3 in the doc-dependencies group \ No newline at end of file diff --git a/doc/changelog.d/993.dependencies.md b/doc/changelog.d/993.dependencies.md deleted file mode 100644 index f7544789e4..0000000000 --- a/doc/changelog.d/993.dependencies.md +++ /dev/null @@ -1 +0,0 @@ -build(deps): bump the test-dependencies group across 1 directory with 2 updates \ No newline at end of file diff --git a/doc/changelog.d/994.dependencies.md b/doc/changelog.d/994.dependencies.md deleted file mode 100644 index 6b2a851b28..0000000000 --- a/doc/changelog.d/994.dependencies.md +++ /dev/null @@ -1 +0,0 @@ -build(deps): bump ansys-sphinx-theme[autoapi] from 1.3.3 to 1.4.2 in the doc-dependencies group \ No newline at end of file diff --git a/doc/changelog.d/995.maintenance.md b/doc/changelog.d/995.maintenance.md deleted file mode 100644 index 9e0131f237..0000000000 --- a/doc/changelog.d/995.maintenance.md +++ /dev/null @@ -1 +0,0 @@ -docs: Update ``CONTRIBUTORS.md`` with the latest contributors \ No newline at end of file diff --git a/doc/changelog.d/996.dependencies.md b/doc/changelog.d/996.dependencies.md deleted file mode 100644 index 5026a35c9e..0000000000 --- a/doc/changelog.d/996.dependencies.md +++ /dev/null @@ -1 +0,0 @@ -build(deps): bump pytest-cov from 6.0.0 to 6.1.1 in the test-dependencies group \ No newline at end of file diff --git a/doc/changelog.d/999.dependencies.md b/doc/changelog.d/999.dependencies.md deleted file mode 100644 index 420b96327e..0000000000 --- a/doc/changelog.d/999.dependencies.md +++ /dev/null @@ -1 +0,0 @@ -build(deps): bump ansys/actions from 8 to 9 \ No newline at end of file diff --git a/doc/source/_templates/autosummary/class.rst b/doc/source/_templates/autosummary/class.rst index a6dd4f11b6..c4eed9a4a3 100644 --- a/doc/source/_templates/autosummary/class.rst +++ b/doc/source/_templates/autosummary/class.rst @@ -1,26 +1,21 @@ .. vale off -{% set excluded_attrs = ['real', 'imag', 'numerator', 'denominator'] %} - -{% set excluded_methods = ['__init__', 'bit_length', 'conjugate', 'from_bytes', 'to_bytes', 'bit_count', 'as_integer_ratio', 'is_integer'] %} - -{% set filtered_methods = methods | reject('in', excluded_methods) | list %} {{ name | escape | underline}} .. currentmodule:: {{ module }} .. autoclass:: {{ objname }} - + {% block methods %} - {% if filtered_methods %} + {% if methods %} .. rubric:: {{ _('Methods') }} .. autosummary:: :toctree: - {% for item in filtered_methods %} -    {{ name }}.{{ item }} + {% for item in methods %} + {% if item != '__init__' %}{{ name }}.{{ item }}{% endif %} {%- endfor %} {% endif %} {% endblock %} @@ -32,9 +27,7 @@ .. autosummary:: :toctree: {% for item in attributes %} - {% if item not in excluded_attrs %} {{ name }}.{{ item }} - {% endif %} {%- endfor %} {% endif %} {% endblock %} diff --git a/doc/source/conf.py b/doc/source/conf.py index 0ef0e741be..8caa84c0e9 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -32,6 +32,7 @@ "github_repo": "pyprimemesh", "github_version": "main", "doc_path": "doc/source", + "pyansys_tags": ["CAD", "Meshing"], } # specify the location of your github repo @@ -40,8 +41,6 @@ "json_url": f"https://{cname}/versions.json", "version_match": get_version_match(__version__), }, - "check_switcher": False, - "navbar_end": ["version-switcher", "theme-switcher", "navbar-icon-links"], "navigation_with_keys": False, "github_url": "https://github.com/ansys/pyprimemesh", "show_prev_next": False, diff --git a/doc/source/getting_started/index.rst b/doc/source/getting_started/index.rst index 4f59d45fe3..e7c5754a7f 100644 --- a/doc/source/getting_started/index.rst +++ b/doc/source/getting_started/index.rst @@ -168,7 +168,7 @@ for the Ansys Prime Server and install this image. .. code-block:: pycon - docker pull ghcr.io/ansys/prime:25.2.0 + docker pull ghcr.io/ansys/prime:25.2.2 Build the Ansys Prime Server linux container diff --git a/docker/build_docker_linux.py b/docker/build_docker_linux.py index 419f991588..beeaa76ff8 100644 --- a/docker/build_docker_linux.py +++ b/docker/build_docker_linux.py @@ -144,7 +144,7 @@ def create_docker_image(dest_package_path): # Build the docker image print(">>> Building docker image. This might take some time...") out = subprocess.run( - ["docker", "build", "-f", "linux/Dockerfile", "-t", "ghcr.io/ansys/prime:latest", "."], + ["docker", "build", "-f", "linux/Dockerfile", "-t", "ghcr.io/ansys/prime:25.2.2.dev0", "."], cwd=os.path.dirname(os.path.abspath(__file__)), capture_output=True, ) diff --git a/pyproject.toml b/pyproject.toml index 02b9dc5c62..85cfcd26f4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ansys-meshing-prime" -version = "0.9.0.dev3" +version = "0.9.3" description = "PyPrimeMesh is a Python client to Ansys Prime Server, which delivers core Ansys meshing technology." readme = "README.md" requires-python = ">=3.10,<4" @@ -42,7 +42,7 @@ tests = [ "pyvista[trame]==0.45.2", ] doc = [ - "ansys-sphinx-theme[autoapi]==1.5.2", + "ansys-sphinx-theme[autoapi]==1.6.1", "ansys-tools-visualization-interface==0.9.2", "jupyter-sphinx==0.5.3", "numpydoc==1.8.0", diff --git a/src/ansys/meshing/prime/autogen/fileiostructs.py b/src/ansys/meshing/prime/autogen/fileiostructs.py index 7d7f2b9d90..a972cd920e 100644 --- a/src/ansys/meshing/prime/autogen/fileiostructs.py +++ b/src/ansys/meshing/prime/autogen/fileiostructs.py @@ -3460,6 +3460,14 @@ class ExportMapdlCdbParams(CoreObject): separate_blocks_format_type: SeparateBlocksFormatType, optional Controls the format type when writing separate element blocks. Only used when write_separate_blocks is true. + **This is a beta parameter**. **The behavior and name may change in the future**. + export_tie_as_cntgen: bool, optional + Option to export ties as cntgen. When true, translates ties and contact pairs into compact cntgen blocks in the exported file. The default value is false. + + **This is a beta parameter**. **The behavior and name may change in the future**. + export_coupling_as_sfcgen: bool, optional + Option to export coupling as sfcgen. When true, translates kinematic or distributing coupling into compact sfcgen blocks in the exported file. The default value is false. + **This is a beta parameter**. **The behavior and name may change in the future**. export_fasteners_as_swgen: bool, optional Option to export fasteners as swgen. When true, translates fasteners into compact swgen blocks in the exported file. The default value is false. @@ -3484,6 +3492,14 @@ class ExportMapdlCdbParams(CoreObject): contact_element_types: ContactElementTypeParams, optional Parameters for choosing element types for contact surfaces in TIEs and CONTACT PAIRs. + **This is a beta parameter**. **The behavior and name may change in the future**. + reorder_spotweldsurface: bool, optional + Parameters to choose the logic of spotweld computation. When false, computes spotwelds by prioritzing proximity of surface to spotweld. When true, computes spotwelds by prioritizing proximity of boundary surface to spotweld. + + **This is a beta parameter**. **The behavior and name may change in the future**. + skip_comments: bool, optional + Parameter to skip export of comments to the exported file. + **This is a beta parameter**. **The behavior and name may change in the future**. json_data: dict, optional JSON dictionary to create a ``ExportMapdlCdbParams`` object with provided parameters. @@ -3512,12 +3528,16 @@ def __initialize( write_separate_blocks: bool, write_components_with_element_blocks: bool, separate_blocks_format_type: SeparateBlocksFormatType, + export_tie_as_cntgen: bool, + export_coupling_as_sfcgen: bool, export_fasteners_as_swgen: bool, export_rigid_bodies_as_rbgen: bool, write_component_based_ties: bool, mortar_contact_for_ties: bool, write_thickness_file: bool, - contact_element_types: ContactElementTypeParams): + contact_element_types: ContactElementTypeParams, + reorder_spotweldsurface: bool, + skip_comments: bool): self._config_settings = config_settings self._pre_solution_settings = pre_solution_settings self._material_properties = material_properties @@ -3534,12 +3554,16 @@ def __initialize( self._write_separate_blocks = write_separate_blocks self._write_components_with_element_blocks = write_components_with_element_blocks self._separate_blocks_format_type = SeparateBlocksFormatType(separate_blocks_format_type) + self._export_tie_as_cntgen = export_tie_as_cntgen + self._export_coupling_as_sfcgen = export_coupling_as_sfcgen self._export_fasteners_as_swgen = export_fasteners_as_swgen self._export_rigid_bodies_as_rbgen = export_rigid_bodies_as_rbgen self._write_component_based_ties = write_component_based_ties self._mortar_contact_for_ties = mortar_contact_for_ties self._write_thickness_file = write_thickness_file self._contact_element_types = contact_element_types + self._reorder_spotweldsurface = reorder_spotweldsurface + self._skip_comments = skip_comments def __init__( self, @@ -3560,12 +3584,16 @@ def __init__( write_separate_blocks: bool = None, write_components_with_element_blocks: bool = None, separate_blocks_format_type: SeparateBlocksFormatType = None, + export_tie_as_cntgen: bool = None, + export_coupling_as_sfcgen: bool = None, export_fasteners_as_swgen: bool = None, export_rigid_bodies_as_rbgen: bool = None, write_component_based_ties: bool = None, mortar_contact_for_ties: bool = None, write_thickness_file: bool = None, contact_element_types: ContactElementTypeParams = None, + reorder_spotweldsurface: bool = None, + skip_comments: bool = None, json_data : dict = None, **kwargs): """Initialize a ``ExportMapdlCdbParams`` object. @@ -3637,6 +3665,14 @@ def __init__( separate_blocks_format_type: SeparateBlocksFormatType, optional Controls the format type when writing separate element blocks. Only used when write_separate_blocks is true. + **This is a beta parameter**. **The behavior and name may change in the future**. + export_tie_as_cntgen: bool, optional + Option to export ties as cntgen. When true, translates ties and contact pairs into compact cntgen blocks in the exported file. The default value is false. + + **This is a beta parameter**. **The behavior and name may change in the future**. + export_coupling_as_sfcgen: bool, optional + Option to export coupling as sfcgen. When true, translates kinematic or distributing coupling into compact sfcgen blocks in the exported file. The default value is false. + **This is a beta parameter**. **The behavior and name may change in the future**. export_fasteners_as_swgen: bool, optional Option to export fasteners as swgen. When true, translates fasteners into compact swgen blocks in the exported file. The default value is false. @@ -3661,6 +3697,14 @@ def __init__( contact_element_types: ContactElementTypeParams, optional Parameters for choosing element types for contact surfaces in TIEs and CONTACT PAIRs. + **This is a beta parameter**. **The behavior and name may change in the future**. + reorder_spotweldsurface: bool, optional + Parameters to choose the logic of spotweld computation. When false, computes spotwelds by prioritzing proximity of surface to spotweld. When true, computes spotwelds by prioritizing proximity of boundary surface to spotweld. + + **This is a beta parameter**. **The behavior and name may change in the future**. + skip_comments: bool, optional + Parameter to skip export of comments to the exported file. + **This is a beta parameter**. **The behavior and name may change in the future**. json_data: dict, optional JSON dictionary to create a ``ExportMapdlCdbParams`` object with provided parameters. @@ -3687,14 +3731,18 @@ def __init__( json_data["writeSeparateBlocks"] if "writeSeparateBlocks" in json_data else None, json_data["writeComponentsWithElementBlocks"] if "writeComponentsWithElementBlocks" in json_data else None, SeparateBlocksFormatType(json_data["separateBlocksFormatType"] if "separateBlocksFormatType" in json_data else None), + json_data["exportTieAsCntgen"] if "exportTieAsCntgen" in json_data else None, + json_data["exportCouplingAsSfcgen"] if "exportCouplingAsSfcgen" in json_data else None, json_data["exportFastenersAsSwgen"] if "exportFastenersAsSwgen" in json_data else None, json_data["exportRigidBodiesAsRbgen"] if "exportRigidBodiesAsRbgen" in json_data else None, json_data["writeComponentBasedTies"] if "writeComponentBasedTies" in json_data else None, json_data["mortarContactForTies"] if "mortarContactForTies" in json_data else None, json_data["writeThicknessFile"] if "writeThicknessFile" in json_data else None, - ContactElementTypeParams(model = model, json_data = json_data["contactElementTypes"] if "contactElementTypes" in json_data else None)) + ContactElementTypeParams(model = model, json_data = json_data["contactElementTypes"] if "contactElementTypes" in json_data else None), + json_data["reorderSpotweldsurface"] if "reorderSpotweldsurface" in json_data else None, + json_data["skipComments"] if "skipComments" in json_data else None) else: - all_field_specified = all(arg is not None for arg in [config_settings, pre_solution_settings, material_properties, boundary_conditions, analysis_settings, write_cells, enable_face_based_labels, label_export_params, write_by_zones, consider_general_connectors_as_spot_weld, analysis_type, simulation_type, analysis_settings_file_name, write_separate_blocks, write_components_with_element_blocks, separate_blocks_format_type, export_fasteners_as_swgen, export_rigid_bodies_as_rbgen, write_component_based_ties, mortar_contact_for_ties, write_thickness_file, contact_element_types]) + all_field_specified = all(arg is not None for arg in [config_settings, pre_solution_settings, material_properties, boundary_conditions, analysis_settings, write_cells, enable_face_based_labels, label_export_params, write_by_zones, consider_general_connectors_as_spot_weld, analysis_type, simulation_type, analysis_settings_file_name, write_separate_blocks, write_components_with_element_blocks, separate_blocks_format_type, export_tie_as_cntgen, export_coupling_as_sfcgen, export_fasteners_as_swgen, export_rigid_bodies_as_rbgen, write_component_based_ties, mortar_contact_for_ties, write_thickness_file, contact_element_types, reorder_spotweldsurface, skip_comments]) if all_field_specified: self.__initialize( config_settings, @@ -3713,12 +3761,16 @@ def __init__( write_separate_blocks, write_components_with_element_blocks, separate_blocks_format_type, + export_tie_as_cntgen, + export_coupling_as_sfcgen, export_fasteners_as_swgen, export_rigid_bodies_as_rbgen, write_component_based_ties, mortar_contact_for_ties, write_thickness_file, - contact_element_types) + contact_element_types, + reorder_spotweldsurface, + skip_comments) else: if model is None: raise ValueError("Invalid assignment. Either pass a model or specify all properties.") @@ -3742,12 +3794,16 @@ def __init__( write_separate_blocks if write_separate_blocks is not None else ( ExportMapdlCdbParams._default_params["write_separate_blocks"] if "write_separate_blocks" in ExportMapdlCdbParams._default_params else (json_data["writeSeparateBlocks"] if "writeSeparateBlocks" in json_data else None)), write_components_with_element_blocks if write_components_with_element_blocks is not None else ( ExportMapdlCdbParams._default_params["write_components_with_element_blocks"] if "write_components_with_element_blocks" in ExportMapdlCdbParams._default_params else (json_data["writeComponentsWithElementBlocks"] if "writeComponentsWithElementBlocks" in json_data else None)), separate_blocks_format_type if separate_blocks_format_type is not None else ( ExportMapdlCdbParams._default_params["separate_blocks_format_type"] if "separate_blocks_format_type" in ExportMapdlCdbParams._default_params else SeparateBlocksFormatType(json_data["separateBlocksFormatType"] if "separateBlocksFormatType" in json_data else None)), + export_tie_as_cntgen if export_tie_as_cntgen is not None else ( ExportMapdlCdbParams._default_params["export_tie_as_cntgen"] if "export_tie_as_cntgen" in ExportMapdlCdbParams._default_params else (json_data["exportTieAsCntgen"] if "exportTieAsCntgen" in json_data else None)), + export_coupling_as_sfcgen if export_coupling_as_sfcgen is not None else ( ExportMapdlCdbParams._default_params["export_coupling_as_sfcgen"] if "export_coupling_as_sfcgen" in ExportMapdlCdbParams._default_params else (json_data["exportCouplingAsSfcgen"] if "exportCouplingAsSfcgen" in json_data else None)), export_fasteners_as_swgen if export_fasteners_as_swgen is not None else ( ExportMapdlCdbParams._default_params["export_fasteners_as_swgen"] if "export_fasteners_as_swgen" in ExportMapdlCdbParams._default_params else (json_data["exportFastenersAsSwgen"] if "exportFastenersAsSwgen" in json_data else None)), export_rigid_bodies_as_rbgen if export_rigid_bodies_as_rbgen is not None else ( ExportMapdlCdbParams._default_params["export_rigid_bodies_as_rbgen"] if "export_rigid_bodies_as_rbgen" in ExportMapdlCdbParams._default_params else (json_data["exportRigidBodiesAsRbgen"] if "exportRigidBodiesAsRbgen" in json_data else None)), write_component_based_ties if write_component_based_ties is not None else ( ExportMapdlCdbParams._default_params["write_component_based_ties"] if "write_component_based_ties" in ExportMapdlCdbParams._default_params else (json_data["writeComponentBasedTies"] if "writeComponentBasedTies" in json_data else None)), mortar_contact_for_ties if mortar_contact_for_ties is not None else ( ExportMapdlCdbParams._default_params["mortar_contact_for_ties"] if "mortar_contact_for_ties" in ExportMapdlCdbParams._default_params else (json_data["mortarContactForTies"] if "mortarContactForTies" in json_data else None)), write_thickness_file if write_thickness_file is not None else ( ExportMapdlCdbParams._default_params["write_thickness_file"] if "write_thickness_file" in ExportMapdlCdbParams._default_params else (json_data["writeThicknessFile"] if "writeThicknessFile" in json_data else None)), - contact_element_types if contact_element_types is not None else ( ExportMapdlCdbParams._default_params["contact_element_types"] if "contact_element_types" in ExportMapdlCdbParams._default_params else ContactElementTypeParams(model = model, json_data = (json_data["contactElementTypes"] if "contactElementTypes" in json_data else None)))) + contact_element_types if contact_element_types is not None else ( ExportMapdlCdbParams._default_params["contact_element_types"] if "contact_element_types" in ExportMapdlCdbParams._default_params else ContactElementTypeParams(model = model, json_data = (json_data["contactElementTypes"] if "contactElementTypes" in json_data else None))), + reorder_spotweldsurface if reorder_spotweldsurface is not None else ( ExportMapdlCdbParams._default_params["reorder_spotweldsurface"] if "reorder_spotweldsurface" in ExportMapdlCdbParams._default_params else (json_data["reorderSpotweldsurface"] if "reorderSpotweldsurface" in json_data else None)), + skip_comments if skip_comments is not None else ( ExportMapdlCdbParams._default_params["skip_comments"] if "skip_comments" in ExportMapdlCdbParams._default_params else (json_data["skipComments"] if "skipComments" in json_data else None))) self._custom_params = kwargs if model is not None: [ model._logger.warning(f'Unsupported argument : {key}') for key in kwargs ] @@ -3773,12 +3829,16 @@ def set_default( write_separate_blocks: bool = None, write_components_with_element_blocks: bool = None, separate_blocks_format_type: SeparateBlocksFormatType = None, + export_tie_as_cntgen: bool = None, + export_coupling_as_sfcgen: bool = None, export_fasteners_as_swgen: bool = None, export_rigid_bodies_as_rbgen: bool = None, write_component_based_ties: bool = None, mortar_contact_for_ties: bool = None, write_thickness_file: bool = None, - contact_element_types: ContactElementTypeParams = None): + contact_element_types: ContactElementTypeParams = None, + reorder_spotweldsurface: bool = None, + skip_comments: bool = None): """Set the default values of the ``ExportMapdlCdbParams`` object. Parameters @@ -3815,6 +3875,10 @@ def set_default( Controls whether component definitions should be written within individual element blocks. write_components_with_element_blocks only has effect when write_separate_blocks is true. When write_components_with_element_blocks is true, writes component commands for each element block. When write_components_with_element_blocks is false, writes components separately. separate_blocks_format_type: SeparateBlocksFormatType, optional Controls the format type when writing separate element blocks. Only used when write_separate_blocks is true. + export_tie_as_cntgen: bool, optional + Option to export ties as cntgen. When true, translates ties and contact pairs into compact cntgen blocks in the exported file. The default value is false. + export_coupling_as_sfcgen: bool, optional + Option to export coupling as sfcgen. When true, translates kinematic or distributing coupling into compact sfcgen blocks in the exported file. The default value is false. export_fasteners_as_swgen: bool, optional Option to export fasteners as swgen. When true, translates fasteners into compact swgen blocks in the exported file. The default value is false. export_rigid_bodies_as_rbgen: bool, optional @@ -3827,6 +3891,10 @@ def set_default( Option to write a thickness file for spotweld fatigue analysis. If true, writes a file named [exportedFilename].cdb.thick.txt containing thickness information. contact_element_types: ContactElementTypeParams, optional Parameters for choosing element types for contact surfaces in TIEs and CONTACT PAIRs. + reorder_spotweldsurface: bool, optional + Parameters to choose the logic of spotweld computation. When false, computes spotwelds by prioritzing proximity of surface to spotweld. When true, computes spotwelds by prioritizing proximity of boundary surface to spotweld. + skip_comments: bool, optional + Parameter to skip export of comments to the exported file. """ args = locals() [ExportMapdlCdbParams._default_params.update({ key: value }) for key, value in args.items() if value is not None] @@ -3877,6 +3945,10 @@ def _jsonify(self) -> Dict[str, Any]: json_data["writeComponentsWithElementBlocks"] = self._write_components_with_element_blocks if self._separate_blocks_format_type is not None: json_data["separateBlocksFormatType"] = self._separate_blocks_format_type + if self._export_tie_as_cntgen is not None: + json_data["exportTieAsCntgen"] = self._export_tie_as_cntgen + if self._export_coupling_as_sfcgen is not None: + json_data["exportCouplingAsSfcgen"] = self._export_coupling_as_sfcgen if self._export_fasteners_as_swgen is not None: json_data["exportFastenersAsSwgen"] = self._export_fasteners_as_swgen if self._export_rigid_bodies_as_rbgen is not None: @@ -3889,11 +3961,15 @@ def _jsonify(self) -> Dict[str, Any]: json_data["writeThicknessFile"] = self._write_thickness_file if self._contact_element_types is not None: json_data["contactElementTypes"] = self._contact_element_types._jsonify() + if self._reorder_spotweldsurface is not None: + json_data["reorderSpotweldsurface"] = self._reorder_spotweldsurface + if self._skip_comments is not None: + json_data["skipComments"] = self._skip_comments [ json_data.update({ utils.to_camel_case(key) : value }) for key, value in self._custom_params.items()] return json_data def __str__(self) -> str: - message = "config_settings : %s\npre_solution_settings : %s\nmaterial_properties : %s\nboundary_conditions : %s\nanalysis_settings : %s\nwrite_cells : %s\nenable_face_based_labels : %s\nlabel_export_params : %s\nwrite_by_zones : %s\nconsider_general_connectors_as_spot_weld : %s\nanalysis_type : %s\nsimulation_type : %s\nanalysis_settings_file_name : %s\nwrite_separate_blocks : %s\nwrite_components_with_element_blocks : %s\nseparate_blocks_format_type : %s\nexport_fasteners_as_swgen : %s\nexport_rigid_bodies_as_rbgen : %s\nwrite_component_based_ties : %s\nmortar_contact_for_ties : %s\nwrite_thickness_file : %s\ncontact_element_types : %s" % (self._config_settings, self._pre_solution_settings, self._material_properties, self._boundary_conditions, self._analysis_settings, self._write_cells, self._enable_face_based_labels, '{ ' + str(self._label_export_params) + ' }', self._write_by_zones, self._consider_general_connectors_as_spot_weld, self._analysis_type, self._simulation_type, self._analysis_settings_file_name, self._write_separate_blocks, self._write_components_with_element_blocks, self._separate_blocks_format_type, self._export_fasteners_as_swgen, self._export_rigid_bodies_as_rbgen, self._write_component_based_ties, self._mortar_contact_for_ties, self._write_thickness_file, '{ ' + str(self._contact_element_types) + ' }') + message = "config_settings : %s\npre_solution_settings : %s\nmaterial_properties : %s\nboundary_conditions : %s\nanalysis_settings : %s\nwrite_cells : %s\nenable_face_based_labels : %s\nlabel_export_params : %s\nwrite_by_zones : %s\nconsider_general_connectors_as_spot_weld : %s\nanalysis_type : %s\nsimulation_type : %s\nanalysis_settings_file_name : %s\nwrite_separate_blocks : %s\nwrite_components_with_element_blocks : %s\nseparate_blocks_format_type : %s\nexport_tie_as_cntgen : %s\nexport_coupling_as_sfcgen : %s\nexport_fasteners_as_swgen : %s\nexport_rigid_bodies_as_rbgen : %s\nwrite_component_based_ties : %s\nmortar_contact_for_ties : %s\nwrite_thickness_file : %s\ncontact_element_types : %s\nreorder_spotweldsurface : %s\nskip_comments : %s" % (self._config_settings, self._pre_solution_settings, self._material_properties, self._boundary_conditions, self._analysis_settings, self._write_cells, self._enable_face_based_labels, '{ ' + str(self._label_export_params) + ' }', self._write_by_zones, self._consider_general_connectors_as_spot_weld, self._analysis_type, self._simulation_type, self._analysis_settings_file_name, self._write_separate_blocks, self._write_components_with_element_blocks, self._separate_blocks_format_type, self._export_tie_as_cntgen, self._export_coupling_as_sfcgen, self._export_fasteners_as_swgen, self._export_rigid_bodies_as_rbgen, self._write_component_based_ties, self._mortar_contact_for_ties, self._write_thickness_file, '{ ' + str(self._contact_element_types) + ' }', self._reorder_spotweldsurface, self._skip_comments) message += ''.join('\n' + str(key) + ' : ' + str(value) for key, value in self._custom_params.items()) return message @@ -4089,6 +4165,30 @@ def separate_blocks_format_type(self) -> SeparateBlocksFormatType: def separate_blocks_format_type(self, value: SeparateBlocksFormatType): self._separate_blocks_format_type = value + @property + def export_tie_as_cntgen(self) -> bool: + """Option to export ties as cntgen. When true, translates ties and contact pairs into compact cntgen blocks in the exported file. The default value is false. + + **This is a beta parameter**. **The behavior and name may change in the future**. + """ + return self._export_tie_as_cntgen + + @export_tie_as_cntgen.setter + def export_tie_as_cntgen(self, value: bool): + self._export_tie_as_cntgen = value + + @property + def export_coupling_as_sfcgen(self) -> bool: + """Option to export coupling as sfcgen. When true, translates kinematic or distributing coupling into compact sfcgen blocks in the exported file. The default value is false. + + **This is a beta parameter**. **The behavior and name may change in the future**. + """ + return self._export_coupling_as_sfcgen + + @export_coupling_as_sfcgen.setter + def export_coupling_as_sfcgen(self, value: bool): + self._export_coupling_as_sfcgen = value + @property def export_fasteners_as_swgen(self) -> bool: """Option to export fasteners as swgen. When true, translates fasteners into compact swgen blocks in the exported file. The default value is false. @@ -4161,6 +4261,30 @@ def contact_element_types(self) -> ContactElementTypeParams: def contact_element_types(self, value: ContactElementTypeParams): self._contact_element_types = value + @property + def reorder_spotweldsurface(self) -> bool: + """Parameters to choose the logic of spotweld computation. When false, computes spotwelds by prioritzing proximity of surface to spotweld. When true, computes spotwelds by prioritizing proximity of boundary surface to spotweld. + + **This is a beta parameter**. **The behavior and name may change in the future**. + """ + return self._reorder_spotweldsurface + + @reorder_spotweldsurface.setter + def reorder_spotweldsurface(self, value: bool): + self._reorder_spotweldsurface = value + + @property + def skip_comments(self) -> bool: + """Parameter to skip export of comments to the exported file. + + **This is a beta parameter**. **The behavior and name may change in the future**. + """ + return self._skip_comments + + @skip_comments.setter + def skip_comments(self, value: bool): + self._skip_comments = value + class ExportMapdlCdbResults(CoreObject): """Results associated with the MAPDL CDB export. @@ -4171,6 +4295,10 @@ class ExportMapdlCdbResults(CoreObject): summary_log: str, optional Summary log for the export operation in json format. + **This is a beta parameter**. **The behavior and name may change in the future**. + formatted_summary_log: str, optional + Formatted summary log for the export operation. + **This is a beta parameter**. **The behavior and name may change in the future**. zone_mesh_results: List[ZoneMeshResult], optional Zone-wise mesh information for elements in the exported model. @@ -4194,10 +4322,12 @@ class ExportMapdlCdbResults(CoreObject): def __initialize( self, summary_log: str, + formatted_summary_log: str, zone_mesh_results: List[ZoneMeshResult], error_code: ErrorCode, warning_codes: List[WarningCode]): self._summary_log = summary_log + self._formatted_summary_log = formatted_summary_log self._zone_mesh_results = zone_mesh_results self._error_code = ErrorCode(error_code) self._warning_codes = warning_codes @@ -4206,6 +4336,7 @@ def __init__( self, model: CommunicationManager=None, summary_log: str = None, + formatted_summary_log: str = None, zone_mesh_results: List[ZoneMeshResult] = None, error_code: ErrorCode = None, warning_codes: List[WarningCode] = None, @@ -4220,6 +4351,10 @@ def __init__( summary_log: str, optional Summary log for the export operation in json format. + **This is a beta parameter**. **The behavior and name may change in the future**. + formatted_summary_log: str, optional + Formatted summary log for the export operation. + **This is a beta parameter**. **The behavior and name may change in the future**. zone_mesh_results: List[ZoneMeshResult], optional Zone-wise mesh information for elements in the exported model. @@ -4241,14 +4376,16 @@ def __init__( if json_data: self.__initialize( json_data["summaryLog"] if "summaryLog" in json_data else None, + json_data["formattedSummaryLog"] if "formattedSummaryLog" in json_data else None, [ZoneMeshResult(model = model, json_data = data) for data in json_data["zoneMeshResults"]] if "zoneMeshResults" in json_data else None, ErrorCode(json_data["errorCode"] if "errorCode" in json_data else None), [WarningCode(data) for data in json_data["warningCodes"]] if "warningCodes" in json_data else None) else: - all_field_specified = all(arg is not None for arg in [summary_log, zone_mesh_results, error_code, warning_codes]) + all_field_specified = all(arg is not None for arg in [summary_log, formatted_summary_log, zone_mesh_results, error_code, warning_codes]) if all_field_specified: self.__initialize( summary_log, + formatted_summary_log, zone_mesh_results, error_code, warning_codes) @@ -4260,6 +4397,7 @@ def __init__( json_data = param_json["ExportMapdlCdbResults"] if "ExportMapdlCdbResults" in param_json else {} self.__initialize( summary_log if summary_log is not None else ( ExportMapdlCdbResults._default_params["summary_log"] if "summary_log" in ExportMapdlCdbResults._default_params else (json_data["summaryLog"] if "summaryLog" in json_data else None)), + formatted_summary_log if formatted_summary_log is not None else ( ExportMapdlCdbResults._default_params["formatted_summary_log"] if "formatted_summary_log" in ExportMapdlCdbResults._default_params else (json_data["formattedSummaryLog"] if "formattedSummaryLog" in json_data else None)), zone_mesh_results if zone_mesh_results is not None else ( ExportMapdlCdbResults._default_params["zone_mesh_results"] if "zone_mesh_results" in ExportMapdlCdbResults._default_params else [ZoneMeshResult(model = model, json_data = data) for data in (json_data["zoneMeshResults"] if "zoneMeshResults" in json_data else None)]), error_code if error_code is not None else ( ExportMapdlCdbResults._default_params["error_code"] if "error_code" in ExportMapdlCdbResults._default_params else ErrorCode(json_data["errorCode"] if "errorCode" in json_data else None)), warning_codes if warning_codes is not None else ( ExportMapdlCdbResults._default_params["warning_codes"] if "warning_codes" in ExportMapdlCdbResults._default_params else [WarningCode(data) for data in (json_data["warningCodes"] if "warningCodes" in json_data else None)])) @@ -4273,6 +4411,7 @@ def __init__( @staticmethod def set_default( summary_log: str = None, + formatted_summary_log: str = None, zone_mesh_results: List[ZoneMeshResult] = None, error_code: ErrorCode = None, warning_codes: List[WarningCode] = None): @@ -4282,6 +4421,8 @@ def set_default( ---------- summary_log: str, optional Summary log for the export operation in json format. + formatted_summary_log: str, optional + Formatted summary log for the export operation. zone_mesh_results: List[ZoneMeshResult], optional Zone-wise mesh information for elements in the exported model. error_code: ErrorCode, optional @@ -4308,6 +4449,8 @@ def _jsonify(self) -> Dict[str, Any]: json_data = {} if self._summary_log is not None: json_data["summaryLog"] = self._summary_log + if self._formatted_summary_log is not None: + json_data["formattedSummaryLog"] = self._formatted_summary_log if self._zone_mesh_results is not None: json_data["zoneMeshResults"] = [data._jsonify() for data in self._zone_mesh_results] if self._error_code is not None: @@ -4318,7 +4461,7 @@ def _jsonify(self) -> Dict[str, Any]: return json_data def __str__(self) -> str: - message = "summary_log : %s\nzone_mesh_results : %s\nerror_code : %s\nwarning_codes : %s" % (self._summary_log, '[' + ''.join('\n' + str(data) for data in self._zone_mesh_results) + ']', self._error_code, '[' + ''.join('\n' + str(data) for data in self._warning_codes) + ']') + message = "summary_log : %s\nformatted_summary_log : %s\nzone_mesh_results : %s\nerror_code : %s\nwarning_codes : %s" % (self._summary_log, self._formatted_summary_log, '[' + ''.join('\n' + str(data) for data in self._zone_mesh_results) + ']', self._error_code, '[' + ''.join('\n' + str(data) for data in self._warning_codes) + ']') message += ''.join('\n' + str(key) + ' : ' + str(value) for key, value in self._custom_params.items()) return message @@ -4334,6 +4477,18 @@ def summary_log(self) -> str: def summary_log(self, value: str): self._summary_log = value + @property + def formatted_summary_log(self) -> str: + """Formatted summary log for the export operation. + + **This is a beta parameter**. **The behavior and name may change in the future**. + """ + return self._formatted_summary_log + + @formatted_summary_log.setter + def formatted_summary_log(self, value: str): + self._formatted_summary_log = value + @property def zone_mesh_results(self) -> List[ZoneMeshResult]: """Zone-wise mesh information for elements in the exported model. @@ -5367,6 +5522,10 @@ class ImportAbaqusResults(CoreObject): summary_log: str, optional Summary log for the import operation in json format. + **This is a beta parameter**. **The behavior and name may change in the future**. + formatted_summary_log: str, optional + Formatted summary log for the import operation. + **This is a beta parameter**. **The behavior and name may change in the future**. error_code: ErrorCode, optional Error code associated with failure of operation. @@ -5386,9 +5545,11 @@ class ImportAbaqusResults(CoreObject): def __initialize( self, summary_log: str, + formatted_summary_log: str, error_code: ErrorCode, warning_codes: List[WarningCode]): self._summary_log = summary_log + self._formatted_summary_log = formatted_summary_log self._error_code = ErrorCode(error_code) self._warning_codes = warning_codes @@ -5396,6 +5557,7 @@ def __init__( self, model: CommunicationManager=None, summary_log: str = None, + formatted_summary_log: str = None, error_code: ErrorCode = None, warning_codes: List[WarningCode] = None, json_data : dict = None, @@ -5409,6 +5571,10 @@ def __init__( summary_log: str, optional Summary log for the import operation in json format. + **This is a beta parameter**. **The behavior and name may change in the future**. + formatted_summary_log: str, optional + Formatted summary log for the import operation. + **This is a beta parameter**. **The behavior and name may change in the future**. error_code: ErrorCode, optional Error code associated with failure of operation. @@ -5426,13 +5592,15 @@ def __init__( if json_data: self.__initialize( json_data["summaryLog"] if "summaryLog" in json_data else None, + json_data["formattedSummaryLog"] if "formattedSummaryLog" in json_data else None, ErrorCode(json_data["errorCode"] if "errorCode" in json_data else None), [WarningCode(data) for data in json_data["warningCodes"]] if "warningCodes" in json_data else None) else: - all_field_specified = all(arg is not None for arg in [summary_log, error_code, warning_codes]) + all_field_specified = all(arg is not None for arg in [summary_log, formatted_summary_log, error_code, warning_codes]) if all_field_specified: self.__initialize( summary_log, + formatted_summary_log, error_code, warning_codes) else: @@ -5443,6 +5611,7 @@ def __init__( json_data = param_json["ImportAbaqusResults"] if "ImportAbaqusResults" in param_json else {} self.__initialize( summary_log if summary_log is not None else ( ImportAbaqusResults._default_params["summary_log"] if "summary_log" in ImportAbaqusResults._default_params else (json_data["summaryLog"] if "summaryLog" in json_data else None)), + formatted_summary_log if formatted_summary_log is not None else ( ImportAbaqusResults._default_params["formatted_summary_log"] if "formatted_summary_log" in ImportAbaqusResults._default_params else (json_data["formattedSummaryLog"] if "formattedSummaryLog" in json_data else None)), error_code if error_code is not None else ( ImportAbaqusResults._default_params["error_code"] if "error_code" in ImportAbaqusResults._default_params else ErrorCode(json_data["errorCode"] if "errorCode" in json_data else None)), warning_codes if warning_codes is not None else ( ImportAbaqusResults._default_params["warning_codes"] if "warning_codes" in ImportAbaqusResults._default_params else [WarningCode(data) for data in (json_data["warningCodes"] if "warningCodes" in json_data else None)])) self._custom_params = kwargs @@ -5455,6 +5624,7 @@ def __init__( @staticmethod def set_default( summary_log: str = None, + formatted_summary_log: str = None, error_code: ErrorCode = None, warning_codes: List[WarningCode] = None): """Set the default values of the ``ImportAbaqusResults`` object. @@ -5463,6 +5633,8 @@ def set_default( ---------- summary_log: str, optional Summary log for the import operation in json format. + formatted_summary_log: str, optional + Formatted summary log for the import operation. error_code: ErrorCode, optional Error code associated with failure of operation. warning_codes: List[WarningCode], optional @@ -5487,6 +5659,8 @@ def _jsonify(self) -> Dict[str, Any]: json_data = {} if self._summary_log is not None: json_data["summaryLog"] = self._summary_log + if self._formatted_summary_log is not None: + json_data["formattedSummaryLog"] = self._formatted_summary_log if self._error_code is not None: json_data["errorCode"] = self._error_code if self._warning_codes is not None: @@ -5495,7 +5669,7 @@ def _jsonify(self) -> Dict[str, Any]: return json_data def __str__(self) -> str: - message = "summary_log : %s\nerror_code : %s\nwarning_codes : %s" % (self._summary_log, self._error_code, '[' + ''.join('\n' + str(data) for data in self._warning_codes) + ']') + message = "summary_log : %s\nformatted_summary_log : %s\nerror_code : %s\nwarning_codes : %s" % (self._summary_log, self._formatted_summary_log, self._error_code, '[' + ''.join('\n' + str(data) for data in self._warning_codes) + ']') message += ''.join('\n' + str(key) + ' : ' + str(value) for key, value in self._custom_params.items()) return message @@ -5511,6 +5685,18 @@ def summary_log(self) -> str: def summary_log(self, value: str): self._summary_log = value + @property + def formatted_summary_log(self) -> str: + """Formatted summary log for the import operation. + + **This is a beta parameter**. **The behavior and name may change in the future**. + """ + return self._formatted_summary_log + + @formatted_summary_log.setter + def formatted_summary_log(self, value: str): + self._formatted_summary_log = value + @property def error_code(self) -> ErrorCode: """Error code associated with failure of operation. diff --git a/src/ansys/meshing/prime/core/mapdlcdbexportutils.py b/src/ansys/meshing/prime/core/mapdlcdbexportutils.py index c67a7b5649..fd0fdb81c8 100644 --- a/src/ansys/meshing/prime/core/mapdlcdbexportutils.py +++ b/src/ansys/meshing/prime/core/mapdlcdbexportutils.py @@ -664,9 +664,17 @@ class _MaterialProcessor: '_property_function_map', '_model', '_logger', + '_skip_comments', ) - def __init__(self, model: prime.Model, raw_materials_data, zone_data, hm_comments=False): + def __init__( + self, + model: prime.Model, + raw_materials_data, + zone_data, + hm_comments=False, + skip_comments=True, + ): self._raw_materials_data = raw_materials_data self._zone_data = zone_data self._mat_id = 0 @@ -683,9 +691,11 @@ def __init__(self, model: prime.Model, raw_materials_data, zone_data, hm_comment 'DAMAGE EVOLUTION': self._process_damage_evolution_data, 'DAMAGE INITIATION': self._process_damage_initiation_data, 'HYPERFOAM': self._process_hyperfoam_data, + 'VISCOELASTIC': self._process_viscoelastic_data, } self._model = model self._logger = model.python_logger + self._skip_comments = skip_comments def _map_zone_type_with_material(self): if self._zone_data is None: @@ -763,10 +773,11 @@ def _get_mat_comands(self, material): 'DAMAGE INITIATION', 'DAMAGE EVOLUTION', 'HYPERFOAM', + 'VISCOELASTIC', ] # self._logger.info(mat_data) mapdl_text_data = "" - hm_comment = self._enable_hm_comments + hm_comment = self._enable_hm_comments and self._skip_comments is False if hm_comment: mapdl_text_data += "!!HMNAME MAT \n" mapdl_text_data += f'!!{self._mat_id:>10} "{material}"\n' @@ -865,6 +876,108 @@ def _process_damage_initiation_data(self, property_dict, material, mat_id): damage_init_data += "\n" return damage_init_data + def get_weight_factor(self, mat_id, material): + weight_sum = 0 + weight_factor = 1 + all_mat_props = self._raw_materials_data[material] + if 'VISCOELASTIC' not in all_mat_props: + return weight_factor + mat_props = all_mat_props["VISCOELASTIC"] + if ( + mat_props["Parameters"] + and "TIME" in mat_props["Parameters"] + and mat_props["Parameters"]["TIME"] == "PRONY" + ): + g = mat_props["Data"]['g'] + if 'k' in mat_props["Data"]: + k = mat_props["Data"]['k'] + else: + k = [0.0] * len(g) + t = mat_props["Data"]['t'] + plastic_data = {} + for pnt in zip(g, k, t): + if float(pnt[1]) in plastic_data.keys(): + plastic_data[float(pnt[1])].append([float(pnt[0]), float(pnt[2])]) + else: + plastic_data[float(pnt[1])] = [[float(pnt[0]), float(pnt[2])]] + + if len(plastic_data.keys()) > 1: + self._logger.warning( + f"More than one temperature data is provided in the material " + f"(ID : {mat_id} Name: {material}). Please verify the material data." + ) + for tb_temp, data_temp in plastic_data.items(): + + data_for_temp = sorted(data_temp, key=lambda x: x[0]) + for count, plst_data in enumerate(data_for_temp): + weight_sum += float(plst_data[0]) + + if weight_sum > 1: + self._logger.warning( + f"Weight sum of the hyperleastic material {material} is more than 1" + ) + weight_factor = 1 / (1 - weight_sum) + # self._logger.info(f"weight_factor1 {weight_factor}") + return weight_factor + else: + self._logger.warning( + f"The visco-elasticity available in the material " + f"(ID : {mat_id} Name: {material}) is not translated. " + f"Only Prony series is supported." + ) + return weight_factor + + def _process_viscoelastic_data(self, property_dict, material, mat_id): + viscoelastic_data = '' + + if ( + property_dict["Parameters"] + and "TIME" in property_dict["Parameters"] + and property_dict["Parameters"]["TIME"] == "PRONY" + ): + g = property_dict["Data"]['g'] + if 'k' in property_dict["Data"]: + k = property_dict["Data"]['k'] + else: + k = [0.0] * len(g) + if 't' in property_dict["Data"]: + t = property_dict["Data"]['t'] + else: + t = [0.0] * len(g) + plastic_data = {} + for pnt in zip(g, k, t): + if float(pnt[1]) in plastic_data.keys(): + plastic_data[float(pnt[1])].append([float(pnt[0]), float(pnt[2])]) + else: + plastic_data[float(pnt[1])] = [[float(pnt[0]), float(pnt[2])]] + + if len(plastic_data.keys()) > 1: + self._logger.warning( + f"More than one temperature data is provided in the material " + f"(ID : {mat_id} Name: {mat_name}). Please verify the material data." + ) + + key = list(plastic_data.keys())[0] + data = plastic_data[key] + + viscoelastic_data += f"TB, PRONY, {mat_id},,,SHEAR\n" + for g, t in data: + viscoelastic_data += f"TBDATA,, {g}, {t}\n" + viscoelastic_data += "\n" + + viscoelastic_data += f"TB, PRONY, {mat_id},,,BULK\n" + for g, t in data: + viscoelastic_data += f"TBDATA,, {g}, {t}\n" + viscoelastic_data += "\n" + + else: + self._logger.warning( + f"Only TIME=PRONY is processed for VISCOELASTIC material. " + f"Material {material} is not processed completely." + ) + + return viscoelastic_data + def _process_hyperfoam_data(self, property_dict, material, mat_id): hyperfoam_data = '' data = [] @@ -888,13 +1001,18 @@ def _process_hyperfoam_data(self, property_dict, material, mat_id): ] hyperfoam_data = self._hyperfoam_with_test_data(n, uniaxial_test_data, poisson, mat_id) else: - hyperfoam_data = self._hyperfoam_with_coeffs(n, data, mat_id) - self._logger.warning(f"{property_dict}") - self._logger.warning(f"{self._raw_materials_data[material]['UNIAXIAL TEST DATA']}") + weight_factor = 1 + if not ('MODULI' in parameters and parameters['MODULI'] == 'INSTANTANEOUS'): + weight_factor = self.get_weight_factor(mat_id, material) + hyperfoam_data = self._hyperfoam_with_coeffs(n, data, mat_id, weight_factor) return hyperfoam_data - def _hyperfoam_with_coeffs(self, n, data, mat_id): + def _hyperfoam_with_coeffs(self, n, data, mat_id, weight_factor): hyperfoam_coeff_data = '' + data = { + k: [float(x) for x in v if x is not None] if v is not None else None + for k, v in data.items() + } u1 = data['u1'] a1 = data['a1'] v1 = [0.0] * len(u1) @@ -934,32 +1052,32 @@ def _hyperfoam_with_coeffs(self, n, data, mat_id): if 'Temperature' in data: temperature = data['Temperature'] - hyperfoam_coeff_data += f"TB, HYPE, {mat_id},,{n},FOAM" + hyperfoam_coeff_data += f"TB, HYPE, {mat_id},,{n},FOAM\n" for i in range(len(temperature)): if temperature[i] is not None: hyperfoam_coeff_data += f"TBTEMP,{temperature[i]}\n" - u1a = 2 * u1[i] / a1[i] + u1a = 2 * u1[i] / a1[i] * weight_factor a1a = a1[i] hyperfoam_coeff_data += f"TBDATA, 1, {u1a}, {a1a}" if n > 1: - u2a = 2 * u2[i] / a2[i] + u2a = 2 * u2[i] / a2[i] * weight_factor a2a = a2[i] hyperfoam_coeff_data += f", {u2a}, {a2a}" if n > 2: - u3a = 2 * u3[i] / a3[i] + u3a = 2 * u3[i] / a3[i] * weight_factor a3a = a3[i] hyperfoam_coeff_data += f", {u3a}, {a3a}" if n > 3: - u4a = 2 * u4[i] / a4[i] + u4a = 2 * u4[i] / a4[i] * weight_factor a4a = a4[i] hyperfoam_coeff_data += "\n" hyperfoam_coeff_data += f"TBDATA, 7, {u4a}, {a4a}" if n > 4: - u5a = 2 * u5[i] / a5[i] + u5a = 2 * u5[i] / a5[i] * weight_factor a5a = a5[i] - hyperfoam_coeff_data += f", {u5a}, {a6a}" + hyperfoam_coeff_data += f", {u5a}, {a5a}" if n > 5: - u6a = 2 * u6[i] / a6[i] + u6a = 2 * u6[i] / a6[i] * weight_factor a6a = a6[i] hyperfoam_coeff_data += f", {u6a}, {a6a}" hyperfoam_coeff_data += "\n" @@ -982,6 +1100,7 @@ def _hyperfoam_with_coeffs(self, n, data, mat_id): b6a = v6[i] / (1 - 2 * v6[i]) hyperfoam_coeff_data += f", {b6a}" hyperfoam_coeff_data += "\n" + hyperfoam_coeff_data += "\n" return hyperfoam_coeff_data def _hyperfoam_with_test_data(self, n, data, poisson, mat_id): @@ -1196,7 +1315,7 @@ def _process_damping_data(self, property_dict, material, mat_id): if 'ALPHA' in property_dict['Parameters']: damping_data += f"MP, ALPD, {mat_id}, {property_dict['Parameters']['ALPHA']} \n" if float(property_dict['Parameters']['BETA']) != 0.0: - self._logger.warning(f"Parameter {'BETA'} on *DAMPING is not processed.") + damping_data += f"MP, BETD, {mat_id}, {property_dict['Parameters']['BETA']} \n" if float(property_dict['Parameters']['COMPOSITE']) != 0.0: self._logger.warning(f"Parameter {'COMPOSITE'} on *DAMPING is not processed.") damping_data += f"\n" @@ -1373,7 +1492,13 @@ def _process_plastic_data(self, property_dict, material, mat_id): def _process_hyperelastic_data(self, property_dict, material, mat_id): hyperelastic_data = '' param_keys = property_dict["Parameters"].keys() + parameters = property_dict["Parameters"] data = [] + + weight_factor = 1 + if not ('MODULI' in parameters and parameters['MODULI'] == 'INSTANTANEOUS'): + weight_factor = self.get_weight_factor(mat_id, material) + if 'Data' in property_dict and property_dict['Data'] is not None: data = property_dict['Data'] if ( @@ -1423,6 +1548,10 @@ def _process_hyperelastic_data(self, property_dict, material, mat_id): temp_data_points = 1 temperature = [None] number_of_constants = 3 + data = { + k: [float(x) for x in v if x is not None] if v is not None else None + for k, v in data.items() + } if 'C10' in data.keys(): number_of_constants = 1 c10 = data['C10'] @@ -1449,12 +1578,14 @@ def _process_hyperelastic_data(self, property_dict, material, mat_id): if temperature[i] is not None: hyperelastic_data += f"TBTEMP, {temperature[i]}\n" if number_of_constants == 1: - hyperelastic_data += f"TBDATA, 1, {c10[i]}, {d1[i]}\n" + hyperelastic_data += f"TBDATA, 1, {c10[i]*weight_factor}, {d1[i]}\n" elif number_of_constants == 2: - hyperelastic_data += f"TBDATA, 1, {c10[i]}, {c20[i]}, {d1[i]}, {d2[i]}\n" + hyperelastic_data += f"TBDATA, 1, {c10[i]*weight_factor}, " + hyperelastic_data += f"{c20[i]*weight_factor}, {d1[i]}, {d2[i]}\n" elif number_of_constants == 3: hyperelastic_data += ( - f"TBDATA, 1, {c10[i]}, {c20[i]}, {c30[i]}, {d1[i]}, {d2[i]}, {d3[i]}\n" + f"TBDATA, 1, {c10[i]*weight_factor}, {c20[i]*weight_factor}, " + f"{c30[i]*weight_factor}, {d1[i]}, {d2[i]}, {d3[i]}\n" ) else: pass @@ -1570,9 +1701,12 @@ class _JointMaterialProcessor: '_property_function_map', '_model', '_logger', + '_skip_comments', ) - def __init__(self, model: prime.Model, raw_joint_materials_data, hm_comments=False): + def __init__( + self, model: prime.Model, raw_joint_materials_data, hm_comments=False, skip_comments=True + ): self._raw_joint_materials_data = raw_joint_materials_data self._mat_id = 0 self._enable_hm_comments = hm_comments @@ -1582,6 +1716,7 @@ def __init__(self, model: prime.Model, raw_joint_materials_data, hm_comments=Fal } self._model = model self._logger = model.python_logger + self._skip_comments = skip_comments def get_all_material_commands(self): mapdl_text_data_list = [] @@ -1598,7 +1733,7 @@ def _get_mat_comands(self, material): processed_entities = ['CONNECTOR ELASTICITY', 'CONNECTOR DAMPING'] # self._logger.info(mat_data) mapdl_text_data = "" - hm_comment = self._enable_hm_comments + hm_comment = self._enable_hm_comments and self._skip_comments is False if hm_comment: mapdl_text_data += "!!HMNAME MAT \n" mapdl_text_data += f'!!{self._mat_id:>10} "{material}"\n' @@ -3411,7 +3546,7 @@ def get_frequency_analysis_data(self, frequency_data): or ("Boundary" in self._simulation_data and self._simulation_data['Boundary']) ): frequency_analysis_commands += 'KEYW, BETA, 1\n' - frequency_analysis_commands += 'AIRL, AUTO, 1\n' + frequency_analysis_commands += 'AIRL, AUTO\n' if ( "MODAL DYNAMIC" in self._analysis_sequence or "STEADY STATE DYNAMICS" in self._analysis_sequence @@ -4631,6 +4766,7 @@ def generate_mapdl_commands( json_simulation_data["Materials"], json_simulation_data["Zones"], params.write_separate_blocks, + params.skip_comments, ) mat_cmds = mp.get_all_material_commands() all_mat_cmds = mat_cmds @@ -4639,7 +4775,10 @@ def generate_mapdl_commands( and json_simulation_data["ConnectorBehavior"] is not None ): jmp = _JointMaterialProcessor( - model, json_simulation_data["ConnectorBehavior"], params.write_separate_blocks + model, + json_simulation_data["ConnectorBehavior"], + params.write_separate_blocks, + params.skip_comments, ) joint_all_mat_cmds = jmp.get_all_material_commands() all_mat_cmds += joint_all_mat_cmds @@ -4740,36 +4879,36 @@ def generate_mapdl_commands( analysis_settings += '\nFINISH\n' if params.analysis_settings != None: analysis_settings += params.analysis_settings - analysis_settings += ( - '!--------------------------------------------------------------------------\n' - ) - # analysis_settings += '/copy,file0,err,,errfile,tmp\n' - # analysis_settings += '\n' - analysis_settings += '/delete,,cnm,,1\n' - analysis_settings += '/delete,,DSP,,\n' - analysis_settings += '/delete,,mcf,,\n' - analysis_settings += '/delete,,rfrq,,1\n' - analysis_settings += '/delete,,log,,1\n' - analysis_settings += '/delete,,emat,,1\n' - analysis_settings += '/delete,,esav,,1\n' - analysis_settings += '/delete,,err,,1\n' - analysis_settings += '/delete,,full,,1\n' - analysis_settings += '/delete,,mlv,,1\n' - analysis_settings += '/delete,,mode,,1\n' - # analysis_settings += '/delete,,rfrq,,1\n' - analysis_settings += '/delete,,out,,1\n' - # analysis_settings += '/delete,harmonic,rst,,1\n' - analysis_settings += '!/delete,,mntr,,\n' - analysis_settings += '/delete,,ldhi,,\n' - analysis_settings += '/delete,,r001,,1\n' - analysis_settings += '/delete,,rst,,1\n' - analysis_settings += '/delete,,stat,,1\n' - analysis_settings += '/delete,,db,,\n' - analysis_settings += '/delete,,rdb,,\n' - # analysis_settings += '\n' - # analysis_settings += '/rename,errfile,tmp,,file,err\n' - if "Step" in json_simulation_data: - for an_name in steps_data._assign_analysis: - analysis_settings += f'/delete,{an_name},rst,,1\n' - analysis_settings += '/exit,nosave\n' + analysis_settings += ( + '!--------------------------------------------------------------------------\n' + ) + # analysis_settings += '/copy,file0,err,,errfile,tmp\n' + # analysis_settings += '\n' + analysis_settings += '/delete,,cnm,,1\n' + analysis_settings += '/delete,,DSP,,\n' + analysis_settings += '/delete,,mcf,,\n' + analysis_settings += '/delete,,rfrq,,1\n' + analysis_settings += '/delete,,log,,1\n' + analysis_settings += '/delete,,emat,,1\n' + analysis_settings += '/delete,,esav,,1\n' + analysis_settings += '/delete,,err,,1\n' + analysis_settings += '/delete,,full,,1\n' + analysis_settings += '/delete,,mlv,,1\n' + analysis_settings += '/delete,,mode,,1\n' + # analysis_settings += '/delete,,rfrq,,1\n' + analysis_settings += '/delete,,out,,1\n' + # analysis_settings += '/delete,harmonic,rst,,1\n' + analysis_settings += '!/delete,,mntr,,\n' + analysis_settings += '/delete,,ldhi,,\n' + analysis_settings += '/delete,,r001,,1\n' + analysis_settings += '/delete,,rst,,1\n' + analysis_settings += '/delete,,stat,,1\n' + analysis_settings += '/delete,,db,,\n' + analysis_settings += '/delete,,rdb,,\n' + # analysis_settings += '\n' + # analysis_settings += '/rename,errfile,tmp,,file,err\n' + if "Step" in json_simulation_data: + for an_name in steps_data._assign_analysis: + analysis_settings += f'/delete,{an_name},rst,,1\n' + analysis_settings += '/exit,nosave\n' return all_mat_cmds, analysis_settings diff --git a/src/ansys/meshing/prime/internals/utils.py b/src/ansys/meshing/prime/internals/utils.py index 6962e6d39d..5dbba30024 100644 --- a/src/ansys/meshing/prime/internals/utils.py +++ b/src/ansys/meshing/prime/internals/utils.py @@ -24,6 +24,7 @@ import os import shutil import subprocess +import uuid from contextlib import contextmanager from typing import List, Optional @@ -31,7 +32,6 @@ import ansys.meshing.prime.internals.defaults as defaults _LOCAL_PORTS = [] -_PRIME_CONTAINER_COUNT = 0 def make_unique_container_name(name: str): @@ -47,9 +47,7 @@ def make_unique_container_name(name: str): str Unique name with a numeric integer added as suffix. """ - global _PRIME_CONTAINER_COUNT - _PRIME_CONTAINER_COUNT = _PRIME_CONTAINER_COUNT + 1 - return f'{name}-{_PRIME_CONTAINER_COUNT}' + return f'{name}-' + str(uuid.uuid4()) def to_camel_case(snake_str):