working on getting baker to work in 3D. the code runs, but the numbers are odd. I suspect the rectangular grid, and am going to try a random cloud of points.

This commit is contained in:
Stephen Mardson McQuay
2010-03-18 23:18:59 -06:00
parent a2d7b3f063
commit b33159f8a9
8 changed files with 151 additions and 154 deletions
+10 -12
View File
@@ -6,18 +6,18 @@ from optparse import OptionParser
import numpy as np
from baker.tools import rms, exact_func
import grid
from grid.DD import simple_random_grid, simple_rect_grid
def get_mesh(source, destination, use_structured_grid = False):
mesh_source = None
mesh_dest = None
if use_structured_grid:
mesh_source = grid.simple_rect_grid(source, source)
mesh_dest = grid.simple_rect_grid(destination, destination)
mesh_source = simple_rect_grid(source, source)
mesh_dest = simple_rect_grid(destination, destination)
else:
mesh_source = grid.simple_random_grid(source)
mesh_dest = grid.simple_random_grid(destination)
mesh_source = simple_random_grid(source)
mesh_dest = simple_random_grid(destination)
if not (mesh_dest and mesh_source):
raise smberror('problem creating mesh objects')
@@ -39,35 +39,33 @@ if __name__ == '__main__':
dest="extra",
type='int',
default = 3,
help = "how many extra points")
help = "how many extra points (%default)")
parser.add_option("-s",
"--source-total",
dest="source_total",
type='int',
default = 100,
help = "total number of source points for random,\
resolution for structured")
help = "total number of source points for random, resolution for structured (%default)")
parser.add_option("-d",
"--destination-total",
dest="destination_total",
type='int',
default = 100,
help = "total number of destination points,\
resolution for structured")
help = "total number of destination points, resolution for structured (%default)")
parser.add_option("-r",
"--structured",
action = 'store_true',
default = False,
help = "use a structured grid instead of random point cloud")
help = "use a structured grid instead of random point cloud (%default)")
parser.add_option("-v",
"--verbose",
action = 'store_true',
default = False,
help = "verbosity")
help = "verbosity (%default)")
(options, args) = parser.parse_args()
+2 -2
View File
@@ -1,9 +1,9 @@
#!/usr/bin/python
#!/usr/bin/python2.6
import sys
import pickle
from grid import simple_rect_grid, simple_random_grid
from grid.DD import simple_rect_grid, simple_random_grid
from baker import run_baker
from baker.tools import smberror