-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.py
39 lines (27 loc) · 924 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from sources.galaxies import *
from sources.engines import *
from sources.simulators import *
from sources.common.graphs import *
try:
import matplotlib
matplotlib.use("TkAgg")
import cupy as np
print('CUPY VERSION DETECTED')
except ImportError:
import numpy as np
def testGeneration():
galaxy = DiskGalaxy3D('MILKY_WAY', 10000)
plotCumulativeMass(galaxy)
def testUniform():
plotUniformSphere()
def singleGalaxyTest():
execDir = os.path.dirname(os.path.abspath(__file__))
clusters = [DiskGalaxy2D('MILKY_WAY', 1000, 1, 75, mass=1)]
sim = Simulator(clusters, execDir, mode='BARNES_HUT')
sim.run(0.1, 50, method='EULER_SEMI_IMPLICIT')
createGIF2D(sim.sessionPath, size=5)
def testCreationGIF():
path = 'D:\\_PROJECTS\\PYTHON PROJECTS\\Galaxy_Merger\\logs\\20220630224442'
createGIF2D(path, size=(100, 90))
if __name__ == "__main__":
testGeneration()