Esempio n. 1
0
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)
Esempio n. 2
0
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)
Esempio n. 3
0
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)
Esempio n. 4
0
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)
Esempio n. 5
0
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)
Esempio n. 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))
Esempio n. 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))
Esempio n. 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))
Esempio n. 9
0
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)
Esempio n. 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))
Esempio n. 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)))
Esempio n. 12
0
def lInfNorm(x):
    """
    Compute the parallel l_{\infty} norm
    """
    return flcbdfWrappers.globalMax(numpy.linalg.norm(x,numpy.inf))