def test3(self):
        '''create pure python representation of a homogeneous scatterer with
        composite kernel. render the c++ computation engine of that kernel.
        '''
        #shape
        from mccomposite.geometry import primitives
        shape = primitives.block( (1,1,1) )

        #kernel
        nprinter = NeutronPrinter( )
        
        #composite kernel
        composite_kernel = hs.compositeKernel()
        composite_kernel.addElement( nprinter )

        #scatterer
        scatterer = hs.homogeneousScatterer(
            shape, composite_kernel)

        #render the c++ representation
        cscatterer = hs.scattererEngine( scatterer )

        for i in range(10):
            ev = mcni.neutron( r = (0,0,-5), v = (0,0,1) )
            cscatterer.scatter(ev)
            continue
        return
예제 #2
0
    def test3(self):
        '''create pure python representation of a homogeneous scatterer with
        composite kernel. render the c++ computation engine of that kernel.
        '''
        #shape
        from mccomposite.geometry import primitives
        shape = primitives.block((1, 1, 1))

        #kernel
        nprinter = NeutronPrinter()

        #composite kernel
        composite_kernel = hs.compositeKernel()
        composite_kernel.addElement(nprinter)

        #scatterer
        scatterer = hs.homogeneousScatterer(shape, composite_kernel)

        #render the c++ representation
        cscatterer = hs.scattererEngine(scatterer)

        for i in range(10):
            ev = mcni.neutron(r=(0, 0, -5), v=(0, 0, 1))
            cscatterer.scatter(ev)
            continue
        return
예제 #3
0
    def test(self):
        '''create pure python representation of a composite kernel,
        and render the c++ computation engine of that kernel
        '''
        #create pure python representation of kernel composite
        composite_kernel = hs.compositeKernel()
        nprinter = NeutronPrinter()
        composite_kernel.addElement(nprinter)

        #render the c++ representation
        ccomposite_kernel = hs.kernelEngine(composite_kernel)

        ev = mcni.neutron(r=(0, 0, 0), v=(0, 0, 1))
        ccomposite_kernel.scatter(ev)

        return
    def test(self):
        '''create pure python representation of a composite kernel,
        and render the c++ computation engine of that kernel
        '''
        #create pure python representation of kernel composite
        composite_kernel = hs.compositeKernel()
        nprinter = NeutronPrinter( )
        composite_kernel.addElement( nprinter )

        #render the c++ representation
        ccomposite_kernel = hs.kernelEngine(
            composite_kernel )

        ev = mcni.neutron( r = (0,0,0), v = (0,0,1) )
        ccomposite_kernel.scatter(ev)

        return
예제 #5
0
 def elementFactory(self, *args, **kwds):
     from mccomponents.homogeneous_scatterer import compositeKernel
     return compositeKernel( *args, **kwds )
예제 #6
0
 def elementFactory(self, *args, **kwds):
     from mccomponents.homogeneous_scatterer import compositeKernel
     return compositeKernel(*args, **kwds)