|
4 | 4 | Get material properties from the result file |
5 | 5 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
6 | 6 | Material properties are assigned to each element in APDL and by default they |
7 | | -are written out in the APDL result file. We can extract material properties |
8 | | -of each element using PyDPF by getting the properties from the `meshed_region`. |
9 | | -
|
10 | | -The material properties are then passed onto the operator |
11 | | -`mapdl_material_properties()` |
| 7 | +are written out in the APDL result file. This example shows how we can extract |
| 8 | +material properties of each element using PyDPF. |
12 | 9 |
|
13 | 10 | Import necessary modules: |
14 | 11 | """ |
|
21 | 18 | model = dpf.Model(examples.simple_bar) |
22 | 19 |
|
23 | 20 | ############################################################################### |
24 | | -# Get the `meshed_region` from model's metadata. |
| 21 | +# Get the :class:`meshed_region <ansys.dpf.core.meshed_region.MeshedRegion>` |
| 22 | +# from model's metadata. |
25 | 23 | mesh = model.metadata.meshed_region |
26 | 24 | print(mesh) |
27 | 25 |
|
28 | 26 | ############################################################################### |
29 | | -# See available properties in the `meshed_region` |
| 27 | +# See available properties in the :class:`meshed_region |
| 28 | +# <ansys.dpf.core.meshed_region.MeshedRegion>` |
30 | 29 | print(mesh.available_property_fields) |
31 | 30 |
|
32 | 31 | ############################################################################### |
33 | 32 | # Get all the material properties |
34 | 33 | mats = mesh.property_field("mat") |
35 | 34 |
|
36 | 35 | ############################################################################### |
37 | | -# Use the DPF operator `mapdl_material_properties` to extract data for the |
38 | | -# materials - `mats`. For the input `properties_name`, you need the correct |
39 | | -# material property string. To see what all strings are supported, you can |
40 | | -# print the operator help. |
| 36 | +# Use the DPF operator :class:`mapdl_material_properties |
| 37 | +# <ansys.dpf.core.operators.result.mapdl_material_properties.mapdl_material_properties>` |
| 38 | +# to extract data for the # materials - `mats`. For the input |
| 39 | +# `properties_name`, you need the correct material property string. To see |
| 40 | +# which strings are supported, you can print the operator help. |
41 | 41 | mat_prop = model.operator("mapdl_material_properties") |
42 | 42 | mat_prop.inputs.materials.connect(mats) |
43 | 43 |
|
44 | 44 | ############################################################################### |
45 | | -# For the input `properties_name`, you need the correct |
46 | | -# material property string. To see what all strings are supported, you can |
| 45 | +# For the input pin `properties_name`, you need the correct |
| 46 | +# material property string. To see which strings are supported, you can |
47 | 47 | # print the operator help. |
48 | 48 | print(mat_prop) |
49 | 49 |
|
|
0 commit comments