Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

result.animate_nodal_displacement() crashes #112

Closed
pmaroneh opened this issue Feb 17, 2022 · 9 comments · Fixed by #113
Closed

result.animate_nodal_displacement() crashes #112

pmaroneh opened this issue Feb 17, 2022 · 9 comments · Fixed by #113
Assignees
Labels
bug Something isn't working

Comments

@pmaroneh
Copy link

pmaroneh commented Feb 17, 2022

I've run a modal analysis, which I'd like to postprocess.

result = mapdl.result
result.animate_nodal_displacement(1)

does create an animation of the first mode
image
but when closing the plot window, the following error is returned:
image

I'll paste the complete error message in comment, but I don't know how to address this.

@pmaroneh pmaroneh added the bug Something isn't working label Feb 17, 2022
@pmaroneh
Copy link
Author

Complete error message:

2022󈚦󈚵 14:05:13.018 (5914.284s) [ ] vtkOpenGLState.cxx:1795 WARN| Hardware does not support the number of textures defined.
2022󈚦󈚵 14:05:13.019 (5914.284s) [ ] vtkOpenGLState.cxx:1795 WARN| Hardware does not support the number of textures defined.
2022󈚦󈚵 14:05:13.019 (5914.284s) [ ] vtkOpenGLState.cxx:1795 WARN| Hardware does not support the number of textures defined.
2022󈚦󈚵 14:05:13.019 (5914.284s) [ ] vtkOpenGLState.cxx:1795 WARN| Hardware does not support the number of textures defined.
2022󈚦󈚵 14:05:13.019 (5914.285s) [ ] vtkOpenGLState.cxx:1795 WARN| Hardware does not support the number of textures defined.
2022󈚦󈚵 14:05:13.019 (5914.285s) [ ] vtkOpenGLState.cxx:1795 WARN| Hardware does not support the number of textures defined.
2022󈚦󈚵 14:05:13.019 (5914.285s) [ ] vtkOpenGLState.cxx:1795 WARN| Hardware does not support the number of textures defined.
2022󈚦󈚵 14:05:13.020 (5914.286s) [ ] vtkOpenGLState.cxx:1795 WARN| Hardware does not support the number of textures defined.
2022󈚦󈚵 14:05:13.020 (5914.286s) [ ] vtkOpenGLState.cxx:1795 WARN| Hardware does not support the number of textures defined.
2022󈚦󈚵 14:05:13.020 (5914.286s) [ ] vtkOpenGLState.cxx:1795 WARN| Hardware does not support the number of textures defined.
2022󈚦󈚵 14:05:13.020 (5914.286s) [ ] vtkShaderProgram.cxx:437 ERR| vtkShaderProgram (000002434905E3E0): 1: #version 150
2: #ifndef GL_ES
3: #define highp
4: #define mediump
5: #define lowp
6: #endif // GL_ES
7: #define attribute in
8: #define varying out
9: 
10: 
11: /*=========================================================================
12: 
13: Program: Visualization Toolkit
14: Module: vtkPolyDataVS.glsl
15: 
16: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
17: All rights reserved.
18: See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
19: 
20: This software is distributed WITHOUT ANY WARRANTY; without even
21: the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
22: PURPOSE. See the above copyright notice for more information.
23: 
24: =========================================================================*/
25: 
26: in vec4 vertexMC;
27: 
28: 
29: 
30: // frag position in VC
31: //VTK::PositionVC::Dec
32: 
33: // optional normal declaration
34: //VTK::Normal::Dec
35: 
36: // extra lighting parameters
37: //VTK::Light::Dec
38: 
39: // Texture coordinates
40: in vec2 tcoord;
41: out vec2 tcoordVCVSOutput;
42: 
43: 
44: // material property values
45: //VTK::Color::Dec
46: 
47: // clipping plane vars
48: //VTK::Clip::Dec
49: 
50: // camera and actor matrix values
51: uniform mat4 MCDCMatrix;
52: 
53: // Apple Bug
54: //VTK::PrimID::Dec
55: 
56: // Value raster
57: //VTK::ValuePass::Dec
58: 
59: // picking support
60: //VTK::Picking::Dec
61: 
62: void main()
63: {
64: //VTK::CustomBegin::Impl
65: 
66: //VTK::Color::Impl
67: 
68: //VTK::Normal::Impl
69: 
70: tcoordVCVSOutput = tcoord;
71: 
72: 
73: //VTK::Clip::Impl
74: 
75: //VTK::PrimID::Impl
76: 
77: gl_Position = MCDCMatrix * vertexMC;
78: 
79: 
80: //VTK::ValuePass::Impl
81: 
82: //VTK::Light::Impl
83: 
84: //VTK::Picking::Impl
85: 
86: //VTK::CustomEnd::Impl
87: }

2022󈚦󈚵 14:05:13.022 (5914.287s) [ ] vtkShaderProgram.cxx:438 ERR| vtkShaderProgram (000002434905E3E0): Could not create shader object.

@CesarRodriguezPereira
Copy link

Yeah, this issue happens to me, but if I had to guess I'd say it's probably more related with VTK than pyansys itself.

I run my pyansys sessions from an ipython notebook within VScode, and run the animations on different windows (as the inline animations don't work, at least within this IDE it just shows an static image until you interrupt execution). If you close the window that's showing the animation, it produces a kernel crash (which is way past an exception). The only way to show multiple animations is to interrupt the cell manually, leaving the animation window non responsive, and then running the cell again.

This isn't too much of a hassle, but makes long design exploration sessions a bit tedious, as you end up with 10s of unresponsive windows, that you can only get rid of by closing and opening the IDE itself.

For your case, I can think of 2 workarounds:

  • Do the same thing I do, and work from a notebook environment.
  • If you want to keep working from pure python, set options loop=False and movie_filename='name_you_want.gif'. Then you'll be able to explore your animations as gifs created within your current working directory.

@akaszynski
Copy link
Collaborator

@CesarRodriguezPereira, thanks for the clarification. I think when reporting errors it's super helpful to have the user context/environment so they can be reproduced and debugged by a developer.

@germa89, let me know if you can take a look at this. It's still in support of the legacy reader, but it seems that it's still quite popular until pydpf-core can get animation.

@germa89
Copy link
Contributor

germa89 commented Feb 21, 2022

I will have a look as soon as I can

@germa89
Copy link
Contributor

germa89 commented Feb 21, 2022

It seems to be an issue with the legacy reader, more specifically, with the "loop" keyword. I believe that closing the window does not kill/close properly the background process which keeps updating the animation.

@germa89
Copy link
Contributor

germa89 commented Feb 21, 2022

I'm not 100% sure, but I believe there is "close_window" event missing.

We should probably add something like:

plotter.add_key_event("exit", q_callback)

to:

https://github.com/pyansys/pymapdl-reader/blob/61c5d7e90a64ba71198b1bbc3b1201036ea559e2/ansys/mapdl/reader/rst.py#L2840-L2842

@akaszynski
Copy link
Collaborator

Good point. @germa89, can you take care of that?

@germa89
Copy link
Contributor

germa89 commented Feb 21, 2022

Will do my best.

@germa89 germa89 transferred this issue from ansys/pymapdl Feb 22, 2022
@germa89
Copy link
Contributor

germa89 commented Feb 22, 2022

Transferred to pymapdl reader because the error is in that library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants