Skip to content

Instantly share code, notes, and snippets.

@akaszynski
Created May 7, 2021 16:37
Show Gist options
  • Save akaszynski/b5ffba6c326ac31af8dcf8939b411006 to your computer and use it in GitHub Desktop.
Save akaszynski/b5ffba6c326ac31af8dcf8939b411006 to your computer and use it in GitHub Desktop.
Stress test pymapdl
"""Simple stress test for pymapdl"""
from ansys.mapdl.core import launch_mapdl, LocalMapdlPool
pool = LocalMapdlPool(10, nproc=1)
# mapdl =launch_mapdl()
def make_kp(mapdl):
mapdl.clear()
mapdl.prep7()
nkp = 10000
for i in range(1, 1 + nkp):
mapdl.k(i, i, i, i)
if mapdl.geometry.knum.size != nkp:
n = mapdl.geometry.knum.size
print(f"only {n} kp")
mapdl.allsel()
from tqdm import tqdm
for i in tqdm(range(1000)):
pool.map(make_kp, progress_bar=False)
pool.exit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment