Hi,
On 5/11/23 04:22, 2232508--- via SfePy wrote:
Hi sfepy development team!
I try to probe the Cauchy stress of my FEM model. But errors occurred when defining the evaluation of the problem.
The full exception went like:
Traceback (most recent call last): File "D:\ProgramFiles\Anaconda3\envs\FEM_39\lib\site-packages\sfepy\base\base.py", line 556, in getitem ii = self.names.index(ii) ValueError: 'ii' is not in list
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "D:\ProgramFiles\Anaconda3\envs\FEM_39\lib\site-packages\sfepy\discrete\integrals.py", line 53, in get obj = self[name] File "D:\ProgramFiles\Anaconda3\envs\FEM_39\lib\site-packages\sfepy\base\base.py", line 563, in getitem raise IndexError(msg) IndexError: 'ii' is not in list
I cannot run it without the mesh, but IMO the issue is this: when using the imperative API, you need to pass the integral explicitly to pb.evaluate() call.
Try:
from sfepy.discrete import Integrals
stress = pb.evaluate('ev_cauchy_stress.ii.girder(m.D, u)', mode='eval', integrals=Integrals([integral]))
<snip>
Besides the above question, I wonder if there is any tutorial that shows how to write postprocess code interactively. I would greatly appreciate a full example from problem defining to postprocessing with coding style shown in this page Tutorial — SfePy version: 2023.1+git.fdee68c7 documentation.
Yes, this information is missing in the docs, especially with the imperative API. One usually does not need to write a post_process_hook function, but as seen above, there are some quirks.
r.