calculix / ccx2paraview

CalculiX to Paraview converter (frd to vtk/vtu). Makes possible to view and postprocess CalculiX analysis results in Paraview. Generates Mises and Principal components for stress and strain tensors.
GNU General Public License v3.0
84 stars 18 forks source link

Perturbation step for a frequency analysis after a static step #29

Open imirzov opened 1 year ago

imirzov commented 1 year ago

https://calculix.discourse.group/t/converter-ccx2paraview-for-large-frd-files/1259/15

Hello,

Just to report a bug on the ccx2paraview converter. Not sure if is the right place. But anyway here it is. I think the author keeps an eye into the forum, so first of all thanks for coding this very useful tool (at least for the workflow i use).

The bug occurs when placing a perturbation step for a frequency analysis after a static step.

Example:

== ANALYSIS SECTION == TIME POINTS, NAME=T0 0.200,0.400,0.600,0.800,1.000 STEP STATIC BOUNDARY RefNode,6,6,0.03 EL FILE, TIMEPOINTS=T0 S,E NODE FILE, TIMEPOINTS=T0 U,RF END STEP STEP,PERTURBATION FREQUENCY 10 EL FILE S,E NODE FILE U,RF END STEP

Error:

[...] INFO: Writing n-twist_model.05.vtu Traceback (most recent call last): File "/home2/jl/workspace/software_devel/ccx2paraview/ccx2paraview.py", line 992, in main() File "/home2/jl/workspace/software_devel/ccx2paraview/ccx2paraview.py", line 987, in main ccx2paraview.run() File "/home2/jl/workspace/software_devel/ccx2paraview/ccx2paraview.py", line 904, in run result_blocks = self.frd.parse_results(step, inc) # NOTE Could be empty list [] File "/home2/jl/workspace/software_devel/ccx2paraview/ccx2paraview.py", line 696, in parse_results result_blocks.append(self.calculate_principal(b)) File "/home2/jl/workspace/software_devel/ccx2paraview/ccx2paraview.py", line 780, in calculate_principal eigenvalues = np.linalg.eigvals(tensor).tolist() File "<__array_function__ internals>", line 5, in eigvals File "/usr/lib/python3/dist-packages/numpy/linalg/linalg.py", line 1063, in eigvals _assert_finite(a) File "/usr/lib/python3/dist-packages/numpy/linalg/linalg.py", line 209, in _assert_finite raise LinAlgError("Array must not contain infs or NaNs") numpy.linalg.LinAlgError: Array must not contain infs or NaNs

So the error occurs when trying to convert the frequency steps.

The procedure finishes without error if we comment the code between lines 694 to 700.

               if b.name == 'S':
                    result_blocks.append(self.calculate_mises_stress(b))
                    result_blocks.append(self.calculate_principal(b))
                if b.name == 'E':
                    result_blocks.append(self.calculate_mises_strain(b))
                    result_blocks.append(self.calculate_principal(b))

but there is still a warning:

[...] INFO: Writing n-twist_model.05.vtu INFO: Step 6, time 2750.3, U, 3 components, 34432 values INFO: Step 6, time 2750.3, S, 6 components, 34432 values WARNING: 69264 NaN values are converted to 0.0 INFO: Step 6, time 2750.3, E, 6 components, 34432 values INFO: Step 6, time 2750.3, RF, 3 components, 34432 values WARNING: 48780 NaN values are converted to 0.0 INFO: Step 6, time 2750.3, ERROR, 1 components, 34432 values [...]

to be honest to my workflow it would be usefull if there was a way to select if to compute these additional quantities or not (misses and principal values). This is because I use the vtk api to further compute additional quantities (including the principal vectors, which make the initial computation of principal values redundant).

Hope this info is useful, thanks again, regards, Jorge