Exemplo n.º 1
0
    def __init__(self, src="", id="", loglevel=0, debug=0):

        self.ckin = 0
        self._owner = 0
        self.verbose = 1
        fname = os.path.basename(src)
        ff = os.path.splitext(fname)

        if src:
            root = XML.XML_Node(name="doc", src=src, preprocess=1, debug=debug)

        if id:
            s = root.child(id=id)

        else:
            s = root.child(name="phase")

        self._name = s["id"]

        # initialize the equation of state
        ThermoPhase.__init__(self, xml_phase=s)

        # initialize the kinetics model
        ph = [self]
        Kinetics.__init__(self, xml_phase=s, phases=ph)

        # initialize the transport model
        Transport.__init__(self, xml_phase=s, phase=self, model="", loglevel=loglevel)
Exemplo n.º 2
0
    def __init__(self, src="", id="", loglevel=0, debug=0):

        self.ckin = 0
        self._owner = 0
        self.verbose = 1
        fname = os.path.basename(src)
        ff = os.path.splitext(fname)

        if src:
            root = XML.XML_Node(name='doc', src=src, preprocess=1, debug=debug)

        if id:
            s = root.child(id=id)

        else:
            s = root.child(name="phase")

        self._name = s['id']

        # initialize the equation of state
        ThermoPhase.__init__(self, xml_phase=s)

        # initialize the kinetics model
        ph = [self]
        Kinetics.__init__(self, xml_phase=s, phases=ph)

        # initialize the transport model
        Transport.__init__(self,
                           xml_phase=s,
                           phase=self,
                           model='',
                           loglevel=loglevel)
Exemplo n.º 3
0
    def __init__(self, src="", root=None, surfaces=[]):
        """
        src - CTML or CTI input file name. If more than one phase is
        defined in the file, src should be specified as 'filename\#id'
        If the file is not CTML, it will be run through the CTI -> CTML
        preprocessor first.

        root - If a CTML tree has already been read in that contains
        the definition of this interface, the root of this tree can be
        specified instead of specifying 'src'.

        phases - A list of all objects representing the neighboring
        surface phases which participate in the reaction mechanism.

        """
        self.ckin = 0
        self._owner = 0
        self.verbose = 1

        # src has the form '<filename>#<id>'
        fn = src.split("#")
        id = ""
        if len(fn) > 1:
            id = fn[1]
            fn = fn[0]

        # read in the root element of the tree if not building from
        # an already-built XML tree. Enable preprocessing if the film
        # is a .cti file instead of XML.
        if src and not root:
            root = XML.XML_Node(name="doc", src=fn, preprocess=1)

        # If an 'id' tag was specified, find the node in the tree with
        # that tag
        if id:
            s = root.child(id=id)

        # otherwise, find the first element with tag name 'phase'
        # (1D, 2D and 3D phases use the CTML tag name 'phase'
        else:
            s = root.child(name="phase")

        # build the surface phase
        EdgePhase.__init__(self, xml_phase=s)

        # build the reaction mechanism. This object (representing the
        # surface phase) is added to the end of the list of phases
        Kinetics.__init__(self, xml_phase=s, phases=surfaces + [self])
Exemplo n.º 4
0
    def __init__(self, src="", root=None, surfaces=[]):
        """
        src - CTML or CTI input file name. If more than one phase is
        defined in the file, src should be specified as 'filename\#id'
        If the file is not CTML, it will be run through the CTI -> CTML
        preprocessor first.

        root - If a CTML tree has already been read in that contains
        the definition of this interface, the root of this tree can be
        specified instead of specifying 'src'.

        phases - A list of all objects representing the neighboring
        surface phases which participate in the reaction mechanism.

        """
        self.ckin = 0
        self._owner = 0
        self.verbose = 1

        # src has the form '<filename>#<id>'
        fn = src.split('#')
        id = ""
        if len(fn) > 1:
            id = fn[1]
            fn = fn[0]

        # read in the root element of the tree if not building from
        # an already-built XML tree. Enable preprocessing if the film
        # is a .cti file instead of XML.
        if src and not root:
            root = XML.XML_Node(name='doc', src=fn, preprocess=1)

        # If an 'id' tag was specified, find the node in the tree with
        # that tag
        if id:
            s = root.child(id=id)

        # otherwise, find the first element with tag name 'phase'
        # (1D, 2D and 3D phases use the CTML tag name 'phase'
        else:
            s = root.child(name="phase")

        # build the surface phase
        EdgePhase.__init__(self, xml_phase=s)

        # build the reaction mechanism. This object (representing the
        # surface phase) is added to the end of the list of phases
        Kinetics.__init__(self, xml_phase=s, phases=surfaces + [self])
