PyDPF throws an error when the rst file is large

Hi,
I am trying to compute strain energy for a cyclic symmetry model using cyclic_strain_energy() operator. However, the rst file that I have has appx. 250 modes. I tried to compute the strain energy using the following code:

cyc_strain_energy_op = dpf.operators.result.cyclic_strain_energy()
cyc_strain_energy_op.inputs.time_scoping.connect (range(1,200) )
cyc_strain_energy_op.inputs.data_sources.connect(data_source)
cyc_strain_energy_op.inputs.read_cyclic.connect(2)
cyc_strain_energy = cyc_strain_energy_op.outputs.fields_container()

It returns the following error:
Traceback (most recent call last):
File "d:\bitBucket\FCDSLib\fcdslib_cyclicsymmetry_utilities\cyclic_symmetry_utilities\calc_strain_energy.py", line 184, in
strain_energy = calc_strain_energy(f_rst, list_comp=['PART1','PART2','PART3'], list_modes=None, cyclic_expansion=True)
File "d:\bitBucket\FCDSLib\fcdslib_cyclicsymmetry_utilities\cyclic_symmetry_utilities\calc_strain_energy.py", line 54, in calc_strain_energy
cyc_strain_energy = cyc_strain_energy_op.outputs.fields_container()
File "D:\PythonVenvs\pydpf_13\lib\site-packages\ansys\dpf\core\outputs.py", line 75, in call
return self.get_data()
File "D:\PythonVenvs\pydpf_13\lib\site-packages\ansys\dpf\core\outputs.py", line 72, in get_data
return self._operator.get_output(self._pin, type_output)
File "D:\PythonVenvs\pydpf_13\lib\site-packages\ansys\dpf\core\dpf_operator.py", line 543, in get_output
internal_obj = type_tuple[1](self, pin)
File "D:\PythonVenvs\pydpf_13\lib\site-packages\ansys\dpf\gate\generated\operator_capi.py", line 422, in operator_getoutput_fields_container
raise errors.DPFServerException(sError.value)
ansys.dpf.gate.errors.DPFServerException: bad allocation

However, it works fine if I use fewer modes (approximately. less than 100). I presume this is because of the memory allocation issue. Is there any way to handle this issue?

Thanks,
Samukham

Comments