Skip to main content

A Python client library for Osis APDL

Project description

简体中文 | English

pyosis

Python client library for OSIS Bridge Analysis Platform

Installation

Due to naming conflicts on PyPI, please install using:

pip install osis-python

If your mirror hasn't synced yet, use:

pip install osis-python -i https://pypi.org/simple

Usage

First, install the latest version of OSIS (>=5.0) and configure the Python environment variables. pyosis requires Python 3.11 or higher. You need to set PYTHONHOME in the environment variables to your Python installation directory, e.g., C:\Program Files\python, and set PYTHONIOENCODING to utf-8. Then add %PYTHONHOME% and %PYTHONHOME%\Scripts to the Path variable.

Your scripts should be placed in the python folder under the OSIS installation directory, e.g., C:\Program Files\osis\python. Suppose there is a script named test_osis.py with the following content:

import json
from pyosis.core import osis_run    # Import required functions
from pyosis.control import *
from pyosis.general import *
from pyosis.section import *
from pyosis.material import *
from pyosis.node import *
from pyosis.element import *
from pyosis.boundary import *
from pyosis.load import *
from pyosis.post import *

osis_clear()

osis_acel(9.8066)
osis_calc_tendon(1)
osis_calc_con_force(1)
osis_calc_shrink(1)
osis_calc_creep(1)
osis_calc_shear(1)
osis_calc_rlx(1)
osis_mod_loc_coor(0)
osis_inc_tendon(1)
osis_nl(0, 0)
osis_ln_srch(0)
osis_auto_ts(0)
osis_mod_opt(0)

osis_section_circle(1, "Circle Section 1", "CIRCLE", "Hollow", 0.219, 0.012)
osis_section_circle(2, "Circle Section 2", "CIRCLE", "Hollow", 0.180, 0.008)
osis_section_circle(3, "Circle Section 3", "CIRCLE", "Hollow", 0.114, 0.005)
osis_section_circle(4, "Circle Section 4", "CIRCLE", "Hollow", 0.089, 0.004)
osis_section_circle(5, "Circle Section 5", "CIRCLE", "Hollow", 0.045, 0.003)

osis_material_steel(1, "Steel 1", "STEEL", "JTGD64_2015", "Q345", 0.05)

# Fixed nodes (x, y units: m)
osis_node(1, 0, 5, 0)
osis_node(2, 15, 5, 0)
# Load application nodes
osis_node(3, 7.5, 0, 0)
osis_node(4, 20, 0, 0)

osis_element_beam3d(1, "BEAM3D", 1, 3, 1, 4, 4, 1, 1, 0.00, 0, 0.00, 0)
osis_element_beam3d(2, "BEAM3D", 2, 3, 1, 5, 5, 1, 1, 0.00, 0, 0.00, 0)
osis_element_beam3d(3, "BEAM3D", 2, 4, 1, 5, 5, 1, 1, 0.00, 0, 0.00, 0)
osis_element_beam3d(4, "BEAM3D", 3, 4, 1, 5, 5, 1, 1, 0.00, 0, 0.00, 0)

osis_boundary_general(1, "GENERAL", "", 1, 1, 1, 1, 1, 1, 1)
osis_assign_boundary(1, "a", [1, 2])

osis_loadcase("Custom Load Case 1", "USER", 1, "Two forces applied at nodes 3 and 4")
osis_load_nforce("NFORCE", "Custom Load Case 1", 3, 0, -1000000, 0, 0, 0, 0)
osis_load_nforce("NFORCE", "Custom Load Case 1", 4, 200000, 0, 0, 0, 0, 0)

# osis_solve()

print(osis_run())      # Let OSIS execute all preprocessing commands

Select and run this script in OSIS. If everything is normal, you will see OSIS finish the preprocessing.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

osis_python-0.1.7.tar.gz (41.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

osis_python-0.1.7-py3-none-any.whl (58.9 kB view details)

Uploaded Python 3

File details

Details for the file osis_python-0.1.7.tar.gz.

File metadata

  • Download URL: osis_python-0.1.7.tar.gz
  • Upload date:
  • Size: 41.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for osis_python-0.1.7.tar.gz
Algorithm Hash digest
SHA256 80d64452d1eaf09f784385547a59073b0428d71288b9bbb1eb21c5129514f5ec
MD5 55ebd72fdb09b363cd9b3f0943ee8151
BLAKE2b-256 bbdc9a49e2aaebc6c2b41d283c91608dbd893858ce382902c35a2bf1e9e7e197

See more details on using hashes here.

File details

Details for the file osis_python-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: osis_python-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 58.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for osis_python-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 6ab999580bf3c7aa07118d90c3dfb217d661d1ae7197cc51306b3b0ba254c3e7
MD5 828bb536dd85e8ea4ebe713fdd3b0ace
BLAKE2b-256 f945e4fa50b15c89d489eb9e62fe363ef209457879bda8c553e4d7b97350c151

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page