Exemplo n.º 1
0
    def __init__(self, observer, names=None):
        vdim = observer.method.dimensions_velocity
        if names is None:
            names = ["p%s_part" % axis_name(i) for i in range(vdim)]

        MultiLogQuantity.__init__(self,
                                  names,
                                  units=["N*s"] * vdim,
                                  descriptions=["Particle Momentum"] * vdim)

        self.observer = observer
Exemplo n.º 2
0
Arquivo: log.py Projeto: gimac/hedge
    def __init__(self, maxwell_op, fields, names=None):
        self.fields = fields

        from hedge.models.nd_calculus import DivergenceOperator

        self.div_op = DivergenceOperator(maxwell_op.dimensions, maxwell_op.get_eh_subset()[3:]).bind(self.fields.discr)

        if names is None:
            names = ["divB", "err_divB_l1"]

        MultiLogQuantity.__init__(
            self, names=names, units=["T/m", "T/m"], descriptions=["Integral over div B", "Integral over |div B|"]
        )
Exemplo n.º 3
0
    def __init__(self, observer, names=["divD", "err_divD_l1"]):
        MultiLogQuantity.__init__(
            self,
            names,
            units=["C", "C"],
            descriptions=["Central divergence of D", "L1 Divergence Error"])

        self.observer = observer
        self.discr = self.observer.discr
        from hedge.models.nd_calculus import DivergenceOperator
        self.bound_div_op = DivergenceOperator(
            self.discr.dimensions,
            observer.maxwell_op.get_eh_subset()[:3]).bind(self.discr)
Exemplo n.º 4
0
Arquivo: log.py Projeto: gimac/hedge
    def __init__(self, fields, c0, names=None):
        if names is None:
            names = ["p%s_field" % axis_name(i) for i in range(3)]

        vdim = len(names)

        MultiLogQuantity.__init__(self, names, units=["N*s"] * vdim, descriptions=["Field Momentum"] * vdim)

        self.fields = fields
        self.c0 = c0

        e_subset = fields.maxwell_op.get_eh_subset()[0:3]
        h_subset = fields.maxwell_op.get_eh_subset()[3:6]

        from hedge.tools import SubsettableCrossProduct

        self.poynting_cross = SubsettableCrossProduct(op1_subset=e_subset, op2_subset=h_subset)
Exemplo n.º 5
0
    def __init__(self, gatherer, basename, unit, description):
        MultiLogQuantity.__init__(self,
                                  names=[
                                      "%s_mean" % basename,
                                      "%s_stddev" % basename,
                                      "%s_min" % basename,
                                      "%s_max" % basename,
                                  ],
                                  units=4 * [unit],
                                  descriptions=[
                                      "Mean of %s" % description,
                                      "Standard deviation of %s" % description,
                                      "Minimum of %s" % description,
                                      "Maximum of %s" % description,
                                  ])

        self.gatherer = gatherer