3
3
===============
4
4
Troubleshooting
5
5
===============
6
- This section explains how to resolve the most common issues encountered with `` pydpf-core `` .
6
+ This section explains how to resolve the most common issues encountered with PyDPF-Core .
7
7
It also includes suggestions for improving scripts.
8
8
9
9
Using the Server
@@ -19,13 +19,13 @@ the environment variable ``AWP_ROOT{VER}`` is set, where VER=212, 221, ....
19
19
20
20
Connecting to DPF Server
21
21
~~~~~~~~~~~~~~~~~~~~~~~~
22
- If an issue appears while using the pydpf-core API to connect to an initialized server with :py:meth: `connect_to_server()
22
+ If an issue appears while using the `` pydpf-core `` API to connect to an initialized server with :py:meth: `connect_to_server()
23
23
<ansys.dpf.core.server.connect_to_server> `, ensure that the IP address and port number that are set as parameters
24
24
are applicable for a DPF server started on the network.
25
25
26
26
Importing pydpf-core module
27
27
~~~~~~~~~~~~~~~~~~~~~~~~~~~
28
- Assume that you are importing the pydpf-core module:
28
+ Assume that you are importing the `` pydpf-core `` module:
29
29
30
30
.. code-block :: default
31
31
@@ -35,12 +35,41 @@ If an error lists missing modules, see the compatibility paragraph of :ref:`_ref
35
35
The module `ansys.grpc.dpf <https://pypi.org/project/ansys-grpc-dpf/ >`_ should always be synchronized with its server
36
36
version.
37
37
38
+ Using the Model
39
+ ---------------
40
+
41
+ Invalid UTF-8 Error
42
+ ~~~~~~~~~~~~~~~~~~~
43
+ Assume that you are trying to access the py:class: `Model<ansys.dpf.core.model.Model> `.
44
+ The following error can be raised:
45
+
46
+ .. code-block :: default
47
+
48
+ [libprotobuf ERROR C:\.conan\897de8\1\protobuf\src\google\protobuf\wire_format_lite.cc:578]
49
+ String field 'ansys.api.dpf.result_info.v0.ResultInfoResponse.user_name' contains invalid UTF-8
50
+ data when serializing a protocol buffer. Use the 'bytes' type if you intend to send raw bytes.
51
+
52
+ This will prevent the model from being accessed. To avoid a this error, ensure that you are using
53
+ a PyDPF-Core version higher than 0.3.2. In this case, a warning will still be raised, but it should not
54
+ prevent the use of the Model.
55
+
56
+ Then, with result files reproducing this issue, to avoid the warning to pop up, you can use:
57
+
58
+ .. code-block :: default
59
+
60
+ from ansys.dpf import core as dpf
61
+ dpf.settings.set_dynamic_available_results_capability(False)
62
+
63
+ However, this will disable the reading and generation of the available results of the model: static prewritten
64
+ available results will be used instead.
65
+
66
+
38
67
39
68
Performance Issues
40
69
------------------
41
70
42
71
Getting and Setting a Field's Data
43
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44
73
Accessing or modifying field data :py:class: `Field<ansys.dpf.core.field.Field> ` entity by entity can
45
74
be slow if the field's size is large or if the server is far from the Python client. To improve performance,
46
75
use :py:meth: `as_local_field()<ansys.dpf.core.field.Field.as_local_field> ` in a context manager.
0 commit comments