spacether / pycalculix

Python 3 library to automate and build finite element analysis (FEA) models in Calculix. Meshing uses Calculix or GMSH.
http://justinablack.com/pycalculix/
Apache License 2.0
170 stars 56 forks source link

mode = mode_by_name[name] KeyError: 'ERROR' #73

Closed VallesMarinerisExplorer closed 4 years ago

VallesMarinerisExplorer commented 4 years ago

Hi all, looks like a cool repo. Looking forward to learning more about it. On the dam.py example, I ran the code and it creates the mesh, shows the pressure forces applied and then shows the constraints. After that, I get this error message. Thanks for your help!

PyCharm 2018.2 Windows 10 Python 3.7

Solving done! Using Calculix ccx version=2.15 (trailing characters like the p in 2.8p are omitted) Loading nodal results from file: dam.frd Reading displ storing: ux,uy,uz,utot Reading stress storing: Sx,Sy,Sz,Sxy,Syz,Szx,Seqv,S1,S2,S3 Reading strain storing: ex,ey,ez,exy,eyz,ezx,eeqv,e1,e2,e3 Reading force storing: fx,fy,fz Traceback (most recent call last): File "C:/Users/Owner/PycharmProjects/SMADLAB/dam.py", line 97, in prob.solve() File "C:\Users\Owner\AppData\Local\Programs\Python\Python37\lib\site-packages\pycalculix\problem.py", line 285, in solve self.rfile.load() File "C:\Users\Owner\AppData\Local\Programs\Python\Python37\lib\site-packages\pycalculix\results_file.py", line 97, in load self.read_frd() # read nodal results File "C:\Users\Owner\AppData\Local\Programs\Python\Python37\lib\site-packages\pycalculix\results_file.py", line 1150, in read_frd arr = self.modearr_nresults(infile) File "C:\Users\Owner\AppData\Local\Programs\Python\Python37\lib\site-packages\pycalculix\results_file.py", line 1022, in modearr_nresults mode = mode_by_name[name] KeyError: 'ERROR'

Process finished with exit code 1

flrs commented 4 years ago

It looks as if #69 fixes this issue.

However, a new version of pycalculix that includes the fix needs to be released on pypi.org for you to install it via pip install pycalculix.

If you do not want to wait until then, you can install a developer version of pycalculix as described in the readme. This solved the issue for me.

VallesMarinerisExplorer commented 4 years ago

Yep! That fixed it for me!

Thanks for your help!