Open pmaroneh opened 1 year ago
Hi @pmaroneh, Just started looking at the issue, and it seems this exact error can only appear if:
complex
(meaning it contains fields for real and for imaginary part)time
Would it be possible to check for all of these criteria?
It is most likely that disp_fc
does not have the complex
label.
You can check that by printing the available labels of the FieldsContainer
like so:
print(disp_fc.labels)
PS: I will ask for the operator's documentation and specification to be updated as it seems most pins are optional but not marked as such, and some pin descriptions are not clear enough.
Hi PProfizi - Thanks for the help!
If I extract the displacement field from a damped Harmonic solution, the displacements should be complex (right?) Can i manually assign the "complex" label, and simply set complex part to zero in cases where displacements are purely real-valued?
Hi @KristianKvistIbsen,
To make sure the displacements are complex, you can use the following command to list the labels associated to the FieldsContainer
:
print(disp_fc.labels)
It seems right now we do not have an operator to add a null imaginary part to all fields in a FieldsContainer
, yet here is how you can do it:
from ansys.dpf import core as dpf
#############
# Construct a mock FieldsContainer with only real fields labelled in time
field_real = dpf.field_from_array([1., 2., 3.])
fc_real = dpf.fields_container_factory.over_time_freq_fields_container(
fields=[field_real],
)
print(fc_real)
#############
# Copy the real FieldsContainer, multiply it by zero
fc_imaginary = (fc_real.deep_copy() * 0.).eval()
# then manually add the "complex" label to each FieldsContainer
fc_real.add_label(label="complex", default_value=0)
print(fc_real)
fc_imaginary.add_label(label="complex", default_value=1)
print(fc_imaginary)
# and merge the two
fc_complex = dpf.operators.utility.merge_fields_containers(
fields_containers1=fc_real, fields_containers2=fc_imaginary
).eval()
print(fc_complex)
Thanks again! - I will run a test to see if i can get some results from the erp_accumulate_results() operator. I will return with an update.
UPDATE:
I have re-run the code originally posted by @pmaroneh, still resulting in the error:
DPFServerException: erp_accumulate_results:31<-ERP input parameters are missing or badly defined.
Printing labels resulted in:
print(disp_fc.labels)
['complex', 'time']
Before submitting the issue
Description of the bug
All input pins of erp_accumulate_results operator have been defined, but I get an error message saying that some input parameters are missing or badly defined.
This has been reported here: https://discuss.ansys.com/discussion/comment/3118#Comment_3118
Steps To Reproduce
Execute following code:
Which Operating System causes the issue?
Windows
Which DPF/Ansys version are you using?
Ansys 2023 R1
Which Python version causes the issue?
3.10
Installed packages
ansys-dpf-core 0.10.0
asttokens 2.4.1
cachetools 5.3.2
certifi 2023.11.17 charset-normalizer 3.3.2
colorama 0.4.6
comm 0.2.0
debugpy 1.8.0
decorator 5.1.1
exceptiongroup 1.2.0
executing 2.0.1
google-api-core 2.14.0
google-api-python-client 2.108.0 google-auth 2.23.4 google-auth-httplib2 0.1.1 googleapis-common-protos 1.61.0 grpcio 1.59.3 httplib2 0.22.0 idna 3.4 importlib-metadata 6.8.0 ipykernel 6.26.0 ipython 8.17.2 jedi 0.19.1 jupyter_client 8.6.0 jupyter_core 5.5.0 matplotlib-inline 0.1.6 nest-asyncio 1.5.8 numpy 1.26.2 packaging 23.2 parso 0.8.3 pip 23.3.1 platformdirs 4.0.0 prompt-toolkit 3.0.41 protobuf 4.25.1 psutil 5.9.6 pure-eval 0.2.2 pyasn1 0.5.1 pyasn1-modules 0.3.0 Pygments 2.17.1 pyparsing 3.1.1 python-dateutil 2.8.2 pywin32 306 pyzmq 25.1.1 requests 2.31.0 rsa 4.9 setuptools 65.5.0 six 1.16.0 stack-data 0.6.3 tornado 6.3.3 tqdm 4.66.1 traitlets 5.13.0 uritemplate 4.1.1 urllib3 2.1.0 wcwidth 0.2.11 zipp 3.17.0