예제 #1
0
파일: Norms.py 프로젝트: arnsong/proteus
def LIerrorSFEMvsAF(analyticalFunction,quadraturePointArray,functionValueArray,T=None):
    error=0.0
    range_nQuadraturePoints_element = range(quadraturePointArray.shape[1])
    for eN in range(quadraturePointArray.shape[0]):
        for k in range_nQuadraturePoints_element:
            AF = analyticalFunction.uOfXT(quadraturePointArray[eN,k],T)
            error = max(error,abs(functionValueArray[eN,k] - AF))
    return globalMax(error)
예제 #2
0
파일: Norms.py 프로젝트: arnsong/proteus
def LIerrorVFEMvsAF(analyticalFunction,quadraturePointArray,quadratureWeightArray,functionValueArray,T=None):
    error=0.0
    range_nQuadraturePoints_element = range(quadraturePointArray.shape[1])
    for eN in range(quadraturePointArray.shape[0]):
        for k in range_nQuadraturePoints_element:
            AF = analyticalFunction.uOfXT(quadraturePointArray[eN,k],T)
            e = numpy.absolute(functionValueArray[eN,k,:] - AF)

            error = max(error,max(e.flat))
    return globalMax(error)
예제 #3
0
파일: Norms.py 프로젝트: nehaljwani/proteus
def LIerrorSFEM(quadratureWeightArray,
                aSolutionValueArray,
                nSolutionValueArray,
                T=None):
    error = 0.0
    range_nQuadraturePoints_element = range(aSolutionValueArray.shape[1])
    error = max(
        numpy.absolute(aSolutionValueArray.flat - nSolutionValueArray.flat))

    return globalMax(error)
예제 #4
0
파일: Norms.py 프로젝트: nehaljwani/proteus
def LIerrorSFEMvsAF(analyticalFunction,
                    quadraturePointArray,
                    functionValueArray,
                    T=None):
    error = 0.0
    range_nQuadraturePoints_element = range(quadraturePointArray.shape[1])
    for eN in range(quadraturePointArray.shape[0]):
        for k in range_nQuadraturePoints_element:
            AF = analyticalFunction.uOfXT(quadraturePointArray[eN, k], T)
            error = max(error, abs(functionValueArray[eN, k] - AF))
    return globalMax(error)
예제 #5
0
파일: Norms.py 프로젝트: nehaljwani/proteus
def LIerrorVFEMvsAF(analyticalFunction,
                    quadraturePointArray,
                    quadratureWeightArray,
                    functionValueArray,
                    T=None):
    error = 0.0
    range_nQuadraturePoints_element = range(quadraturePointArray.shape[1])
    for eN in range(quadraturePointArray.shape[0]):
        for k in range_nQuadraturePoints_element:
            AF = analyticalFunction.uOfXT(quadraturePointArray[eN, k], T)
            e = numpy.absolute(functionValueArray[eN, k, :] - AF)

            error = max(error, max(e.flat))
    return globalMax(error)
예제 #6
0
def lInfNorm(x):
    """
    Compute the parallel :math:`l_{\infty}` norm

    The :math:`l_{\infty}` norm of a vector :math:`\mathbf{x} \in
    \mathbb{R}^n` is

    .. math::

       \|x\|_{\infty} = \max_i |x_i|
       
    This implemtation works for a distributed array with no ghost
    components (each component must be on a single processor).
    
    :param x: numpy array of length n
    :return: float
    """
    return flcbdfWrappers.globalMax(numpy.linalg.norm(x, numpy.inf))
예제 #7
0
def lInfNorm(x):
    """
    Compute the parallel :math:`l_{\infty}` norm

    The :math:`l_{\infty}` norm of a vector :math:`\mathbf{x} \in
    \mathbb{R}^n` is

    .. math::

       \|x\|_{\infty} = \max_i |x_i|
       
    This implemtation works for a distributed array with no ghost
    components (each component must be on a single processor).
    
    :param x: numpy array of length n
    :return: float
    """
    return flcbdfWrappers.globalMax(numpy.linalg.norm(x,numpy.inf))
예제 #8
0
def wlInfNorm(x, h):
    """
    Compute the parallel weighted l_{\infty} norm with weight h
    """
    return flcbdfWrappers.globalMax(numpy.linalg.norm(h * x, numpy.inf))
예제 #9
0
파일: Norms.py 프로젝트: arnsong/proteus
def LIerrorSFEM(quadratureWeightArray,aSolutionValueArray,nSolutionValueArray,T=None):
    error=0.0
    range_nQuadraturePoints_element = range(aSolutionValueArray.shape[1])
    error = max(numpy.absolute(aSolutionValueArray.flat - nSolutionValueArray.flat))

    return globalMax(error)
예제 #10
0
def wlInfNorm(x,h):
    """
    Compute the parallel weighted l_{\infty} norm with weight h
    """
    return flcbdfWrappers.globalMax(numpy.linalg.norm(h*x,numpy.inf))
예제 #11
0
def wlInfNorm(x,h):
    """
    Compute the parallel weighted l_{\infty} norm with weight h
    """
    return flcbdfWrappers.globalMax(numpy.max(h*numpy.abs(x)))
예제 #12
0
def lInfNorm(x):
    """
    Compute the parallel l_{\infty} norm
    """
    return flcbdfWrappers.globalMax(numpy.linalg.norm(x,numpy.inf))