Ejemplo n.º 1
0
 def __init__(self, h5obj, pfixed, length, temperature, pressure):
     """
 """
     # hdf5 file object
     self.h5obj = h5obj
     # hdf5 path
     self.h5path = self.h5obj.create_group("Parameters")
     #
     # Fixed plasma check
     self.pfixed = mh5u.Attrib("pfixed", int(pfixed))
     #
     # Electrode gap in meters
     self.length = mh5u.Attrib("length", length)
     #
     # Temperature in Kelvin
     self.temperature = mh5u.Attrib("temperature", temperature)
     #
     # Pressure Pascal
     self.pressure = mh5u.Attrib("pressure", pressure)
     #
     ng = (self.pressure() / (constants.Boltzmann * self.temperature()))
     self.neutral_density = mh5u.Attrib("neutral_density", ng)
     #
     self.writable_list = [
         self.pfixed, self.length, self.temperature, self.pressure,
         self.neutral_density
     ]
Ejemplo n.º 2
0
    def __init__(self, h5obj, nsections, maxpositive, maxnegative, grid_type):
        """ Initial values
    """
        self.h5obj = h5obj
        # Create group
        self.h5path = self.h5obj.create_group("Charge_sections")
        #
        self.nsections = mh5u.Attrib("NSections", nsections)
        #
        self.maxpositive = mh5u.Attrib("Max_positive", maxpositive)
        #
        self.maxnegative = mh5u.Attrib("Max_negative", maxnegative)
        if not grid_type['special']:
            # charges
            charges = np.arange(-maxnegative, maxpositive + 1)
        else:
            # charges
            #charges = np.concatenate((np.arange(-maxnegative, -maxnegative+30),
            #np.arange(-14, 6)))

            charges = np.concatenate(
                (np.arange(-maxnegative, -maxnegative + 30),
                 np.arange(-maxnegative + 32, -14, 5), np.arange(-14, 6)))

        if grid_type['small']:
            charges = np.concatenate(
                (np.array([-235, -225,
                           -215]), np.array([-130, -119,
                                             -107]), np.arange(-20, 6)))
            #self.maxpositive = 5
            #self.maxnegative = -235
            print('len charges', len(charges))
            #nsecs = len(charges)
            #self.nsections = mh5u.Attrib("NSections", nsecs)

        if grid_type['medium']:
            charges = np.concatenate((np.array([-235, -225,
                                                -215]), np.arange(-130, -106),
                                      np.array([-20, -10, -2, -1, 0, 1])))
            #self.maxpositive = 1
            #self.maxnegative = -235
            #nsecs = len(charges)
            #self.nsections = mh5u.Attrib("NSections", nsecs)
            print('len charges', len(charges))

        if grid_type['big']:
            charges = np.concatenate(
                (np.arange(-235, -214), np.array([-130, -119, -107]),
                 np.array([-20, -10, -2, -1, 0, 1])))
            #self.maxpositive = 1
            #self.maxnegative = -235
            #nsecs = len(charges)
            #self.nsections = mh5u.Attrib("NSections", nsecs)
            print('len charges', len(charges))

        self.charges = mh5u.DataSet("Charges", (nsections, ), "f", charges)
        #
        self.writable_list = [
            self.nsections, self.maxpositive, self.maxnegative, self.charges
        ]
Ejemplo n.º 3
0
    def __init__(self, h5obj, description_text=""):
        """ Initial values
    """
        self.h5obj = h5obj
        # root path
        self.h5path = h5obj
        # date and time
        datetime = str(dt.datetime.now())
        #
        self.description = mh5u.Attrib("Description", description_text)
        #
        self.timestamp = mh5u.Attrib("Timestamp", datetime)
        #
        self.timestamp = mh5u.Attrib("Timestamp", datetime)
        #
        sysinfo = os.uname()
        sysinfostr = ["Sysname", "Nodename", "Release", "Version", "Machine"]
        self.sysinfo = [None] * 5
        for i, si in enumerate(sysinfostr):
            self.sysinfo[i] = mh5u.Attrib(si, str(os.uname()[i]))

        # list of lists
        writlist = [[self.description, self.timestamp], self.sysinfo]
        # flatten list
        self.writable_list = [y for x in writlist for y in x]
Ejemplo n.º 4
0
    def __init__(self, h5obj, nsections, rmin, base, power, grid_type):
        """ Initial values
    """
        self.h5obj = h5obj
        #
        self.nsections = mh5u.Attrib("NSections", nsections)
        #
        minvoliface, self.ifaces, self.vols, self.rads, self.diams = compute_sections(
            nsections, rmin, base, power, grid_type)

        self.miniface = mh5u.Attrib("Min_interface", minvoliface)
        #
        self.base = mh5u.Attrib("Base", base)
        #
        self.power = mh5u.Attrib("Power", power)
        #
        # Create sections
        self.interfaces = mh5u.DataSet("Interfaces", (nsections + 1, ), "f",
                                       self.ifaces)
        #
        self.volumes = mh5u.DataSet("Volumes", (nsections, ), "f", self.vols)
        #
        self.radii = mh5u.DataSet("Radii", (nsections, ), "f", self.rads)
        #
        self.diameters = mh5u.DataSet("Diameters", (nsections, ), "f",
                                      self.diams)
        # WARNING FIXME horrible hack

        self.h5path = self.h5obj.create_group("Volume_sections")

        self.writable_list = [
            self.nsections, self.miniface, self.base, self.power,
            self.interfaces, self.volumes, self.radii, self.diameters
        ]
Ejemplo n.º 5
0
 def __init__(self, h5obj, emean, ne):
     """ Initial values
 """
     # hdf5 file object
     self.h5obj = h5obj
     # hdf5 path
     self.h5path = self.h5obj.create_group("Electrons")
     # Set emean electronic mean energy in eV
     self.emean = mh5u.Attrib("emean", emean)
     #
     # Set electronic density 1/m3
     self.ne = mh5u.Attrib("ne", ne)
     #
     self.writable_list = [self.emean, self.ne]
Ejemplo n.º 6
0
 def __init__(self, h5obj, vdw=0, cutoff=0.0, bf=0):
     """ Initial values
 """
     self.h5obj = h5obj
     # Create group
     self.h5path = self.h5obj.create_group("vanderWaals_interaction")
     #
     self.vdw = mh5u.Attrib("On", vdw)
     #
     self.cutoff = mh5u.Attrib("Cutoff", cutoff)
     #
     self.bf = mh5u.Attrib("Brute_force", bf)
     #
     self.writable_list = [self.vdw, self.cutoff, self.bf]
Ejemplo n.º 7
0
 def __init__(self, h5obj, wnu, nucleation_rate, wsg, sgrowth_rate, wco, wch, wsih4, sih4ratio, sih4nmol):
   """ Initial values
   """
   # hdf5 file object
   self.h5obj = h5obj
   #
   # hdf5 path
   self.h5path = self.h5obj.create_group("Rates")
   #
   # With nucleation
   self.wnu = mh5u.Attrib("wnu", int(wnu))
   #if not wnu:
     #nucleation_rate = 0.0
   #
   # Nucleation rate
   self.nucleation_rate = mh5u.Attrib("nucleation_rate", nucleation_rate)
   #
   # With surface growth
   self.wsg = mh5u.Attrib("wsg", int(wsg))
   #if not wsg:
     #sgrowth_rate = 0.0
   #
   # Surface growth rate
   self.sgrowth_rate = mh5u.Attrib("sgrowth_rate", sgrowth_rate)
   #
   # With coagulation
   self.wco = mh5u.Attrib("wco", int(wco))
   #
   # With charging
   self.wch = mh5u.Attrib("wch", int(wch))
   # With SiH4
   self.wsih4 = mh5u.Attrib("wsih4", int(wsih4))
   # SiH4 : gas ratio
   self.sih4ratio = mh5u.Attrib("sih4ratio", sih4ratio)
   # Number of SiH4 per nucleated particle
   self.sih4nmol = mh5u.Attrib("sih4nmol", sih4nmol)
   # mass of SiH4
   sih4mass = 1.67e-27*(28.+4.)
   self.sih4mass = mh5u.Attrib("sih4mass", sih4mass)
   #
   self.writable_list = [self.wnu,
                         self.nucleation_rate,
                         self.wsg,
                         self.sgrowth_rate,
                         self.wco,
                         self.wch,
                         self.wsih4,
                         self.sih4ratio,
                         self.sih4nmol,
                         self.sih4mass]
Ejemplo n.º 8
0
 def __init__(self, h5obj, itemp, ni, imass):
     """ Initial values
 """
     # hdf5 file object
     self.h5obj = h5obj
     # hdf5 path
     self.h5path = self.h5obj.create_group("Ions")
     # Set ion temperature in Kelvin
     self.itemp = mh5u.Attrib("itemp", itemp)
     # Set ion density 1/m3s
     self.ni = mh5u.Attrib("ni", ni)
     # Set ion mass in Kg
     self.imass = mh5u.Attrib("imass", imass)
     #
     self.writable_list = [self.itemp, self.ni, self.imass]
Ejemplo n.º 9
0
 def __init__(self, h5obj, qpivot, temperature, nmdensity):
     """
 """
     # WARNING FIXME TODO input validation
     # hdf5 file object
     self.h5obj = h5obj
     # hdf5 path
     self.h5path = self.h5obj.create_group("Grid_system")
     # pivot in charges
     self.qpivot = mh5u.Attrib("Charge_pivot", int(qpivot))
     # nanoparticle temperature
     self.temperature = mh5u.Attrib("Temperature", temperature)
     # nanoparticle mass density
     self.nmdensity = mh5u.Attrib("Mass_density", nmdensity)
     #
     self.writable_list = [self.qpivot, self.temperature, self.nmdensity]
Ejemplo n.º 10
0
 def __init__(self, h5obj, ndeltat, qdeltat, tstop):
   """ Initial values
   """
   # hdf5 file object
   self.h5obj = h5obj
   # hdf5 path
   self.h5path = self.h5obj.create_group("Time")
   # Set nanoparticle delta t
   self.ndeltat = mh5u.Attrib("ndeltat", ndeltat)
   #
   # Set charging delta t
   self.qdeltat = mh5u.Attrib("qdeltat", qdeltat)
   #
   # Set time stop
   self.tstop = mh5u.Attrib("tstop", tstop)
   #
   self.writable_list = [self.ndeltat,
                         self.qdeltat,
                         self.tstop]
Ejemplo n.º 11
0
 def __init__(self, h5obj, nm):
     """ Initial values
 """
     # hdf5 file object
     self.h5obj = h5obj
     # hdf5 path
     self.h5path = self.h5obj.create_group("Metastables")
     # Set metastable density 1/m3s
     self.nm = mh5u.Attrib("nm", nm)
     #
     self.writable_list = [self.nm]
Ejemplo n.º 12
0
 def __init__(self, h5obj, multiplier, dconstant, method, terms=25):
     """ Initial values
 """
     self.h5obj = h5obj
     # Create group
     self.h5path = self.h5obj.create_group("Electrostatic_interaction")
     #
     self.multiplier = mh5u.Attrib("Multiplier", multiplier)
     #
     self.dconstant = mh5u.Attrib("Dielectric_constant", dconstant)
     #
     self.method = mh5u.Attrib("Method", method)
     #
     if method == 2:  # method == 2 is Coulomb
         terms = 0
     self.terms = mh5u.Attrib("Terms", terms)
     #
     self.writable_list = [
         self.multiplier, self.dconstant, self.method, self.terms
     ]
Ejemplo n.º 13
0
 def __init__(self, h5obj, tunnel, eaffinity, accfactor):
   """
   """
   # hdf5 file object
   self.h5obj = h5obj
   # hdf5 path
   self.h5path = self.h5obj.create_group("Nanoparticles")
   #
   # Fixed tunnel current check
   self.tunnel = mh5u.Attrib("tunnel", int(tunnel))
   #
   # Electron affinity
   self.eaffinity = mh5u.Attrib("eaffinity", eaffinity)
   #
   # Accomodation factor
   self.accfactor = mh5u.Attrib("accfactor", accfactor)
   #
   self.writable_list = [self.tunnel,
                         self.eaffinity,
                         self.accfactor]
Ejemplo n.º 14
0
  def __init__(self, h5obj, indens, qtol, distribution, peakpos, width,
               withchargewidth, chargewidth):
    """ Initial values
    """
    # hdf5 file object
    self.h5obj = h5obj
    # hdf5 path
    self.h5path = self.h5obj.create_group("Density")
    # Set nanoparticle initial density
    self.indens = mh5u.Attrib("indens", indens)
    #
    # Set qtol
    self.qtol = mh5u.Attrib("qtol", qtol)
    #
    # Set distribution
    self.distribution = mh5u.Attrib("distribution", distribution)
    #
    # Set peakpos
    self.peakpos = mh5u.Attrib("peakpos", peakpos)
    #
    # Set width (in terms of section number)
    self.width = mh5u.Attrib("width", width)
    #
    # Set chargewidth
    self.chargewidth = mh5u.Attrib("chargewidth", int(withchargewidth))
    self.chargenegwidth = mh5u.Attrib("chargenegwidth", chargewidth["negative"])
    self.chargeposwidth = mh5u.Attrib("chargeposwidth", chargewidth["positive"])

    self.writable_list = [self.indens,
                          self.qtol,
                          self.distribution,
                          self.peakpos,
                          self.width,
                          self.chargewidth,
                          self.chargenegwidth,
                          self.chargeposwidth]