Exemplo n.º 5
0
    def __init__(self, src="", root=None):
        
        self.ckin = 0
        self._owner = 0
        self.verbose = 1

        # get the 'phase' element
        s = XML.find_XML(src=src, root=root, name="phase")

        # get the equation of state model
        ThermoPhase.__init__(self, xml_phase=s)

        # get the kinetics model
        Kinetics.__init__(self, xml_phase=s, phases=[self])

        SolidTransport.__init__(self, phase=self)
Exemplo n.º 6
0
    def __init__(self, src="", root=None):

        self.ckin = 0
        self._owner = 0
        self.verbose = 1

        # get the 'phase' element
        s = XML.find_XML(src=src, root=root, name="phase")

        # get the equation of state model
        ThermoPhase.__init__(self, xml_phase=s)

        # get the kinetics model
        Kinetics.__init__(self, xml_phase=s, phases=[self])

        SolidTransport.__init__(self, phase=self)
Exemplo n.º 7
0
 def __del__(self):
     Transport.__del__(self)
     Kinetics.__del__(self)
     ThermoPhase.__del__(self)
Exemplo n.º 8
0
 def __del__(self):
     """Delete the Edge instance."""
     Kinetics.__del__(self)
     EdgePhase.__del__(self)
Exemplo n.º 9
0
 def __del__(self):
     """Delete the Edge instance."""
     Kinetics.__del__(self)
     EdgePhase.__del__(self)
Exemplo n.º 10
0
 def __del__(self):
     """Delete the Interface instance."""
     Kinetics.__del__(self)
     SurfacePhase.__del__(self)
Exemplo n.º 11
0
 def __del__(self):
     """Delete the Interface instance."""
     Kinetics.__del__(self)
     SurfacePhase.__del__(self)
Exemplo n.º 12
0
 def __del__(self):
     SolidTransport.__del__(self)
     Kinetics.__del__(self)
     ThermoPhase.__del__(self)
Exemplo n.º 13
0
import sys
sys.path.append(r"D:\Desktop\VASP practical\Pymatgen")
from Kinetics import Kinetics




my_Kinetics = Kinetics(r'D:\Desktop\Date\calculate\AIMDforwaterincalcumsulful\fig1')
my_Kinetics.Firstorderreaction(dirr='D'):
#Standard setup stuff
import ROOT as R
RF = R.RooFit
import sys
import os
sys.path.append(os.environ["NEUTRONS"]+'/RooFit')

from pyUtils import *
outputDir = "../figures/"
#fPDF = pdf(outputDir+"kinetics_wall_electron_neutron_comparison.pdf")

from Kinetics import Kinetics
k = Kinetics("k")
k.SetTitle("Muon Kinetics Signals")
k.frame.GetXaxis().SetTitle("time [ns]")
k.frame.GetYaxis().SetTitle("signal")

can = R.TCanvas("can")
k.DrawComponent(k.electron, [RF.LineColor(R.kBlue), RF.Name("el_d")])
k.DrawComponent(k.capture, [RF.LineColor(R.kRed), RF.Name("neu_d")])
k.L_d = 0.01
k.L_q = 0.01
k.DrawComponent(k.electron, [RF.LineColor(R.kBlue), RF.LineStyle(2), RF.Name("el_w")])
k.DrawComponent(k.capture, [RF.LineColor(R.kRed), RF.LineStyle(2), RF.Name("neu_w")])

can.SetLogy()
k.frame.GetXaxis().SetRangeUser(0,4000)
k.frame.GetYaxis().SetRangeUser(1e-7,1e-2)

leg = R.TLegend(0.5,0.7,0.9,0.9)
leg.AddEntry(k.frame.findObject("el_d"), "Decay Electrons (Deuterium)", "l")