-
-
April 29, 2024 at 12:52 pmLuca DannemannSubscriber
Hello everyone,Â
does anyone have experience with simulating in a loop? I am running many (>1000) simple simulations within an optimization algorithm. I use PyMapdl for this. With each simulation the required RAM in Python increases. If I do not run the simulations, the problem does not occur. Enclosed is a highly simplified Psyeudocode where the problem also occurs. Even starting and closing Ansys in each run does not solve the problem (apart from a considerable increase in runtime).import osfrom ansys.mapdl.core import launch_mapdlpath = os.path.abspath(__file__)directory = os.path.dirname(path)temp_dir = os.path.join(directory, 'temp_ansys')if not os.path.exists(temp_dir):Â Â os.makedirs(temp_dir)mapdl = launch_mapdl(nproc=4,run_location=temp_dir, override=True)def calculate_energy():Â Â mapdl.clear()Â Â mapdl.prep7()Â Â mapdl.blc4(0, 0, 1000, 1000)Â Â mapdl.blc4(1000, 0, 1000, 1000)Â Â mapdl.aglue('ALL')Â Â # BCÂ Â mapdl.ksel("S", "LOC", "X", 0)Â Â mapdl.ksel("A", "LOC", "X", 1000)Â Â mapdl.ksel("R", "LOC", "Y", 0)Â Â mapdl.dk("ALL", 'UX', 0)Â Â mapdl.dk("ALL", "UY", 0) ÂÂ Â mapdl.allsel()Â Â mapdl.clear()Â Â return 1for i in range(0,1000):Â Â a = calculate_energy()Â
-
April 30, 2024 at 10:02 ammjmiddleAnsys Employee
Try posting over:
https://discuss.ansys.com
-
April 30, 2024 at 10:14 amErik KostsonAnsys Employee
Our colleagues are helping :
https://github.com/ansys/pymapdl/discussions/3041
Â
Closing here
Erik
-
Viewing 2 reply threads
- The topic ‘Memory Leak PyMapdl’ is closed to new replies.
Ansys Innovation Space
Trending discussions
- How to apply Compression-only Support?
- At least one body has been found to have only 1 element in at least 2 directions
- Error when opening saved Workbench project
- Geometric stiffness matrix for solid elements
- Script Error Code:800a000d
- Timestep range set for animation export
- Image to file in Mechanical is bugged and does not show text
- Elastic limit load, Elastic-plastic limit load
- Element has excessive thickness change, distortion, is turning inside out
Top Contributors
-
1727
-
630
-
599
-
591
-
366
Top Rated Tags
© 2025 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.