Example #1
0
    def __init__(self, domain, z0=None, k0=None, dk=None, beta=None):
        """
        set up mapping

        :param domain: domain of the mapping
        :type domain: ``Domain``
        :param z0: depth weighting offset. If not present no depth scaling is applied.
        :type z0: scalar
        :param k0: reference density, defaults to 0
        :type k0: scalar
        :param dk: susceptibility scale, defaults to 1
        :type dk: scalar
        :param beta: depth weighting exponent, defaults to 2
        :type beta: ``float``
        """
        if k0 is None:
            k0 = 0.0
        if beta is None:
            beta = 2.0
        if dk is None:
            dk = 1.0
        self.domain = domain

        if z0 is not None:
            DIM = self.domain.getDim()
            l_z = boundingBoxEdgeLengths(domain)[DIM - 1]
            a = dk * (clip(z0 - domain.getX()[DIM - 1], minval=0) / l_z) ** (beta / 2)
        else:
            a = dk
        super(SusceptibilityMapping, self).__init__(a=a, p0=k0)
Example #2
0
    def __init__(self, domain, z0=None, k0=None, dk=None, beta=None):
        """
        set up mapping

        :param domain: domain of the mapping
        :type domain: ``Domain``
        :param z0: depth weighting offset. If not present no depth scaling is applied.
        :type z0: scalar
        :param k0: reference density, defaults to 0
        :type k0: scalar
        :param dk: susceptibility scale, defaults to 1
        :type dk: scalar
        :param beta: depth weighting exponent, defaults to 2
        :type beta: ``float``
        """
        if k0 is None: k0 = 0.
        if beta is None: beta = 2.
        if dk is None: dk = 1.
        self.domain = domain

        if z0 is not None:
            DIM = self.domain.getDim()
            l_z = boundingBoxEdgeLengths(domain)[DIM - 1]
            a = dk * (clip(z0 - domain.getX()[DIM - 1], minval=0) /
                      l_z)**(beta / 2)
        else:
            a = dk
        super(SusceptibilityMapping, self).__init__(a=a, p0=k0)
Example #3
0
    def __init__(self, domain, z0=None, rho0=None, drho=None, beta=None):
        """
        initializes the mapping

        :param domain: domain of the mapping
        :type domain: ``Domain``
        :param z0: depth weighting offset. If not present no depth scaling is applied.
        :type z0: scalar
        :param rho0: reference density, defaults to 0
        :type rho0: scalar
        :param drho: density scale. By default density of granite = 2750kg/m**3 is used.
        :type drho: scalar
        :param beta: depth weighting exponent, defaults to 2
        :type beta: ``float``
        """
        if rho0 is None:
            rho0 = 0.0
        if drho is None:
            drho = 2750 * U.kg / U.m ** 3
        if beta is None:
            beta = 2.0

        self.domain = domain
        if z0 is not None:
            DIM = self.domain.getDim()
            l_z = boundingBoxEdgeLengths(domain)[DIM - 1]
            a = drho * (clip(z0 - domain.getX()[DIM - 1], minval=0) / l_z) ** (beta / 2)
        else:
            a = drho
        super(DensityMapping, self).__init__(a=a, p0=rho0)
Example #4
0
    def __init__(self, domain, z0=None, rho0=None, drho=None, beta=None):
        """
        initializes the mapping

        :param domain: domain of the mapping
        :type domain: ``Domain``
        :param z0: depth weighting offset. If not present no depth scaling is applied.
        :type z0: scalar
        :param rho0: reference density, defaults to 0
        :type rho0: scalar
        :param drho: density scale. By default density of granite = 2750kg/m**3 is used.
        :type drho: scalar
        :param beta: depth weighting exponent, defaults to 2
        :type beta: ``float``
        """
        if rho0 is None: rho0 = 0.
        if drho is None: drho = 2750 * U.kg / U.m**3
        if beta is None: beta = 2.

        self.domain = domain
        if z0 is not None:
            DIM = self.domain.getDim()
            l_z = boundingBoxEdgeLengths(domain)[DIM - 1]
            a = drho * (clip(z0 - domain.getX()[DIM - 1], minval=0) /
                        l_z)**(beta / 2)
        else:
            a = drho
        super(DensityMapping, self).__init__(a=a, p0=rho0)