Process_data not in API

#1

Hello,

I’m trying to extract the raw values of the stresses at each node from the stresses at each element in a plane stress problem. By looking at the code, I saw that the function process_data in compas_fea.utilities.functions might suit my need. I’ve been testing its use on an established example (this one). Specifically, right after the analysis is run and the results extracted, I added the following lines to test the function:

nodes = mdl.nodes_xyz()
elements = [mdl.elements[i].nodes for i in sorted(mdl.elements, key=int)]
data = mdl.results['loads']['element']['smises']
functions.process_data(data=data, dtype='element', iptype='max', nodal='max', elements=elements, n=len(nodes))

where the remote module functions is imported as follows earlier in the code:

functions = Proxy('compas.utilities.functions')

I’m getting the following error:

Message: This function is not part of the API: process_data

Traceback:
  line 345, in proxy, "C:\Users\renau\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\compas\rpc\proxy.py"
  line 64, in <module>, "C:\Users\renau\AppData\Roaming\McNeel\Rhinoceros\6.0\scripts\test_shell.py"

I don’t understand why process_data cannot be used, while the postprocess function is accessible (since it is used by plot_data).

Am I doing something wrong or is process_data genuinely not accessible?

#2

perhaps this is just a typo in your post, but in any case, this

functions = Proxy('compas.utilities.functions')

should be

functions = Proxy('compas_fea.utilities.functions')
process_data

is part of the API (see line 96 in the screenshot) so it should be accessible…

#3

Hi there @danhaive,

You are right that process_data() is the function you need, as it will convert the raw element data into nodal data, paying close attention to what you pick as the nodal and iptype values. It looks like your signature is correct also, this is essentially called in the background for the plot_data() function in Rhino and Blender.

The function should indeed be callable without an issue, because it already does this via RPC in plot_data(), maybe it is the typo as @brgcode points out.

#4

Yes, thank you! I indeed messed up with the typo…