diff --git a/.buildinfo b/.buildinfo new file mode 100644 index 000000000..457ed9f07 --- /dev/null +++ b/.buildinfo @@ -0,0 +1,4 @@ +# Sphinx build info version 1 +# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. +config: 1d8ce764e61d75774a5ccf0a599b5baa +tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 000000000..e69de29bb diff --git a/CNAME b/CNAME new file mode 100644 index 000000000..73e52d2ce --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +dyna.docs.pyansys.com diff --git a/index.html b/index.html new file mode 100644 index 000000000..ae120c159 --- /dev/null +++ b/index.html @@ -0,0 +1,6 @@ + + +
+ You are not viewing the most recent version of this documentation. + The latest stable release is 0.4 +
diff --git a/version/0.2/API/index.html b/version/0.2/API/index.html new file mode 100644 index 000000000..e3a987801 --- /dev/null +++ b/version/0.2/API/index.html @@ -0,0 +1,552 @@ + + + + + + + + +This section describes PyDyna core classes, methods, and functions +for LS-Dyna apps and modules. Use the search feature or click links +to view API documentation.
+The PyDyna-pre API includes classes for apps and modules.
+
|
+Base |
+
|
+Solution |
+
|
+Mechanical API |
+
|
+EM API |
+
|
+ICFD API |
+
|
+IGA API |
+
|
+ISPH API |
+
|
+Material API |
+
|
+NVH API |
+
|
+Airbag API |
+
|
+DEM API |
+
The PyDyna-solver API includes classes for apps and modules.
+
|
+Dyna solver API |
+
Overall guidance on contributing to a PyAnsys repository appears in the +Contributing topic +in the PyAnsys Developer’s Guide. Ensure that you are thoroughly familiar +with it and all Guidelines and Best Practices +before attempting to contribute to PyDyna.
+This package is not yet available on the public PyPI, but you can still install
+it using pip
from our private PyPI repository.
The following on Windows:
+set PYANSYS_PYPI_PRIVATE_PAT=<REDACTED>
+set INDEX_URL=https://%PYANSYS_PYPI_PRIVATE_PAT%@pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/simple/
+python -m pip install ansys-dyna-core --index-url %INDEX_URL%
+
And if you are running Linux:
+PYANSYS_PYPI_PRIVATE_PAT=<REDACTED>
+export INDEX_URL='https://$PYANSYS_PYPI_PRIVATE_PAT@pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/simple/'
+python -m pip install ansys-dyna-core --index-url $INDEX_URL
+
Email your friendly PyAnsys team member for the PYANSYS_PYPI_PRIVATE_PAT
+at pyansys.core@ansys.com or send us a message via Teams.
Installing from git
+If you have git
installed and want the bleeding edge version:
pip install -U git+https://github.com/pyansys/pyDyna@main
+
You need to be logged into GitHub locally and be a member of the PyAnsys Organization.
+Alternatively, if you need to modify the repository locally (or want to +do local development), you can clone it and install it in “development” mode with:
+git clone https://github.com/pyansys/pyDyna
+cd pyDyna
+pip install -e .
+
Note the -e
flag, which denotes that you are in development mode.
+You can make changes in the local pyDyna
and have them reflected
+in your local install of PyDyna.
There are 3 related packages here, all under the ansys/dyna
directory.
PyDyna-pre provides interface to create DYNA input deck.
+PyDyna-solver contains code for interfacing with the LS-DYNA solver directly. +As LS-DYNA is primarily a batch solver with very limited interactive +capabilities, the code here is similarly limited. The target +use case is that LS-DYNA is running in a container environment +such as Docker or Kubernetes. The code here then allows for pushing +input files to the container, starting LS-DYNA and monitoring its +progress, and retrieving results files.
+The Data Processing Framework (DPF) is designed to provide numerical
+simulation users/engineers with a toolbox for accessing and
+transforming simulation data. DPF can access data from solver result
+files as well as several neutral formats (.csv
, .hdf5
, .vtk
,
+etc.). Various operators are available allowing the manipulation and
+the transformation of this data.
The Python ansys-dpf-post package provides a simplified Python +interface to DPF, thus enabling rapid postprocessing without ever +leaving a Python environment.
+Visit the DPF-Post Documentation for a +detailed description of the package
++ You are not viewing the most recent version of this documentation. + The latest stable release is 0.4 +
diff --git a/version/0.2/Resources/pydyna_post.html b/version/0.2/Resources/pydyna_post.html new file mode 100644 index 000000000..749b107b2 --- /dev/null +++ b/version/0.2/Resources/pydyna_post.html @@ -0,0 +1,1508 @@ + + + + + + + + +d3plot
lsdyna::d3plot::meshes_provider
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+# for regular mesh
+meshOP = dpf.Operator("lsdyna::d3plot::meshes_provider")
+meshOP.inputs.data_sources.connect(ds)
+meshes = meshOP.outputs.meshes()
+mesh = meshes.get_mesh({})
+
+# for adaptive mesh
+meshOP = dpf.Operator("lsdyna::d3plot::meshes_provider")
+meshOP.inputs.data_sources.connect(ds)
+timeScoping = dpf.Scoping()
+timeScoping.ids = list(range(1, 21))
+meshOP.inputs.time_scoping.connect(timeScoping)
+meshes = meshOP.outputs.meshes()
+mesh = meshes.get_mesh({'time':1})
+
lsdyna::d3plot::U
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+coord = dpf.Operator("lsdyna::d3plot::U")
+coord.inputs.data_sources.connect(ds)
+# set the time
+coord.inputs.time_scoping.connect([3])
+fields = coord.outputs.displacement()
+
lsdyna::d3plot::TimeFreqSupportProvider
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+time = dpf.Operator("lsdyna::d3plot::TimeFreqSupportProvider")
+time.inputs.data_sources.connect(ds)
+result_time_freq_support = time.outputs.time_freq_support()
+
lsdyna::d3plot::result_info_provider
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultInfoOp = dpf.Operator("lsdyna::d3plot::result_info_provider")
+resultInfoOp.inputs.data_sources(ds)
+result_info = resultInfoOp.outputs.result_info()
+
lsdyna::d3plot::eng_ke
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::eng_ke")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.global_kinetic_energy()
+
lsdyna::d3plot::global_internal_energy
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::global_internal_energy")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.global_internal_energy()
+
lsdyna::d3plot::global_total_energy
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::global_total_energy")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.global_total_energy()
+
lsdyna::d3plot::global_velocity
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::global_velocity")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.global_velocity()
+
lsdyna::d3plot::node_initial_coordinates
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::node_initial_coordinates")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.node_initial_coordinates()
+
lsdyna::d3plot::node_coordinates
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::node_coordinates")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.node_coordinates()
+
lsdyna::d3plot::V
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::V")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.node_velocities()
+
lsdyna::d3plot::A
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::A")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.node_accelerations()
+
lsdyna::d3plot::node_temperature
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::node_temperature")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.node_temperature()
+
lsdyna::d3plot::node_heat_flux
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::node_heat_flux")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.node_heat_flux()
+
lsdyna::d3plot::node_mass_scaling
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::node_mass_scaling")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.node_mass_scaling()
+
lsdyna::d3plot::node_temperature_divide_time
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::node_temperature_divide_time")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.node_temperature_divide_time()
+
lsdyna::d3plot::node_residual_force
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::node_residual_force")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.node_residual_force()
+
lsdyna::d3plot::node_residual_moment
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::node_residual_moment")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.node_residual_moment()
+
lsdyna::d3plot::node_penetration
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::node_penetration")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.node_penetration()
+
lsdyna::d3plot::node_relative_penetration
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::node_relative_penetration")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.node_relative_penetration()
+
lsdyna::d3plot::node_contact_energy_density
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::node_contact_energy_density")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.node_contact_energy_density()
+
lsdyna::d3plot::S
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::S")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.stress()
+
lsdyna::d3plot::stress_von_mises
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::stress_von_mises")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.stress_von_mises()
+
lsdyna::d3plot::effective_plastic_strain
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::effective_plastic_strain")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.effective_plastic_strain()
+
lsdyna::d3plot::EPEL
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::EPEL")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.strain()
+
lsdyna::d3plot::strain_von_mises
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::strain_von_mises")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.strain_von_mises()
+
lsdyna::d3plot::history_var
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::history_var")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.history_var()
+
lsdyna::d3plot::thickness
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::thickness")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.thickness()
+
lsdyna::d3plot::element_dependent_var_1
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::element_dependent_var_1")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.element_dependent_var_1()
+
lsdyna::d3plot::element_dependent_var_2
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::element_dependent_var_2")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.element_dependent_var_2()
+
lsdyna::d3plot::mx
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::mx")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.mx()
+
lsdyna::d3plot::my
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::my")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.my()
+
lsdyna::d3plot::mxy
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::mxy")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.mxy()
+
lsdyna::d3plot::qx
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::qx")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.qx()
+
lsdyna::d3plot::qy
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::qy")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.qy()
+
lsdyna::d3plot::nx
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::nx")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.nx()
+
lsdyna::d3plot::ny
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::ny")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.ny()
+
lsdyna::d3plot::nxy
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::nxy")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.nxy()
+
lsdyna::d3plot::axial_force
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::axial_force")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.axial_force()
+
lsdyna::d3plot::s_shear_resultant
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::s_shear_resultant")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.s_shear_resultant()
+
lsdyna::d3plot::t_shear_resultant
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::t_shear_resultant")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.t_shear_resultant()
+
lsdyna::d3plot::s_bending_moment
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::s_bending_moment")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.s_bending_moment()
+
lsdyna::d3plot::t_bending_moment
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::t_bending_moment")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.t_bending_moment()
+
lsdyna::d3plot::torsional_resultant
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::torsional_resultant")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.torsional_resultant()
+
lsdyna::d3plot::axial_stress
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::axial_stress")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.axial_stress()
+
lsdyna::d3plot::rs_shear_stress
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::rs_shear_stress")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.rs_shear_stress()
+
lsdyna::d3plot::tr_shear_stress
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::tr_shear_stress")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.tr_shear_stress()
+
lsdyna::d3plot::axial_plastic_strain
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::axial_plastic_strain")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.axial_plastic_strain()
+
lsdyna::d3plot::axial_strain
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./d3plot', 'd3plot')
+
+resultOp = dpf.Operator("lsdyna::d3plot::axial_strain")
+resultOp.inputs.data_sources(ds)
+# set the time
+resultOp.inputs.time_scoping.connect([3])
+result = resultOp.outputs.axial_strain()
+
binout
lsdyna::binout::meshes_provider
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources() ds.set_result_file_path(r'./binout', 'binout')
+
+meshOP = dpf.Operator("lsdyna::binout::meshes_provider")
+meshOP.inputs.data_sources.connect(ds) meshes = meshOP.outputs.meshes()
+mesh = meshes.get_mesh({})
+
lsdyna::binout::U
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources() ds.set_result_file_path(r'./binout', 'binout')
+
+coord = dpf.Operator("lsdyna::binout::U")
+coord.inputs.data_sources.connect(ds)
+# set the time
+coord.inputs.time_scoping.connect([3])
+fields = coord.outputs.displacement()
+
lsdyna::binout::TimeFreqSupportProvider
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r"./binout", "binout")
+
+op = dpf.Operator("lsdyna::binout::TimeFreqSupportProvider")
+op.inputs.data_sources(ds)
+result_time_freq_support = op.outputs.time_freq_support()
+
lsdyna::binout::glstat::TimeFreqSupportProvider
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./binout', 'binout')
+
+op = dpf.Operator("llsdyna::binout::glstat::TimeFreqSupportProvider")
+op.inputs.data_sources(ds)
+result_time_freq_support = op.outputs.time_freq_support()
+
lsdyna::binout::matsum::TimeFreqSupportProvider
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./binout', 'binout')
+
+op = dpf.Operator("llsdyna::binout::matsum::TimeFreqSupportProvider")
+op.inputs.data_sources(ds)
+result_time_freq_support = op.outputs.time_freq_support()
+
lsdyna::binout::rcforc::TimeFreqSupportProvider
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./binout', 'binout')
+
+op = dpf.Operator("llsdyna::binout::rcforc::TimeFreqSupportProvider")
+op.inputs.data_sources(ds)
+result_time_freq_support = op.outputs.time_freq_support()
+
lsdyna::binout::result_info_provider
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./binout', 'binout')
+
+resultInfoOp = dpf.Operator("lsdyna::binout::result_info_provider")
+resultInfoOp.inputs.data_sources(ds)
+result_info = resultInfoOp.outputs.result_info()
+
lsdyna::binout::S
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./binout', 'binout')
+
+stressOp = dpf.Operator("lsdyna::binout::S")
+stressOp.inputs.data_sources(ds)
+fields = stressOp.outputs.stress()
+
lsdyna::binout::EPEL
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./binout', 'binout')
+
+resultOp = dpf.Operator("lsdyna::binout::EPEL")
+resultOp.inputs.data_sources(ds)
+result = resultOp.outputs.strain()
+
lsdyna::binout::glstat
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./binout', 'binout')
+
+glstat_op = dpf.Operator("lsdyna::binout::glstat")
+glstat_op.inputs.data_sources(ds)
+fields = glstat_op.outputs.results()
+
+# get correponding result by component(from lsdyna::binout::result_info_provider)
+field0 = fields.get_field({"component":0})
+field1 = fields.get_field({"component":1})
+...
+
lsdyna::binout::matsum
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./binout', 'binout')
+
+glstat_op = dpf.Operator("lsdyna::binout::matsum")
+glstat_op.inputs.data_sources(ds)
+fields = glstat_op.outputs.results()
+
+# get correponding result by component(from lsdyna::binout::result_info_provider)
+field0 = fields.get_field({"component":0})
+field1 = fields.get_field({"component":1})
+...
+
lsdyna::binout::rcforc
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./binout', 'binout')
+
+glstat_op = dpf.Operator("lsdyna::binout::rcforc")
+glstat_op.inputs.data_sources(ds)
+fields = glstat_op.outputs.results()
+
+# get correponding result by component(from lsdyna::binout::result_info_provider)
+field0 = fields.get_field({"component":0})
+field1 = fields.get_field({"component":1})
+...
+
nvh
lsdyna::d3ssd::meshes_provider
lsdyna::d3spcm::meshes_provider
lsdyna::d3psd::meshes_provider
lsdyna::d3rms::meshes_provider
lsdyna::d3zcf::meshes_provider
lsdyna::d3ssd::result_info_provider
lsdyna::d3ssd::U
lsdyna::d3ssd::V
lsdyna::d3ssd::A
lsdyna::d3ssd::S
lsdyna::d3ssd::EPEL
lsdyna::d3ssd::TimeFreqSupportProvider
same as d3plot
+lsdyna::moddynout::TimeFreqSupportProvider
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./moddynout', 'moddynout')
+
+resultOp = dpf.Operator("lsdyna::moddynout::TimeFreqSupportProvider")
+resultOp.inputs.data_sources(ds)
+result = resultOp.outputs.time_freq_support()
+
lsdyna::moddynout::result_info_provider
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./moddynout', 'moddynout')
+
+resultInfoOp = dpf.Operator("lsdyna::moddynout::result_info_provider")
+resultInfoOp.inputs.data_sources(ds)
+result_info = resultInfoOp.outputs.result_info()
+
lsdyna::moddynout::F
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./moddynout', 'moddynout')
+
+times = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+disOp = dpf.Operator("lsdyna::moddynout::F")
+disOp.inputs.data_sources(ds)
+disOp.inputs.time_scoping(times)
+fields = disOp.outputs.moddynout_force()
+
lsdyna::moddynout::A
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./moddynout', 'moddynout')
+
+times = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+disOp = dpf.Operator("lsdyna::moddynout::A")
+disOp.inputs.data_sources(ds)
+disOp.inputs.time_scoping(times)
+fields = disOp.outputs.moddynout_acceleration()
+
lsdyna::moddynout::V
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./moddynout', 'moddynout')
+
+times = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+disOp = dpf.Operator("lsdyna::moddynout::V")
+disOp.inputs.data_sources(ds)
+disOp.inputs.time_scoping(times)
+fields = disOp.outputs.moddynout_velocity()
+
lsdyna::moddynout::U
from ansys.dpf import core as dpf
+
+ds = dpf.DataSources()
+ds.set_result_file_path(r'./moddynout', 'moddynout')
+
+times = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+disOp = dpf.Operator("lsdyna::moddynout::U")
+disOp.inputs.data_sources(ds)
+disOp.inputs.time_scoping(times)
+fields = disOp.outputs.moddynout_disp()
+
The PyDyna-pre provide the ability to create keyword inputdeck
through gRPC framework.
virtualenv
#virtualenv
is a CLI tool that needs a Python interpreter to run.
virtualenv
#pip install virtualenv
+
Create a Python virtual environment of the same version as virtualenv
, installed into the subdirectory venv
.
virtualenv venv
+
Activate venv
on Windows by running command:
cd venv
+./Scripts/activate
+
Activate venv
on Linux by running command:
cd venv
+source bin/activate
+
venv
folder#venv/
+ pyDyna/
+ ansys
+ /dyna/pre/Server
+ doc
+ examples
+ .flake8
+ LICENSE
+ ...
+
Go to pyDyna/requirements/pythonxx
according to your Python version.
+Then running command:
cd pyDyna/requirement/pythonxx
+pip install -r requirements.txt
+
So far, Python 3.8/3.9 is used to start server, make sure this like below:
+(venv) C:\pyDyna\examples\pre> C:\python38\python.exe --version
+Python 3.8.10
+
Server/
+ kwserver.py
+ kwprocess_pb2.py
+ kwprocess_pb2_grpc.py
+ lib/
+ linux/
+ keywordreader.so
+ windows/
+ cp38/keywordreader.pyd
+ cp39/keywordreader.pyd
+
Start server by running command:
+shell
+(venv) C:\pyDyna\ansys\dyna\pre\Server> python .\kwserver.py
+kwgrpc Server listening on: localhost:50051
+
Start server by running command:
+(venv) :~/pyDyna/ansys/dyna/pre/Server> python kwserver.py
+
See the examples in the examples folder for some basic example. More to be added later.
+Go to pyDyna/examples/pre
,and run sale_efp.py
:
(venv) C:\pyDyna\examples\pre> python .\sale_efp.py
+2022-07-05 08:19:42 : Connected to kwServer...
+2022-07-05 08:19:42 : C:\pyDyna\examples\pre\input\sale\input\efpcase.k uploaded to server...
+2022-07-05 08:19:43 : Setup Analysis...
+2022-07-05 08:19:43 : Material air Created...
+2022-07-05 08:19:43 : Material air Created...
+2022-07-05 08:19:43 : Material HE Created...
+2022-07-05 08:19:43 : Material HE Created...
+2022-07-05 08:19:43 : Material liner Created...
+2022-07-05 08:19:43 : Material liner Created...
+2022-07-05 08:19:43 : Material vacuum Created...
+2022-07-05 08:19:43 : Material vacuum Created...
+2022-07-05 08:19:43 : ALE Structured mesh 1 Created...
+2022-07-05 08:19:43 : Material air filled in Mesh 1...
+2022-07-05 08:19:43 : Material HE filled in Mesh 1...
+2022-07-05 08:19:43 : Material liner filled in Mesh 1...
+2022-07-05 08:19:43 : Location of high explosive detonation Defined...
+2022-07-05 08:19:43 : Output Setting...
+2022-07-05 08:19:43 : efpcase.k is outputed...
+
At the same time, corresponding information is printed in the server side.
+Load model: C:\pyDyna\ansys\dyna\pre\Server\input\efpcase.k
+*DATABASE_SALE Created...
+Termination Created...
+DB Binary Created...
+*CONTROL_ALE Created...
+*EOS_LINEAR_POLYNOMIAL Created...
+*MAT_NULL Created...
+*ALE_STRUCTURED_MULTI-MATERIAL_GROUP Created...
+*MAT_HIGH_EXPLOSIVE_BURN Created...
+*EOS_JWL Created...
+*ALE_STRUCTURED_MULTI-MATERIAL_GROUP Created...
+*MAT_JOHNSON_COOK Created...
+*EOS_GRUNEISEN Created...
+*ALE_STRUCTURED_MULTI-MATERIAL_GROUP Created...
+*MAT_VACUUM Created...
+*ALE_STRUCTURED_MULTI-MATERIAL_GROUP Created...
+*ALE_STRUCTURED_MESH_CONTROL_POINTS Created...
+*ALE_STRUCTURED_MESH_CONTROL_POINTS Created...
+*ALE_STRUCTURED_MESH_CONTROL_POINTS Created...
+*ALE_STRUCTURED_MESH Created...
+*ALE_STRUCTURED_MESH_VOLUME_FILLING Created...
+*ALE_STRUCTURED_MESH_VOLUME_FILLING Created...
+*ALE_STRUCTURED_MESH_VOLUME_FILLING Created...
+*INITIAL_DETONATION Created...
+Database MATSUMCreated...
+Database GLSTATCreated...
+Saved Successfully!
+
After running this file, the result file is saved in pyDyna/ansys/dyna/pre/Server/output
.
(venv) C:\pyDyna\ansys\dyna\pre\Server> cd .\output\
+(venv) C:\pyDyna\ansys\dyna\pre\Server\output> ls
+
+
+ Directory: C:\pyDyna\ansys\dyna\pre\Server\output
+
+
+Mode LastWriteTime Length Name
+---- ------------- ------ ----
+-a---- 2022/7/5 8:19 2436058 efpcase.k
+
Submit the result file, efpcase.k
, to LS-Dyna for simulation results.
Here is a quick preview for how Python code looks using the
+pyansys-DynaSolver
. For more examples, click the links at the
+top of the page to see function, method, and class documentation.
>>> import ansys.dyna.core.solver as solver
+>>> hostname="localhost"
+>>> port="5000"
+>>> dyna=solver.DynaSolver(hostname,port)
+>>> dyna.push("input.k")
+>>> dyna.start(3)
+>>> dyna.run("i=input.k")
+
Here is a basic example:
+>>> import ansys.dyna.core.solver as solver
+>>> dyna=solver.DynaSovler(hostname,port) # connect to the container
+>>> dyna.push("input.k") # push an input file
+>>> dyna.start(4) # start 4 ranks of mppdyna
+>>> dyna.run("i=input.k memory=10m ncycle=20000") # begin execution
+