コード例 #1
0
    def test1a(self):
        from sampleassembly.saxml import parse_file
        import os
        dir, filename = os.path.split(sampleassembly_xml)
        save = os.path.abspath(os.curdir)
        os.chdir(dir)
        sa = parse_file(filename)

        from mccomponents.sample.sampleassembly_support \
             import sampleassembly2compositescatterer, \
             findkernelsfromxmls

        scatterercomposite = findkernelsfromxmls(
            sampleassembly2compositescatterer(sa))

        import mccomponents.homogeneous_scatterer as hs
        engine = hs.scattererEngine(scatterercomposite)

        os.chdir(save)
        for i in range(10):
            ev = mcni.neutron(r=(0, 0, -5), v=(0, 0, 3000))
            engine.scatter(ev)
            print ev
            continue

        return
コード例 #2
0
    def test1a(self):
        from sampleassembly.saxml import parse_file
        import os
        dir, filename = os.path.split(sampleassembly_xml)
        save = os.path.abspath(os.curdir)
        os.chdir(dir)
        sa = parse_file( filename )

        from mccomponents.sample.sampleassembly_support \
             import sampleassembly2compositescatterer, \
             findkernelsfromxmls
        
        scatterercomposite = findkernelsfromxmls(
            sampleassembly2compositescatterer( sa ) )
        
        import mccomponents.homogeneous_scatterer as hs
        engine = hs.scattererEngine( scatterercomposite )

        os.chdir(save)
        for i in range(1000):
            ev = mcni.neutron( r = (0,0,-5), v = (0,0,3000) )
            engine.scatter( ev )
            # print ev
            continue
        
        return
コード例 #3
0
    def test0(self):
        from sampleassembly.saxml import parse_file
        sa = parse_file( sampleassembly_xml )

        from mccomponents.sample.sampleassembly_support \
             import sampleassembly2compositescatterer, \
             findkernelsfromxmls

        scatterercomposite = findkernelsfromxmls(
            sampleassembly2compositescatterer( sa ) )

        import mccomponents.homogeneous_scatterer as hs
        engine = hs.scattererEngine( scatterercomposite )

        for i in range(10):
            ev = mcni.neutron( r = (0,0,-5), v = (0,0,3000) )
            engine.scatter( ev )
            print ev
            continue
        return
コード例 #4
0
ファイル: TestCase.py プロジェクト: McStasMcXtrace/MCViNE
    def test1a(self):
        from sampleassembly.saxml import parse_file
        sa = parse_file( sampleassembly_xml )

        from mccomponents.sample.sampleassembly_support \
             import sampleassembly2compositescatterer, \
             findkernelsfromxmls

        scatterercomposite = findkernelsfromxmls(
            sampleassembly2compositescatterer( sa ) )

        import mccomponents.homogeneous_scatterer as hs
        engine = hs.scattererEngine( scatterercomposite )

        for i in range(10):
            ev = mcni.neutron( r = (0,0,-5), v = (0,0,3000) )
            engine.scatter( ev )
            print ev
            continue

        return