Metadata-Version: 2.4
Name: cenos-py
Version: 0.1.1
Summary: Python API for using CENOS applications
Author: Rinalds
Author-email: Rinalds <rp@cenos-platform.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: websocket-client>=1.9.0
Requires-Python: >=3.10
Project-URL: Homepage, https://cenos-platform.com
Project-URL: Repository, https://github.com/CENOS-Platform/cenos-py
Description-Content-Type: text/markdown

# 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:

```python
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:

```python
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()
```





