diff options
author | Adrian Kummerlaender | 2021-03-27 22:35:43 +0100 |
---|---|---|
committer | Adrian Kummerlaender | 2021-03-27 22:35:43 +0100 |
commit | 75ef8db0d058158c10951a4184186f8c6cc27acc (patch) | |
tree | 03a33785b65472fc5eff9cc5d2c03379747b83d4 /benchmark.py | |
download | interacticle-75ef8db0d058158c10951a4184186f8c6cc27acc.tar interacticle-75ef8db0d058158c10951a4184186f8c6cc27acc.tar.gz interacticle-75ef8db0d058158c10951a4184186f8c6cc27acc.tar.bz2 interacticle-75ef8db0d058158c10951a4184186f8c6cc27acc.tar.lz interacticle-75ef8db0d058158c10951a4184186f8c6cc27acc.tar.xz interacticle-75ef8db0d058158c10951a4184186f8c6cc27acc.tar.zst interacticle-75ef8db0d058158c10951a4184186f8c6cc27acc.zip |
Initial public commit of this basic MD code
Simulation of interacting particles
Diffstat (limited to 'benchmark.py')
-rw-r--r-- | benchmark.py | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/benchmark.py b/benchmark.py new file mode 100644 index 0000000..26bde57 --- /dev/null +++ b/benchmark.py @@ -0,0 +1,46 @@ +import sys +import numpy as np +from timeit import default_timer as timer + +from interacticle import MoleculeCollection, LennardJones, Coulomb, Simulation + +from library import Argon + +setup = MoleculeCollection() + +setup.potential(LennardJones(39.948, 0.3395, 0.971)) + +for x in range(10): + for y in range(10): + for z in range(10): + setup.add(Argon, (0.2+0.5*x,0.2+0.5*y,0.2+0.5*z)) + +setup.domain_size = 5 +setup.tau = 0.0005 +setup.cutoff = 0.3395*2.5 +setup.target_temperature = 300 + +setup.max_lennard_jones = 2000 +setup.max_coulomb = 2000 + +setup.statistics_step = 100 +setup.neighborhood_step = int(sys.argv[1]) if len(sys.argv) == 2 else 100 + +simulation = Simulation(setup, opengl = False) +simulation.setup() +simulation.verbose = True + +neighborhood_sizes = [ ] + +start = timer() + +for i in range(10000): + simulation.evolve() + if i % setup.statistics_step == 0: + neighborhood_sizes.append(simulation.get_neighborhood_characteristics()[1]) + +duration = timer() - start + +updates_per_second = 10000 / duration + +print(f"{setup.neighborhood_step}, {updates_per_second:.2f}, {np.max(neighborhood_sizes):.2f}") |