33===============
44Troubleshooting
55===============
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 .
77It also includes suggestions for improving scripts.
88
99Using the Server
@@ -19,13 +19,13 @@ the environment variable ``AWP_ROOT{VER}`` is set, where VER=212, 221, ....
1919
2020Connecting to DPF Server
2121~~~~~~~~~~~~~~~~~~~~~~~~
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()
2323<ansys.dpf.core.server.connect_to_server> `, ensure that the IP address and port number that are set as parameters
2424are applicable for a DPF server started on the network.
2525
2626Importing pydpf-core module
2727~~~~~~~~~~~~~~~~~~~~~~~~~~~
28- Assume that you are importing the pydpf-core module:
28+ Assume that you are importing the `` pydpf-core `` module:
2929
3030.. code-block :: default
3131
@@ -35,12 +35,41 @@ If an error lists missing modules, see the compatibility paragraph of :ref:`_ref
3535The module `ansys.grpc.dpf <https://pypi.org/project/ansys-grpc-dpf/ >`_ should always be synchronized with its server
3636version.
3737
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+
3867
3968Performance Issues
4069------------------
4170
4271Getting and Setting a Field's Data
43- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4473Accessing or modifying field data :py:class: `Field<ansys.dpf.core.field.Field> ` entity by entity can
4574be slow if the field's size is large or if the server is far from the Python client. To improve performance,
4675use :py:meth: `as_local_field()<ansys.dpf.core.field.Field.as_local_field> ` in a context manager.
0 commit comments