def gen_alara_fluxin(mesh, fluxin, high_to_low_bool): """Create the ALARA fluxin file Parameters ---------- mesh : ScdMesh or iMesh.Mesh() Mesh object tagged with flux information to be written. fluxin : string Filename/path for ALARA fluxin file. """ print "Writing alara fluxin file `{0}'".format(fluxin) write_alara_fluxin(fluxin, mesh, high_to_low_bool)
print "Will use {0} rays per mesh row".format(mmgrid_rays) grid = mmgrid.mmGrid( smesh ) grid.generate( mmgrid_rays, False ) grid.createTags() print "Saving fluxes and materials to `{0}'".format(datafile) smesh.imesh.save(datafile) if visfile != None: print "Producing visualization file `{0}' with mbconvert".format(visfile) os.system('mbconvert {0} {1}'.format(datafile,visfile)) print "Writing alara problem file `{0}'".format(alara_geom) mdict = get_material_dict() write_alara_geom( alara_geom, smesh, mdict ) if alara_snippet: print "Appending alara snippet file `{0}' to problem file".format(alara_snippet) with open(alara_geom,'a') as f: with open(alara_snippet,'r') as snip: f.write(snip.read()) print "Writing alara fluxin file `{0}'".format(fluxin) write_alara_fluxin( fluxin, smesh, backwards=True ) print "It should now be possible to run `alara {0}'".format(alara_geom) print "and proceed to step 2 of the workflow."