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
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
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
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)
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
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
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)
def __init__(self, fields, name="W_mag"): LogQuantity.__init__(self, name, "J", "Energy of the magnetic field") self.fields = fields
def __init__(self, fields, name="W_el"): LogQuantity.__init__(self, name, "J", "Energy of the electric field") self.fields = fields
def __init__(self, observer, name="n_advec_elements"): LogQuantity.__init__(self, name, "1", "#active advective elements") self.observer = observer
def __init__(self, observer, name="W_part"): LogQuantity.__init__(self, name, "J", "Kinetic Energy") self.observer = observer
def __init__(self, observer, name="Espread"): LogQuantity.__init__(self, name, "J", "RMS Beam Energy Spread") self.observer = observer
def __init__(self, observer, name="Q_rec"): LogQuantity.__init__(self, name, "C", "Total Charge") self.observer = observer
def __init__(self, observer, name="Q_part"): LogQuantity.__init__(self, name, "C", "Total particle charge") self.observer = observer
def __init__(self, name="change"): LogQuantity.__init__(self, name, "1", "Change since last time step") self.old_fields = 0
def __init__(self, observer, name="n_part"): LogQuantity.__init__(self, name, "1", "Particle Count") self.observer = observer