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)
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)
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)
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)
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)
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))
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))
def wlInfNorm(x, h): """ Compute the parallel weighted l_{\infty} norm with weight h """ return flcbdfWrappers.globalMax(numpy.linalg.norm(h * x, numpy.inf))
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)
def wlInfNorm(x,h): """ Compute the parallel weighted l_{\infty} norm with weight h """ return flcbdfWrappers.globalMax(numpy.linalg.norm(h*x,numpy.inf))
def wlInfNorm(x,h): """ Compute the parallel weighted l_{\infty} norm with weight h """ return flcbdfWrappers.globalMax(numpy.max(h*numpy.abs(x)))
def lInfNorm(x): """ Compute the parallel l_{\infty} norm """ return flcbdfWrappers.globalMax(numpy.linalg.norm(x,numpy.inf))