ansys / pydpf-core

Data Processing Framework - Python Core
http://dpf.docs.pyansys.com/
MIT License
69 stars 25 forks source link

Help Wanted: How to get User-Defined-Results from rst-file with pydpf #413

Open jaegseb opened 2 years ago

jaegseb commented 2 years ago

Hello, im trying to get custom results from rst file with the custim operator:

`from ansys.dpf import core as dpf

myFile = "N:/.../file.rst" myModel = dpf.Model(myFile)

op = dpf.operators.result.custom() # operator instantiation op.inputs.data_sources.connect(myModel) result = op.outputs.fields_container()`

but i always get the following error: DPFServerException: custom<-Source operator "mapdl::rst::custom" not found

Anyone know how to fix this?

Thank you

pmaroneh commented 2 years ago

Hi @jaegseb , I would first start by checking that the path is understood correctly. It would be preferable to use the os module and define the path through os.path.join(). Then once you've made sure the path exists, check that there is something in the model: what does print(myModel) return?

PProfizi commented 2 years ago

Hi @jaegseb! Just to be sure I understand your issue, you have made a custom operator for DPF as a plugin, in Python or C++? And now you are trying to use it and the DPF Server tells you it does not recognize this operator. I guess you followed what is explained in the doc here, right? If that is the case, then I think there might be a command missing for loading your custom plugin before being able to use it: dpf.load_library