|
1 | | -.. _ref_api_index: |
| 1 | +============ |
| 2 | +DPF-Post API |
| 3 | +============ |
| 4 | +This guide provides an overview of the DPF-Post API. |
2 | 5 |
|
3 | | -API Reference |
4 | | -============= |
5 | | -Details of the DPF API. |
| 6 | +DPF-Post leverages three main categories of objects: |
6 | 7 |
|
| 8 | +1. **Solution**: it is the entry point to the results file, its |
| 9 | + metadata and contents. |
7 | 10 |
|
8 | | -Solution Object |
9 | | ---------------- |
10 | | -The solution object instantiates an object that is built on the result |
11 | | -file. Use the following code to instantiate a solution object. |
| 11 | +2. **Result**: it provides access to specific result types, in |
| 12 | + accordance with the type of analysis. |
12 | 13 |
|
13 | | -.. code:: python |
| 14 | +3. **ResultData**: it provides access to the actual data values and |
| 15 | + closely relates to the DPF-Core "Fields Container" concept. |
14 | 16 |
|
15 | | - >>> from ansys.dpf import post |
16 | | - >>> from ansys.dpf.post import examples |
17 | | - >>> solution = post.load_solution(examples.multishells_rst) |
18 | 17 |
|
19 | | -
|
20 | | -Result Object |
21 | | -------------- |
22 | | -The result object can be manipulated to get different result data. |
23 | | - |
24 | | -.. code:: python |
25 | | -
|
26 | | - >>> from ansys.dpf import post |
27 | | - >>> from ansys.dpf.post import examples |
28 | | - >>> solution = post.load_solution(examples.multishells_rst) |
29 | | - >>> # Displacement result object |
30 | | - >>> displacement = solution.displacement() |
31 | | - >>> # Stress result object |
32 | | - >>> stress = solution.stress() |
33 | | - >>> # Elastic strain result object |
34 | | - >>> elastic_strain = solution.elastic_strain() |
35 | | -
|
36 | | -
|
37 | | -ResultData Class |
38 | | ----------------- |
39 | | -The ``ResultData`` class is instantiated from a result object. It |
40 | | -enables easy access to the data contained within the result |
41 | | -object. The following example shows how to get an instance of |
42 | | -``ResultData``. |
43 | | - |
44 | | -.. code:: python |
45 | | -
|
46 | | - >>> from ansys.dpf import post |
47 | | - >>> solution = post.load_solution(r'../../../testfiles/tests/model_with_ns.rst') |
48 | | - >>> displacement = solution.displacement() |
49 | | - >>> result = displacement.vector |
50 | | - >>> # access the data |
51 | | - >>> vector.get_data_at_field(0) |
52 | | - |
53 | | -.. autoclass:: ansys.dpf.post.result_data.ResultData |
54 | | - :members: |
| 18 | +.. toctree:: |
| 19 | + :maxdepth: 2 |
| 20 | + :caption: Contents |
| 21 | + |
| 22 | + solution |
| 23 | + result_object |
| 24 | + result_data |
0 commit comments