Python API for using CENOS applications
Project description
CENOS Python package
This is a simple package that allows to interface with the cenos backend via a python API.
Quick-start
Install this package
pip install cenos-py
How it works
While you use CENOS normally using the GUI, most of your actions are written out to a logs/python_trace_script.py file inside of the case itself. It will look something like this:
from cenos_py import CenosCase, setCenosLocation
setCenosLocation(r"C:\source\cenos")
case = CenosCase("INDUCTION")
case.set_pre_processor('geomWizard', load_recent=True)
case.update_template_shape_type(1, 'workpieceTube')
case.update_template_property(1, 'diameter3', 32)
case.update_template_property(1, 'diameter4', 10)
case.update_tab_property('simulation', 'tend', 3)
case.update_tab_property('simulation', 'isAdaptive', True)
case.assign_group_material('workpiece', 'alloy_34Cr4')
case.update_physics_property('physicsThermal', 'boundary', 'workpiece_surface', 'hr', 0.9)
case.entered_meshing_window()
case.set_meshing_global_density('rough')
case.set_meshing_grading_surface(0.29)
case.set_meshing_domain_element_size('workpiece', 2)
case.set_meshing_domain_skin_layer('workpiece', True, 4.6, 10, 1.4)
case.generate_mesh()
case.calculate()
You can use this code in your script to create a CENOS case from scratch for every run.
(Recommended) Alternatively you can use a script that simply opens an existing case and modifies only the variables that you wish to control, for example:
from pathlib import Path
from cenos_py import CenosCase, setCenosLocation
setCenosLocation(r"C:\Users\user\AppData\Local\Programs\CENOS Induction Heating beta")
case = CenosCase("INDUCTION")
your_case_path = r"C:\Users\rp\CENOS\your_case"
for i in [20, 30, 40, 50]:
case.open(your_case_path)
# Create a copy first
case.save_case_as(r"C:\Users\rp\CENOS\your_case_{i}")
case.update_template_property(1, "workpiece_height", i)
case.calculate()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cenos_py-0.1.1.tar.gz.
File metadata
- Download URL: cenos_py-0.1.1.tar.gz
- Upload date:
- Size: 11.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
772c8180557e0c42db025c1342aa5a96b06813a8b6423e8d712c227fa695032f
|
|
| MD5 |
3903eb69c682771675714601dfab3d7f
|
|
| BLAKE2b-256 |
3c93bb4da9b17557e12a5dd63e3a50c346ad3bb915e20dc7c7f49e1ee7951867
|
Provenance
The following attestation bundles were made for cenos_py-0.1.1.tar.gz:
Publisher:
release.yaml on CENOS-Platform/cenos-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cenos_py-0.1.1.tar.gz -
Subject digest:
772c8180557e0c42db025c1342aa5a96b06813a8b6423e8d712c227fa695032f - Sigstore transparency entry: 2112898449
- Sigstore integration time:
-
Permalink:
CENOS-Platform/cenos-py@85d13a626a4fc500324e22b149896cb1be59fc78 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/CENOS-Platform
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@85d13a626a4fc500324e22b149896cb1be59fc78 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cenos_py-0.1.1-py3-none-any.whl.
File metadata
- Download URL: cenos_py-0.1.1-py3-none-any.whl
- Upload date:
- Size: 14.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
066a94e98cad178696fd3198d2fc38040dafb369388523f889018e3068bf6624
|
|
| MD5 |
4b7a3752a69edbb36fad9c71a048b327
|
|
| BLAKE2b-256 |
c69678fb69023a35b7483a29a18183174d65c57b8c9fe7f1d5fd3d432c1c82b7
|
Provenance
The following attestation bundles were made for cenos_py-0.1.1-py3-none-any.whl:
Publisher:
release.yaml on CENOS-Platform/cenos-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cenos_py-0.1.1-py3-none-any.whl -
Subject digest:
066a94e98cad178696fd3198d2fc38040dafb369388523f889018e3068bf6624 - Sigstore transparency entry: 2112898515
- Sigstore integration time:
-
Permalink:
CENOS-Platform/cenos-py@85d13a626a4fc500324e22b149896cb1be59fc78 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/CENOS-Platform
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@85d13a626a4fc500324e22b149896cb1be59fc78 -
Trigger Event:
push
-
Statement type: