Exemplo n.º 1
0
 def __init__(self, observer, direction, tube_length, name="I_field"):
     LogQuantity.__init__(
         self, name, "A",
         "Integrate current density along %s" % str(list(direction)))
     self.observer = observer
     self.direction = direction
     self.tube_length = tube_length
Exemplo n.º 2
0
 def __init__(self, observer, direction, tube_length, name="I_part"):
     LogQuantity.__init__(
         self, name, "A",
         "Particle Current along %s" % str(list(direction)))
     self.observer = observer
     self.direction = numpy.asarray(direction)
     self.tube_length = tube_length
Exemplo n.º 3
0
    def __init__(self, observer, axis, name=None):
        if name is None:
            name = "r%s_rms" % axis_name(axis)

        LogQuantity.__init__(self, name, "m",
                             "RMS Beam Radius along %s" % axis_name(axis))
        self.observer = observer
        self.axis = axis
Exemplo n.º 4
0
Arquivo: log.py Projeto: gimac/hedge
    def __init__(self, maxwell_op, fields, name="divD"):
        LogQuantity.__init__(self, name, "C", "Integral over div D")

        self.fields = fields

        from hedge.models.nd_calculus import DivergenceOperator

        div_op = DivergenceOperator(maxwell_op.dimensions, maxwell_op.get_eh_subset()[:3])
        self.bound_div_op = div_op.bind(self.fields.discr)
Exemplo n.º 5
0
    def __init__(self, observer, axis, beam_axis, name=None):
        if name is None:
            name = "eps%s_rms" % axis_name(axis)

        LogQuantity.__init__(self, name, "m*rad",
                             "RMS Beam Emittance along %s" % axis_name(axis))
        self.observer = observer
        self.axis = axis
        self.beam_axis = beam_axis
Exemplo n.º 6
0
Arquivo: log.py Projeto: gimac/hedge
    def __init__(self, getter, discr, name=None, unit="1", description=None):
        """Construct the integral logger.

        :param getter: a callable that returns the value of which to
          take the integral.
        :param discr: a :class:`hedge.discretization.Discretization`
            to which the variable belongs.
        :param name: the name reported to the :class:`pytools.log.LogManager`.
        :param unit: the unit of measure for the log quantity.
        :param description: A description fed to the :class:`pytools.log.LogManager`.
        """
        self.getter = getter

        if name is None:
            try:
                name = "int_%s" % self.getter.name()
            except AttributeError:
                raise ValueError("must specify a name")

        LogQuantity.__init__(self, name, unit, description)

        self.discr = discr
Exemplo n.º 7
0
Arquivo: log.py Projeto: felipeh/hedge
    def __init__(self, getter, discr, p=2, name=None,
            unit="1", description=None):
        """Construct the Lp norm logger.

        :param getter: a callable that returns the value of which to
          take the norm.
        :param discr: a L{discretization.Discretization} to which the variable belongs.
        :param p: the power of the norm.
        :param name: the name reported to the :class:`pytools.log.LogManager`.
        :param unit: the unit of measure for the log quantity.
        :param description: A description fed to the :class:`pytools.log.LogManager`.
        """
        self.getter = getter
        self.discr = discr
        self.p = p

        if name is None:
            try:
                name = "l%d_%s" % (int(p), self.getter.name())
            except AttributeError:
                raise ValueError("must specify a name")

        LogQuantity.__init__(self, name, unit, description)
Exemplo n.º 8
0
Arquivo: log.py Projeto: gimac/hedge
 def __init__(self, fields, name="W_mag"):
     LogQuantity.__init__(self, name, "J", "Energy of the magnetic field")
     self.fields = fields
Exemplo n.º 9
0
Arquivo: log.py Projeto: gimac/hedge
 def __init__(self, fields, name="W_el"):
     LogQuantity.__init__(self, name, "J", "Energy of the electric field")
     self.fields = fields
Exemplo n.º 10
0
 def __init__(self, observer, name="n_advec_elements"):
     LogQuantity.__init__(self, name, "1", "#active advective elements")
     self.observer = observer
Exemplo n.º 11
0
 def __init__(self, observer, name="W_part"):
     LogQuantity.__init__(self, name, "J", "Kinetic Energy")
     self.observer = observer
Exemplo n.º 12
0
 def __init__(self, observer, name="Espread"):
     LogQuantity.__init__(self, name, "J", "RMS Beam Energy Spread")
     self.observer = observer
Exemplo n.º 13
0
 def __init__(self, observer, name="Q_rec"):
     LogQuantity.__init__(self, name, "C", "Total Charge")
     self.observer = observer
Exemplo n.º 14
0
 def __init__(self, observer, name="Q_part"):
     LogQuantity.__init__(self, name, "C", "Total particle charge")
     self.observer = observer
Exemplo n.º 15
0
            def __init__(self, name="change"):
                LogQuantity.__init__(self, name, "1", "Change since last time step")

                self.old_fields = 0
Exemplo n.º 16
0
 def __init__(self, observer, name="n_advec_elements"):
     LogQuantity.__init__(self, name, "1", "#active advective elements")
     self.observer = observer
Exemplo n.º 17
0
            def __init__(self, name="change"):
                LogQuantity.__init__(self, name, "1",
                                     "Change since last time step")

                self.old_fields = 0
Exemplo n.º 18
0
 def __init__(self, observer, name="n_part"):
     LogQuantity.__init__(self, name, "1", "Particle Count")
     self.observer = observer