Exemple #1
0
def load_geom(filename):
    """Load geometry from the given file into dagmc

    This is provided as a convenience so client code doesn't need to invoke 
    pydagmc.  Note that DagMC can only have one set of geometry loaded per 
    program invocation.  This means that this function should only be called 
    once, and the resulting geometry will become globally visible to all 
    clients of mmgrid.
    """
    dagmc.load( filename )
Exemple #2
0
def load_geom(filename):
    """Load geometry from the given file into dagmc

    This is provided as a convenience so client code doesn't need to invoke 
    pydagmc.  Note that DagMC can only have one set of geometry loaded per 
    program invocation.  This means that this function should only be called 
    once, and the resulting geometry will become globally visible to all 
    clients of mmgrid.

    Parameters
    ----------
    filename : string
        Filename with geometry information. Typically a .sat file.
    """
    dagmc.load(filename)
input_file = str(sys.argv[1])

print '++++++++++++++++++++++++++++++++++'
print '+  PyDagMC lost particle tool    +'
print '++++++++++++++++++++++++++++++++++'

try:
    with open(input_file) as f:
        pass
except IOError as e:
    print '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
    print 'File ', input_file, ' does not exist'
    print '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
    exit()

dagmc.load(input_file)  #load geometry file

#dagmc.load('divertor_merged.h5m')

# find out where pos is
pos = (625.0, -43.4, 0.0)
dir = (1.0, 0.0, 0.0)
first_vol = dagmc.find_volume(pos, dir)

# open output file for ray story
file = open("output.txt", "a")

num_lost = 0
nps = 10000000

for i in range(1, nps):
Exemple #4
0
 def test__load( self ):
     path = os.path.join( os.path.dirname( __file__ ), 'unitbox.h5m' )
     dagmc.load( path )
print '++++++++++++++++++++++++++++++++++'
print '+  PyDagMC lost particle tool    +'
print '++++++++++++++++++++++++++++++++++'

try:
   with open(input_file) as f: pass
except IOError as e:
   print '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
   print 'File ',input_file,' does not exist'
   print '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
   exit()



dagmc.load(input_file) #load geometry file

#dagmc.load('divertor_merged.h5m')

# find out where pos is
pos=(625.0,-43.4,0.0)
dir=(1.0,0.0,0.0)
first_vol=dagmc.find_volume(pos,dir)

# open output file for ray story
file = open("output.txt","a")

num_lost=0
nps = 10000000

for i in range(1,nps):