Commits

Matthew Turk committed b7d6e9f

ART sort of works; allocates a ridiculous amount of RAM so as to avoid figuring
out why the oct count is wrong.

Comments (0)

Files changed (1)

test_art_octre.py

 from yt.mods import *
+from yt.geometry.oct_container import RAMSESOctreeContainer
+import yt.geometry.selection_routines as sel
 from art_header import read_header
 from art_header import _count_art_octs
 from art_header import _read_art_level_info
 LE = na.array([0.0, 0.0, 0.0], dtype='float64')
 RE = na.array([1.0, 1.0, 1.0], dtype='float64')
 
-nocts = 256**3
+nocts = NX.prod()
 pos = f.tell()
 for level in range(1, max_level+1):
     # read level info into POS
     # 1 is the CPU, -1 is not used, 1 is the domain ID
     le, fln, nLevel = _read_art_level_info(f, level_oct_offsets,level,root_level=15)
     nocts += le.shape[0]
-    print level, nLevel
+    print level, nLevel, le.shape
 print "NUMBER OF OCTS", nocts
 
 art_oct = RAMSESOctreeContainer(NX, LE, RE)
-art_oct.allocate_domains([nocts])
+art_oct.allocate_domains([8*nocts])
 
 root_dx = (RE - LE) / NX
 LL = LE + root_dx/2.0
 sp_obj.radius = 0.1
 sp = sel.SphereSelector(sp_obj)
 
-mask = na.zeros(sp.nocts, dtype="bool")
+mask = na.zeros(8*nocts, dtype="bool")
 
 cells = art_oct.count_cells(sp, mask)
 nc = cells.sum()