Package esys :: Package escript :: Module util
[hide private]
[frames] | no frames]

Module util


Author: Lutz Gross, l.gross@uq.edu.au

Copyright: Copyright (c) 2003-2009 by University of Queensland Earth Systems Science Computational Center (ESSCC) http://www.uq.edu.au/esscc Primary Business: Queensland, Australia

License: Licensed under the Open Software License version 3.0 http://www.opensource.org/licenses/osl-3.0.php

Classes [hide private]
  Abs_Symbol
Symbol representing the result of the absolute value function.
  Acos_Symbol
Symbol representing the result of the inverse cosine function.
  Acosh_Symbol
Symbol representing the result of the inverse hyperbolic cosine function.
  Add_Symbol
Symbol representing the sum of two arguments.
  Asin_Symbol
Symbol representing the result of the inverse sine function.
  Asinh_Symbol
Symbol representing the result of the inverse hyperbolic sine function.
  Atan_Symbol
Symbol representing the result of the inverse tangent function.
  Atanh_Symbol
Symbol representing the result of the inverse hyperbolic tangent function.
  Cos_Symbol
Symbol representing the result of the cosine function.
  Cosh_Symbol
Symbol representing the result of the hyperbolic cosine function.
  DependendSymbol
DependendSymbol extents Symbol by modifying the == operator to allow two instances to be equal.
  Exp_Symbol
Symbol representing the result of the exponential function.
  FileWriter
Interface to write data to a file.
  GeneralTensorProduct_Symbol
Symbol representing the general tensor product of two arguments.
  GeneralTensorTransposedProduct_Symbol
Symbol representing the general tensor product of arg0 and the transpose of arg1.
  GeneralTransposedTensorProduct_Symbol
Symbol representing the general tensor product of the transpose of arg0 and arg1
  GetSlice_Symbol
Symbol representing getting a slice for a Symbol.
  Grad_Symbol
Symbol representing the result of the gradient operator.
  Integrate_Symbol
Symbol representing the result of the spatial integration operator.
  Interpolate_Symbol
Symbol representing the result of the interpolation operator.
  Inverse_Symbol
Symbol representing the result of the inverse function.
  Log_Symbol
Symbol representing the result of the natural logarithm function.
  Maxval_Symbol
Symbol representing the result of the maximum value function.
  Minval_Symbol
Symbol representing the result of the minimum value function.
  Mult_Symbol
Symbol representing the product of two arguments.
  Power_Symbol
Symbol representing the first argument to the power of the second argument.
  Quotient_Symbol
Symbol representing the quotient of two arguments.
  Sin_Symbol
Symbol representing the result of the sine function.
  Sinh_Symbol
Symbol representing the result of the hyperbolic sine function.
  Sqrt_Symbol
Symbol representing the result of the square root function.
  SwapAxes_Symbol
Symbol representing the result of the swap function.
  Symbol
Symbol class objects provide the same functionality as numpy.ndarray and escript.Data objects but they do not have a value and therefore cannot be plotted or visualized.
  Tan_Symbol
Symbol representing the result of the tangent function.
  Tanh_Symbol
Symbol representing the result of the hyperbolic tangent function.
  Trace_Symbol
Symbol representing the result of the trace function.
  Transpose_Symbol
Symbol representing the result of the transpose function.
  WhereNegative_Symbol
Symbol representing the result of the mask of negative values function.
  WherePositive_Symbol
Symbol representing the result of the mask of positive values function.
  WhereZero_Symbol
Symbol representing the result of the mask of zero entries function.
Functions [hide private]
 
C_GeneralTensorProduct(...)
C_GeneralTensorProduct([ (Data)arg0=<esys.escript.escriptcpp.Data object at 0x98632ec> [, (Data)arg1=<esys.escript.escriptcpp.Data object at 0x98631ac> [, (int)axis_offset=0 [, (int)transpose=0]]]]) -> Data
float or Symbol
L2(arg)
Returns the L2 norm of arg at where.
float
Lsup(arg)
Returns the Lsup-norm of argument arg.
float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
acos(arg)
Returns the inverse cosine of argument arg.
float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
acosh(arg)
Returns the inverse hyperbolic cosine of argument arg.
escript.Symbol, float, int, escript.Data, numpy.ndarray
add(arg0, arg1)
Adds arg0 and arg1 together.
float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
asin(arg)
Returns the inverse sine of argument arg.
float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
asinh(arg)
Returns the inverse hyperbolic sine of argument arg.
float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
atan(arg)
Returns inverse tangent of argument arg.
float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
atanh(arg)
Returns the inverse hyperbolic tangent of argument arg.
list of pairs of float
boundingBox(domain)
Returns the bounding box of a domain
numpy.ndarray, escript.Data, Symbol, int or float depending on the input
clip(arg, minval=None, maxval=None)
Cuts the values of arg between minval and maxval.
int or None
commonDim(*args)
Identifies, if possible, the spatial dimension across a set of objects which may or may not have a spatial dimension.
tuple of int
commonShape(arg0, arg1)
Returns a shape to which arg0 can be extended from the right and arg1 can be extended from the left.
float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
cos(arg)
Returns cosine of argument arg.
float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
cosh(arg)
Returns the hyperbolic cosine of argument arg.
 
deviatoric(arg)
Returns the deviatoric version of arg.
float
diameter(domain)
Returns the diameter of a domain.
escript.Data or Symbol
div(arg, where=None)
Returns the divergence of arg at where.
numpy.ndarray,escript.Data, Symbol depending on the input
eigenvalues(arg)
Returns the eigenvalues of the square matrix arg.
tuple of escript.Data
eigenvalues_and_eigenvectors(arg)
Returns the eigenvalues and eigenvectors of the square matrix arg.
float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
erf(arg)
Returns the error function erf of argument arg.
 
escript_generalTensorProduct(arg0, arg1, axis_offset, transpose=0)
arg0 and arg1 are both Data objects but not necessarily on the same function space.
 
escript_generalTensorTransposedProduct(arg0, arg1, axis_offset)
arg0 and arg1 are both Data objects but not necessarily on the same function space.
 
escript_generalTransposedTensorProduct(arg0, arg1, axis_offset)
arg0 and arg1 are both Data objects but not necessarily on the same function space.
 
escript_inverse(arg)
arg is a Data object!!!
float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
exp(arg)
Returns e to the power of argument arg.
numpy.ndarray, escript.Data, Symbol depending on the input
generalTensorProduct(arg0, arg1, axis_offset=0)
Generalized tensor product.
numpy.ndarray, escript.Data, Symbol depending on the input
generalTensorTransposedProduct(arg0, arg1, axis_offset=0)
Generalized tensor product of arg0 and transpose of arg1.
numpy.ndarray, escript.Data, Symbol depending on the input
generalTransposedTensorProduct(arg0, arg1, axis_offset=0)
Generalized tensor product of transposed of arg0 and arg1.
numpy.ndarray or Symbol
getClosestValue(arg, origin=0)
Returns the value in arg which is closest to origin.
 
getEpsilon()
int
getMPIRankWorld()
 
getMPIWorldMax(...)
getMPIWorldMax( (int)arg1) -> int
 
getMaxFloat()
int
getRank(arg)
Identifies the rank of the argument.
tuple of int
getShape(arg)
Identifies the shape of the argument.
list of str
getTagNames(domain)
Returns a list of tag names used by the domain.
int
getVersion()
escript.Data or Symbol
grad(arg, where=None)
Returns the spatial gradient of arg at where.
numpy.ndarray of rank 1, rank 2 or rank 4
identity(shape=())
Returns the shape x shape identity tensor.
numpy.ndarray or escript.Data of rank 2
identityTensor(d=3)
Returns the d x d identity matrix.
numpy.ndarray or escript.Data of rank 4
identityTensor4(d=3)
Returns the d x d x d x d identity tensor.
float
inf(arg)
Returns the minimum value over all data points.
numpy.ndarray, escript.Data, Symbol, float depending on the input
inner(arg0, arg1)
Inner product of the two arguments.
 
insertTagNames(domain, **kwargs)
Inserts tag names into the domain.
escript.Data
insertTaggedValues(target, **kwargs)
Inserts tagged values into the target using tag names.
float, numpy.ndarray or Symbol
integrate(arg, where=None)
Returns the integral of the function arg over its domain.
escript.Data or Symbol
interpolate(arg, where)
Interpolates the function into the FunctionSpace where.
numpy.ndarray, escript.Data, Symbol depending on the input
inverse(arg)
Returns the inverse of the square matrix arg.
escript.Data or Symbol
jump(arg, domain=None)
Returns the jump of arg across the continuity of the domain.
numpy.ndarray or escript.Data of rank 2
kronecker(d=3)
Returns the kronecker δ-symbol.
float, escript.Data, Symbol depending on the type of arg
length(arg)
Returns the length (Euclidean norm) of argument arg at each data point.
list
listEscriptParams()
float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
log(arg)
Returns the natural logarithm of argument arg.
float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
log10(arg)
Returns base-10 logarithm of argument arg.
float
longestEdge(domain)
Returns the length of the longest edge of the domain
tuple
matchShape(arg0, arg1)
Returns a representation of arg0 and arg1 which have the same shape.
tuple of two numpy.ndarray, two escript.Data, a Symbol and one of the types numpy.ndarray or escript.Data
matchType(arg0=0.0, arg1=0.0)
Converts arg0 and arg1 both to the same type numpy.ndarray or escript.Data or, if one of arg0 or arg1 is of type Symbol, the other one to be of type numpy.ndarray or escript.Data.
numpy.ndarray, escript.Data, Symbol depending on the input
matrix_mult(arg0, arg1)
matrix-matrix or matrix-vector product of the two arguments.
numpy.ndarray, escript.Data, Symbol depending on the input
matrix_transposed_mult(arg0, arg1)
matrix-transposed(matrix) product of the two arguments.
 
matrixmult(arg0, arg1)
See matrix_mult.
numpy.ndarray, escript.Data, Symbol, int or float depending on the input
maximum(*args)
The maximum over arguments args.
float, escript.Data, Symbol depending on the type of arg
maxval(arg)
Returns the maximum value over all components of arg at each data point.
float or {numpy.ndarray}
meanValue(arg)
return the mean value of the argument over its domain
numpy.ndarray, escript.Data, Symbol, int or float depending on the input
minimum(*args)
The minimum over arguments args.
float, escript.Data, Symbol depending on the type of arg
minval(arg)
Returns the minimum value over all components of arg at each data point.
 
mkDir(pathname)
creates a directory of name pathname if the directory does not exist.
escript.Symbol, float, int, escript.Data, numpy.ndarray
mult(arg0, arg1)
Product of arg0 and arg1.
numpy.ndarray, escript.Data, Symbol depending on the input
nonsymmetric(arg)
Returns the non-symmetric part of the square matrix arg.
escript.Data or Symbol
normalize(arg, zerolength=0)
Returns the normalized version of arg (=arg/length(arg)).
numpy.ndarray, escript.Data, Symbol depending on the input
outer(arg0, arg1)
The outer product of the two arguments.
int or None
pokeDim(arg)
Identifies the spatial dimension of the argument.
escript.Symbol, float, int, escript.Data, numpy.ndarray
power(arg0, arg1)
Raises arg0 to the power of arg1.
None
printParallelThreadCounts()
escript.Symbol, float, int, escript.Data, numpy.ndarray
quotient(arg0, arg1)
Quotient of arg0 and arg1.
 
reorderComponents(arg, index)
Resorts the components of arg according to index.
 
saveDX(filename, domain=None, **data)
Writes Data objects into a file using the OpenDX file format.
 
saveESD(datasetName, dataDir='.', domain=None, timeStep=0, deltaT=1, dynamicMesh=0, **data)
Saves Data objects to files and creates an escript dataset (ESD) file for convenient processing/visualisation.
 
saveVTK(filename, domain=None, metadata=None, metadata_schema=None, **data)
Writes Data objects and their mesh into a file using the VTK XML file format.
 
showEscriptParams()
Displays the parameters escript recognises with an explanation.
float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
sign(arg)
Returns the sign of argument arg.
float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
sin(arg)
Returns sine of argument arg.
float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
sinh(arg)
Returns the hyperbolic sine of argument arg.
float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
sqrt(arg)
Returns the square root of argument arg.
float
sup(arg)
Returns the maximum value over all data points.
escript.Data, Symbol, numpy.ndarray depending on the type of arg
swap_axes(arg, axis0=0, axis1=1)
Returns the swap of arg by swapping the components axis0 and axis1.
numpy.ndarray, escript.Data, Symbol depending on the input
symmetric(arg)
Returns the symmetric part of the square matrix arg.
float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
tan(arg)
Returns tangent of argument arg.
float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
tanh(arg)
Returns the hyperbolic tangent of argument arg.
numpy.ndarray, escript.Data, Symbol depending on the input
tensor_mult(arg0, arg1)
The tensor product of the two arguments.
numpy.ndarray, escript.Data, Symbol depending on the input
tensor_transposed_mult(arg0, arg1)
The tensor product of the first and the transpose of the second argument.
 
tensormult(arg0, arg1)
See tensor_mult.
bool
testForZero(arg)
Tests if the argument is identical to zero.
escript.Data, Symbol, numpy.ndarray depending on the type of arg
trace(arg, axis_offset=0)
Returns the trace of arg which is the sum of arg[k,k] over k.
escript.Data, Symbol, numpy.ndarray, float, int depending on the type of arg
transpose(arg, axis_offset=None)
Returns the transpose of arg by swapping the first axis_offset and the last rank-axis_offset components.
numpy.ndarray, escript.Data, Symbol depending on the input
transposed_matrix_mult(arg0, arg1)
transposed(matrix)-matrix or transposed(matrix)-vector product of the two arguments.
numpy.ndarray, escript.Data, Symbol depending on the input
transposed_tensor_mult(arg0, arg1)
The tensor product of the transpose of the first and the second argument.
numpy.ndarray or escript.Data of rank 1
unitVector(i=0, d=3)
Returns a unit vector u of dimension d whose non-zero element is at index i.
float
vol(arg)
Returns the volume or area of the oject arg
float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
whereNegative(arg)
Returns mask of negative values of argument arg.
float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
whereNonNegative(arg)
Returns mask of non-negative values of argument arg.
float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
whereNonPositive(arg)
Returns mask of non-positive values of argument arg.
float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
whereNonZero(arg, tol=0.0)
Returns mask of values different from zero of argument arg.
float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
wherePositive(arg)
Returns mask of positive values of argument arg.
float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
whereZero(arg, tol=None, adaptTol=True, rtol=1.49011611938e-08)
Returns mask of zero entries of argument arg.
Variables [hide private]
  DBLE_MAX = 1.79769313486e+308
  EPSILON = 2.22044604925e-16
  __url__ = 'https://launchpad.net/escript-finley'
Function Details [hide private]

L2(arg)

 

Returns the L2 norm of arg at where.

Parameters:
Returns: float or Symbol
L2 norm of arg

Note: L2(arg) is equivalent to sqrt(integrate(inner(arg,arg)))

Lsup(arg)

 

Returns the Lsup-norm of argument arg. This is the maximum absolute value over all data points. This function is equivalent to sup(abs(arg)).

Parameters:
Returns: float
maximum value of the absolute value of argover all components and all data points
Raises:
  • TypeError - if type of argcannot be processed

acos(arg)

 

Returns the inverse cosine of argument arg.

Parameters:
Returns: float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
Raises:
  • TypeError - if the type of the argument is not expected

acosh(arg)

 

Returns the inverse hyperbolic cosine of argument arg.

Parameters:
Returns: float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
Raises:
  • TypeError - if the type of the argument is not expected

add(arg0, arg1)

 

Adds arg0 and arg1 together.

Parameters:
Returns: escript.Symbol, float, int, escript.Data, numpy.ndarray
the sum of arg0 and arg1

Note: The shape of both arguments is matched according to the rules used in matchShape.

asin(arg)

 

Returns the inverse sine of argument arg.

Parameters:
Returns: float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
Raises:
  • TypeError - if the type of the argument is not expected

asinh(arg)

 

Returns the inverse hyperbolic sine of argument arg.

Parameters:
Returns: float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
Raises:
  • TypeError - if the type of the argument is not expected

atan(arg)

 

Returns inverse tangent of argument arg.

Parameters:
Returns: float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
Raises:
  • TypeError - if the type of the argument is not expected

atanh(arg)

 

Returns the inverse hyperbolic tangent of argument arg.

Parameters:
Returns: float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
Raises:
  • TypeError - if the type of the argument is not expected

boundingBox(domain)

 

Returns the bounding box of a domain

Parameters:
Returns: list of pairs of float
bounding box of the domain

clip(arg, minval=None, maxval=None)

 

Cuts the values of arg between minval and maxval.

Parameters:
  • arg (numpy.ndarray, escript.Data, Symbol, int or float) - argument
  • minval (float or None) - lower range. If None no lower range is applied
  • maxval (float or None) - upper range. If None no upper range is applied
Returns: numpy.ndarray, escript.Data, Symbol, int or float depending on the input
an object that contains all values from arg between minval and maxval
Raises:
  • ValueError - if minval>maxval

commonDim(*args)

 

Identifies, if possible, the spatial dimension across a set of objects which may or may not have a spatial dimension.

Parameters:
  • args - given objects
Returns: int or None
the spatial dimension of the objects with identifiable dimension (see pokeDim). If none of the objects has a spatial dimension None is returned.
Raises:
  • ValueError - if the objects with identifiable dimension don't have the same spatial dimension.

commonShape(arg0, arg1)

 

Returns a shape to which arg0 can be extended from the right and arg1 can be extended from the left.

Parameters:
  • arg0 - an object with a shape (see getShape)
  • arg1 - an object with a shape (see getShape)
Returns: tuple of int
the shape of arg0 or arg1 such that the left part equals the shape of arg0 and the right end equals the shape of arg1
Raises:
  • ValueError - if no shape can be found

cos(arg)

 

Returns cosine of argument arg.

Parameters:
Returns: float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
Raises:
  • TypeError - if the type of the argument is not expected

cosh(arg)

 

Returns the hyperbolic cosine of argument arg.

Parameters:
Returns: float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
Raises:
  • TypeError - if the type of the argument is not expected

diameter(domain)

 

Returns the diameter of a domain.

Parameters:
Returns: float

div(arg, where=None)

 

Returns the divergence of arg at where.

Parameters:
  • arg (escript.Data or Symbol) - function of which the divergence is to be calculated. Its shape has to be (d,) where d is the spatial dimension.
  • where (None or escript.FunctionSpace) - FunctionSpace in which the divergence will be calculated. If not present or None an appropriate default is used.
Returns: escript.Data or Symbol
divergence of arg

eigenvalues(arg)

 

Returns the eigenvalues of the square matrix arg.

Parameters:
  • arg (numpy.ndarray, escript.Data, Symbol) - square matrix. Must have rank 2 and the first and second dimension must be equal. It must also be symmetric, ie. transpose(arg)==arg (this is not checked).
Returns: numpy.ndarray,escript.Data, Symbol depending on the input
the eigenvalues in increasing order

Note: for escript.Data and Symbol objects the dimension is restricted to 3.

eigenvalues_and_eigenvectors(arg)

 

Returns the eigenvalues and eigenvectors of the square matrix arg.

Parameters:
  • arg (escript.Data) - square matrix. Must have rank 2 and the first and second dimension must be equal. It must also be symmetric, ie. transpose(arg)==arg (this is not checked).
Returns: tuple of escript.Data
the eigenvalues and eigenvectors. The eigenvalues are ordered by increasing value. The eigenvectors are orthogonal and normalized. If V are the eigenvectors then V[:,i] is the eigenvector corresponding to the i-th eigenvalue.

Note: The dimension is restricted to 3.

erf(arg)

 

Returns the error function erf of argument arg.

Parameters:
Returns: float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
Raises:
  • TypeError - if the type of the argument is not expected

escript_generalTensorProduct(arg0, arg1, axis_offset, transpose=0)

 

arg0 and arg1 are both Data objects but not necessarily on the same function space. They could be identical!!!

escript_generalTensorTransposedProduct(arg0, arg1, axis_offset)

 

arg0 and arg1 are both Data objects but not necessarily on the same function space. They could be identical!!!

escript_generalTransposedTensorProduct(arg0, arg1, axis_offset)

 

arg0 and arg1 are both Data objects but not necessarily on the same function space. They could be identical!!!

exp(arg)

 

Returns e to the power of argument arg.

Parameters:
Returns: float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
Raises:
  • TypeError - if the type of the argument is not expected

generalTensorProduct(arg0, arg1, axis_offset=0)

 

Generalized tensor product.

out[s,t]=Σ_r arg0[s,r]*arg1[r,t]

where

  • s runs through arg0.Shape[:arg0.ndim-axis_offset]
  • r runs through arg0.Shape[:axis_offset]
  • t runs through arg1.Shape[axis_offset:]
Parameters:
Returns: numpy.ndarray, escript.Data, Symbol depending on the input
the general tensor product of arg0 and arg1 at each data point

generalTensorTransposedProduct(arg0, arg1, axis_offset=0)

 

Generalized tensor product of arg0 and transpose of arg1.

out[s,t]=Σ_r arg0[s,r]*arg1[t,r]

where

  • s runs through arg0.Shape[:arg0.ndim-axis_offset]
  • r runs through arg0.Shape[arg1.ndim-axis_offset:]
  • t runs through arg1.Shape[arg1.ndim-axis_offset:]

The function call generalTensorTransposedProduct(arg0,arg1,axis_offset) is equivalent to generalTensorProduct(arg0,transpose(arg1,arg1.ndim-axis_offset),axis_offset).

Parameters:
Returns: numpy.ndarray, escript.Data, Symbol depending on the input
the general tensor product of arg0 and transpose(arg1) at each data point

generalTransposedTensorProduct(arg0, arg1, axis_offset=0)

 

Generalized tensor product of transposed of arg0 and arg1.

out[s,t]=Σ_r arg0[r,s]*arg1[r,t]

where

  • s runs through arg0.Shape[axis_offset:]
  • r runs through arg0.Shape[:axis_offset]
  • t runs through arg1.Shape[axis_offset:]

The function call generalTransposedTensorProduct(arg0,arg1,axis_offset) is equivalent to generalTensorProduct(transpose(arg0,arg0.ndim-axis_offset),arg1,axis_offset).

Parameters:
Returns: numpy.ndarray, escript.Data, Symbol depending on the input
the general tensor product of transpose(arg0) and arg1 at each data point

getClosestValue(arg, origin=0)

 

Returns the value in arg which is closest to origin.

Parameters:
Returns: numpy.ndarray or Symbol
value in arg closest to origin

getRank(arg)

 

Identifies the rank of the argument.

Parameters:
  • arg (numpy.ndarray, escript.Data, float, int, Symbol) - an object whose rank is to be returned
Returns: int
the rank of the argument
Raises:
  • TypeError - if type of argcannot be processed

getShape(arg)

 

Identifies the shape of the argument.

Parameters:
  • arg (numpy.ndarray, escript.Data, float, int, Symbol) - an object whose shape is to be returned
Returns: tuple of int
the shape of the argument
Raises:
  • TypeError - if type of argcannot be processed

getTagNames(domain)

 

Returns a list of tag names used by the domain.

Parameters:
Returns: list of str
a list of tag names used by the domain

grad(arg, where=None)

 

Returns the spatial gradient of arg at where.

If g is the returned object, then

  • if arg is rank 0 g[s] is the derivative of arg with respect to the s-th spatial dimension
  • if arg is rank 1 g[i,s] is the derivative of arg[i] with respect to the s-th spatial dimension
  • if arg is rank 2 g[i,j,s] is the derivative of arg[i,j] with respect to the s-th spatial dimension
  • if arg is rank 3 g[i,j,k,s] is the derivative of arg[i,j,k] with respect to the s-th spatial dimension.
Parameters:
  • arg (escript.Data or Symbol) - function of which the gradient is to be calculated. Its rank has to be less than 3.
  • where (None or escript.FunctionSpace) - FunctionSpace in which the gradient is calculated. If not present or None an appropriate default is used.
Returns: escript.Data or Symbol
gradient of arg

identity(shape=())

 

Returns the shape x shape identity tensor.

Parameters:
  • shape (tuple of int) - input shape for the identity tensor
Returns: numpy.ndarray of rank 1, rank 2 or rank 4
array whose shape is shape x shape where u[i,k]=1 for i=k and u[i,k]=0 otherwise for len(shape)=1. If len(shape)=2: u[i,j,k,l]=1 for i=k and j=l and u[i,j,k,l]=0 otherwise.
Raises:
  • ValueError - if len(shape)>2

identityTensor(d=3)

 

Returns the d x d identity matrix.

Parameters:
Returns: numpy.ndarray or escript.Data of rank 2
the object u of rank 2 with u[i,j]=1 for i=j and u[i,j]=0 otherwise

identityTensor4(d=3)

 

Returns the d x d x d x d identity tensor.

Parameters:
  • d (int or any object with a getDim method) - dimension or an object that has the getDim method defining the dimension
Returns: numpy.ndarray or escript.Data of rank 4
the object u of rank 4 with u[i,j,k,l]=1 for i=k and j=l and u[i,j,k,l]=0 otherwise

inf(arg)

 

Returns the minimum value over all data points.

Parameters:
Returns: float
minimum value of argover all components and all data points
Raises:
  • TypeError - if type of argcannot be processed

inner(arg0, arg1)

 

Inner product of the two arguments. The inner product is defined as:

out=Σ_s arg0[s]*arg1[s]

where s runs through arg0.Shape.

arg0 and arg1 must have the same shape.

Parameters:
Returns: numpy.ndarray, escript.Data, Symbol, float depending on the input
the inner product of arg0 and arg1 at each data point
Raises:
  • ValueError - if the shapes of the arguments are not identical

insertTagNames(domain, **kwargs)

 

Inserts tag names into the domain.

Parameters:
  • domain (escript.Domain) - a domain object
  • (int) - tag key assigned to <tag_name>

insertTaggedValues(target, **kwargs)

 

Inserts tagged values into the target using tag names.

Parameters:
  • target (escript.Data) - data to be filled by tagged values
  • (float or numpy.ndarray) - value to be used for <tag_name>
Returns: escript.Data
target

integrate(arg, where=None)

 

Returns the integral of the function arg over its domain. If where is present arg is interpolated to where before integration.

Parameters:
  • arg (escript.Data or Symbol) - the function which is integrated
  • where (None or escript.FunctionSpace) - FunctionSpace in which the integral is calculated. If not present or None an appropriate default is used.
Returns: float, numpy.ndarray or Symbol
integral of arg

interpolate(arg, where)

 

Interpolates the function into the FunctionSpace where. If the argument arg has the requested function space where no interpolation is performed and arg is returned.

Parameters:
Returns: escript.Data or Symbol
interpolated argument

inverse(arg)

 

Returns the inverse of the square matrix arg.

Parameters:
  • arg (numpy.ndarray, escript.Data, Symbol) - square matrix. Must have rank 2 and the first and second dimension must be equal.
Returns: numpy.ndarray, escript.Data, Symbol depending on the input
inverse of the argument. matrix_mult(inverse(arg),arg) will be almost equal to kronecker(arg.getShape()[0])

Note: for escript.Data objects the dimension is restricted to 3.

jump(arg, domain=None)

 

Returns the jump of arg across the continuity of the domain.

Parameters:
  • arg (escript.Data or Symbol) - argument
  • domain (None or escript.Domain) - the domain where the discontinuity is located. If domain is not present or equal to None the domain of arg is used. If arg is a Symbol the domain must be present.
Returns: escript.Data or Symbol
jump of arg

kronecker(d=3)

 

Returns the kronecker δ-symbol.

Parameters:
Returns: numpy.ndarray or escript.Data of rank 2
the object u of rank 2 with u[i,j]=1 for i=j and u[i,j]=0 otherwise

length(arg)

 

Returns the length (Euclidean norm) of argument arg at each data point.

Parameters:
Returns: float, escript.Data, Symbol depending on the type of arg

log(arg)

 

Returns the natural logarithm of argument arg.

Parameters:
Returns: float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
Raises:
  • TypeError - if the type of the argument is not expected

log10(arg)

 

Returns base-10 logarithm of argument arg.

Parameters:
Returns: float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
Raises:
  • TypeError - if the type of the argument is not expected

longestEdge(domain)

 

Returns the length of the longest edge of the domain

Parameters:
Returns: float
longest edge of the domain parallel to the Cartisean axis

matchShape(arg0, arg1)

 

Returns a representation of arg0 and arg1 which have the same shape.

Parameters:
Returns: tuple
arg0 and arg1 where copies are returned when the shape has to be changed

matchType(arg0=0.0, arg1=0.0)

 

Converts arg0 and arg1 both to the same type numpy.ndarray or escript.Data or, if one of arg0 or arg1 is of type Symbol, the other one to be of type numpy.ndarray or escript.Data.

Parameters:
  • arg0 (numpy.ndarray,escript.Data,float, int, Symbol) - first argument
  • arg1 (numpy.ndarray,escript.Data,float, int, Symbol) - second argument
Returns: tuple of two numpy.ndarray, two escript.Data, a Symbol and one of the types numpy.ndarray or escript.Data
a tuple representing arg0 and arg1 with the same type or with one of them being a Symbol
Raises:
  • TypeError - if type of arg0 or arg1 cannot be processed

matrix_mult(arg0, arg1)

 

matrix-matrix or matrix-vector product of the two arguments.

out[s0]=Σ_{r0} arg0[s0,r0]*arg1[r0]

or

out[s0,s1]=Σ_{r0} arg0[s0,r0]*arg1[r0,s1]

The second dimension of arg0 and the first dimension of arg1 must match.

Parameters:
Returns: numpy.ndarray, escript.Data, Symbol depending on the input
the matrix-matrix or matrix-vector product of arg0 and arg1 at each data point
Raises:
  • ValueError - if the shapes of the arguments are not appropriate

matrix_transposed_mult(arg0, arg1)

 

matrix-transposed(matrix) product of the two arguments.

out[s0,s1]=Σ_{r0} arg0[s0,r0]*arg1[s1,r0]

The function call matrix_transposed_mult(arg0,arg1) is equivalent to matrix_mult(arg0,transpose(arg1)).

The last dimensions of arg0 and arg1 must match.

Parameters:
Returns: numpy.ndarray, escript.Data, Symbol depending on the input
the product of arg0 and the transposed of arg1 at each data point
Raises:
  • ValueError - if the shapes of the arguments are not appropriate

maximum(*args)

 

The maximum over arguments args.

Parameters:
Returns: numpy.ndarray, escript.Data, Symbol, int or float depending on the input
an object which in each entry gives the maximum of the corresponding values in args

maxval(arg)

 

Returns the maximum value over all components of arg at each data point.

Parameters:
Returns: float, escript.Data, Symbol depending on the type of arg
Raises:
  • TypeError - if the type of the argument is not expected

meanValue(arg)

 

return the mean value of the argument over its domain

Parameters:
Returns: float or {numpy.ndarray}
mean value

minimum(*args)

 

The minimum over arguments args.

Parameters:
Returns: numpy.ndarray, escript.Data, Symbol, int or float depending on the input
an object which gives in each entry the minimum of the corresponding values in args

minval(arg)

 

Returns the minimum value over all components of arg at each data point.

Parameters:
Returns: float, escript.Data, Symbol depending on the type of arg
Raises:
  • TypeError - if the type of the argument is not expected

mkDir(pathname)

 

creates a directory of name pathname if the directory does not exist.

Parameters:
  • pathname (str) - valid path name

Note: The method is MPI save.

mult(arg0, arg1)

 

Product of arg0 and arg1.

Parameters:
Returns: escript.Symbol, float, int, escript.Data, numpy.ndarray
the product of arg0 and arg1

Note: The shape of both arguments is matched according to the rules used in matchShape.

nonsymmetric(arg)

 

Returns the non-symmetric part of the square matrix arg. That is, (arg-transpose(arg))/2.

Parameters:
  • arg (numpy.ndarray, escript.Data, Symbol) - input matrix. Must have rank 2 or 4 and be square.
Returns: numpy.ndarray, escript.Data, Symbol depending on the input
non-symmetric part of arg

normalize(arg, zerolength=0)

 

Returns the normalized version of arg (=arg/length(arg)).

Parameters:
  • arg (escript.Data or Symbol) - function
  • zerolength (float) - relative tolerance for arg == 0
Returns: escript.Data or Symbol
normalized arg where arg is non-zero, and zero elsewhere

outer(arg0, arg1)

 

The outer product of the two arguments. The outer product is defined as:

out[t,s]=arg0[t]*arg1[s]

where

  • s runs through arg0.Shape
  • t runs through arg1.Shape
Parameters:
Returns: numpy.ndarray, escript.Data, Symbol depending on the input
the outer product of arg0 and arg1 at each data point

pokeDim(arg)

 

Identifies the spatial dimension of the argument.

Parameters:
  • arg (any) - an object whose spatial dimension is to be returned
Returns: int or None
the spatial dimension of the argument, if available, or None

power(arg0, arg1)

 

Raises arg0 to the power of arg1.

Parameters:
Returns: escript.Symbol, float, int, escript.Data, numpy.ndarray
arg0 to the power of arg1

Note: The shape of both arguments is matched according to the rules used in matchShape

quotient(arg0, arg1)

 

Quotient of arg0 and arg1.

Parameters:
Returns: escript.Symbol, float, int, escript.Data, numpy.ndarray
the quotient of arg0 and arg1

Note: The shape of both arguments is matched according to the rules used in matchShape.

saveDX(filename, domain=None, **data)

 

Writes Data objects into a file using the OpenDX file format.

Example:

   tmp=Scalar(..)
   v=Vector(..)
   saveDX("solution.dx", temperature=tmp, velocity=v)

tmp and v are written into "solution.dx" where tmp is named "temperature" and v is named "velocity".

Parameters:
  • filename (str) - file name of the output file
  • domain (escript.Domain) - domain of the Data objects. If not specified, the domain of the given Data objects is used.
  • (Data object) - writes the assigned value to the DX file using <name> as identifier. The identifier can be used to select the data set when data are imported into DX.

Note: The data objects have to be defined on the same domain. They may not be in the same FunctionSpace but one cannot expect that all FunctionSpaces can be mixed. Typically, data on the boundary and data on the interior cannot be mixed.

saveESD(datasetName, dataDir='.', domain=None, timeStep=0, deltaT=1, dynamicMesh=0, **data)

 

Saves Data objects to files and creates an escript dataset (ESD) file for convenient processing/visualisation.

Single timestep example:

   tmp = Scalar(..)
   v = Vector(..)
   saveESD("solution", "data", temperature=tmp, velocity=v)

Time series example:

   while t < t_end:
       tmp = Scalar(..)
       v = Vector(..)
       # save every 10 timesteps
       if t % 10 == 0:
           saveESD("solution", "data", timeStep=t, deltaT=10, temperature=tmp, velocity=v)
       t = t + 1

tmp, v and the domain are saved in native format in the "data" directory and the file "solution.esd" is created that refers to tmp by the name "temperature" and to v by the name "velocity".

Parameters:
  • datasetName (str) - name of the dataset, used to name the ESD file
  • dataDir (str) - optional directory where the data files should be saved
  • domain (escript.Domain) - domain of the Data object(s). If not specified, the domain of the given Data objects is used.
  • timeStep (int) - current timestep or sequence number - first one must be 0
  • deltaT (int) - timestep or sequence increment, see example above
  • dynamicMesh (int) - by default the mesh is assumed to be static and thus only saved once at timestep 0 to save disk space. Setting this to 1 changes the behaviour and the mesh is saved at each timestep.
  • (Data object) - writes the assigned value to the file using <name> as identifier
Notes:
  • The data objects have to be defined on the same domain. They may not be in the same FunctionSpace but one cannot expect that all FunctionSpaces can be mixed. Typically, data on the boundary and data on the interior cannot be mixed.
  • When saving a time series the first timestep must be 0 and it is assumed that data from all timesteps share the domain. The dataset file is updated in each iteration.

saveVTK(filename, domain=None, metadata=None, metadata_schema=None, **data)

 

Writes Data objects and their mesh into a file using the VTK XML file format.

Example:

   tmp=Scalar(..)
   v=Vector(..)
   saveVTK("solution.vtu", temperature=tmp, velocity=v)

tmp and v are written into "solution.vtu" where tmp is named "temperature" and v is named "velocity".

Meta tags, e.g. a timeStamp, can be added to the file, for instance:

   tmp=Scalar(..)
   v=Vector(..)
   saveVTK("solution.vtu", temperature=tmp, velocity=v,
           metadata="<timeStamp>1.234</timeStamp>",
           metadata_schema={ "gml" : "http://www.opengis.net/gml"})

The argument metadata_schema allows the definition of name spaces with a schema used in the definition of meta tags.

Parameters:
  • filename (str) - file name of the output file
  • domain (escript.Domain) - domain of the Data objects. If not specified, the domain of the given Data objects is used.
  • - writes the assigned value to the VTK file using <name> as identifier
  • metadata (str) - additional XML meta data which are inserted into the VTK file. The meta data are marked by the tag <MetaData>.
  • metadata_schema (dict with metadata_schema[<namespace>]=<URI> to assign the scheme <URI> to the name space <namespace>.) - assignes schema to namespaces which have been used to define meta data.

Note: The data objects have to be defined on the same domain. They may not be in the same FunctionSpace but one cannot expect that all FunctionSpaces can be mixed. Typically, data on the boundary and data on the interior cannot be mixed.

sign(arg)

 

Returns the sign of argument arg.

Parameters:
Returns: float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
Raises:
  • TypeError - if the type of the argument is not expected

sin(arg)

 

Returns sine of argument arg.

Parameters:
Returns: float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
Raises:
  • TypeError - if the type of the argument is not expected

sinh(arg)

 

Returns the hyperbolic sine of argument arg.

Parameters:
Returns: float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
Raises:
  • TypeError - if the type of the argument is not expected

sqrt(arg)

 

Returns the square root of argument arg.

Parameters:
Returns: float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
Raises:
  • TypeError - if the type of the argument is not expected

sup(arg)

 

Returns the maximum value over all data points.

Parameters:
Returns: float
maximum value of argover all components and all data points
Raises:
  • TypeError - if type of argcannot be processed

swap_axes(arg, axis0=0, axis1=1)

 

Returns the swap of arg by swapping the components axis0 and axis1.

Parameters:
  • arg (escript.Data, Symbol, numpy.ndarray) - argument
  • axis0 (int) - first axis. axis0 must be non-negative and less than the rank of arg.
  • axis1 (int) - second axis. axis1 must be non-negative and less than the rank of arg.
Returns: escript.Data, Symbol, numpy.ndarray depending on the type of arg
arg with swapped components

symmetric(arg)

 

Returns the symmetric part of the square matrix arg. That is, (arg+transpose(arg))/2.

Parameters:
  • arg (numpy.ndarray, escript.Data, Symbol) - input matrix. Must have rank 2 or 4 and be square.
Returns: numpy.ndarray, escript.Data, Symbol depending on the input
symmetric part of arg

tan(arg)

 

Returns tangent of argument arg.

Parameters:
Returns: float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
Raises:
  • TypeError - if the type of the argument is not expected

tanh(arg)

 

Returns the hyperbolic tangent of argument arg.

Parameters:
Returns: float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
Raises:
  • TypeError - if the type of the argument is not expected

tensor_mult(arg0, arg1)

 

The tensor product of the two arguments.

For arg0 of rank 2 this is

out[s0]=Σ_{r0} arg0[s0,r0]*arg1[r0]

or

out[s0,s1]=Σ_{r0} arg0[s0,r0]*arg1[r0,s1]

and for arg0 of rank 4 this is

out[s0,s1,s2,s3]=Σ_{r0,r1} arg0[s0,s1,r0,r1]*arg1[r0,r1,s2,s3]

or

out[s0,s1,s2]=Σ_{r0,r1} arg0[s0,s1,r0,r1]*arg1[r0,r1,s2]

or

out[s0,s1]=Σ_{r0,r1} arg0[s0,s1,r0,r1]*arg1[r0,r1]

In the first case the second dimension of arg0 and the last dimension of arg1 must match and in the second case the two last dimensions of arg0 must match the two first dimensions of arg1.

Parameters:
  • arg0 (numpy.ndarray, escript.Data, Symbol) - first argument of rank 2 or 4
  • arg1 (numpy.ndarray, escript.Data, Symbol) - second argument of shape greater than 1 or 2 depending on the rank of arg0
Returns: numpy.ndarray, escript.Data, Symbol depending on the input
the tensor product of arg0 and arg1 at each data point

tensor_transposed_mult(arg0, arg1)

 

The tensor product of the first and the transpose of the second argument.

For arg0 of rank 2 this is

out[s0,s1]=Σ_{r0} arg0[s0,r0]*arg1[s1,r0]

and for arg0 of rank 4 this is

out[s0,s1,s2,s3]=Σ_{r0,r1} arg0[s0,s1,r0,r1]*arg1[s2,s3,r0,r1]

or

out[s0,s1,s2]=Σ_{r0,r1} arg0[s0,s1,r0,r1]*arg1[s2,r0,r1]

In the first case the the second dimension of arg0 and arg1 must match and in the second case the two last dimensions of arg0 must match the two last dimensions of arg1.

The function call tensor_transpose_mult(arg0,arg1) is equivalent to tensor_mult(arg0,transpose(arg1)).

Parameters:
  • arg0 (numpy.ndarray, escript.Data, Symbol) - first argument of rank 2 or 4
  • arg1 (numpy.ndarray, escript.Data, Symbol) - second argument of shape greater of 1 or 2 depending on rank of arg0
Returns: numpy.ndarray, escript.Data, Symbol depending on the input
the tensor product of the transposed of arg0 and arg1 at each data point

testForZero(arg)

 

Tests if the argument is identical to zero.

Parameters:
  • arg (typically numpy.ndarray, escript.Data, float, int) - the object to test for zero
Returns: bool
True if the argument is identical to zero, False otherwise

trace(arg, axis_offset=0)

 

Returns the trace of arg which is the sum of arg[k,k] over k.

Parameters:
  • arg (escript.Data, Symbol, numpy.ndarray) - argument
  • axis_offset (int) - axis_offset to components to sum over. axis_offset must be non-negative and less than the rank of arg +1. The dimensions of component axis_offset and axis_offset+1 must be equal.
Returns: escript.Data, Symbol, numpy.ndarray depending on the type of arg
trace of arg. The rank of the returned object is rank of arg minus 2.

transpose(arg, axis_offset=None)

 

Returns the transpose of arg by swapping the first axis_offset and the last rank-axis_offset components.

Parameters:
  • arg (escript.Data, Symbol, numpy.ndarray, float, int) - argument
  • axis_offset (int) - the first axis_offset components are swapped with the rest. axis_offset must be non-negative and less or equal to the rank of arg. If axis_offset is not present int(r/2) where r is the rank of arg is used.
Returns: escript.Data, Symbol, numpy.ndarray, float, int depending on the type of arg
transpose of arg

transposed_matrix_mult(arg0, arg1)

 

transposed(matrix)-matrix or transposed(matrix)-vector product of the two arguments.

out[s0]=Σ_{r0} arg0[r0,s0]*arg1[r0]

or

out[s0,s1]=Σ_{r0} arg0[r0,s0]*arg1[r0,s1]

The function call transposed_matrix_mult(arg0,arg1) is equivalent to matrix_mult(transpose(arg0),arg1).

The first dimension of arg0 and arg1 must match.

Parameters:
Returns: numpy.ndarray, escript.Data, Symbol depending on the input
the product of the transpose of arg0 and arg1 at each data point
Raises:
  • ValueError - if the shapes of the arguments are not appropriate

transposed_tensor_mult(arg0, arg1)

 

The tensor product of the transpose of the first and the second argument.

For arg0 of rank 2 this is

out[s0]=Σ_{r0} arg0[r0,s0]*arg1[r0]

or

out[s0,s1]=Σ_{r0} arg0[r0,s0]*arg1[r0,s1]

and for arg0 of rank 4 this is

out[s0,s1,s2,s3]=Σ_{r0,r1} arg0[r0,r1,s0,s1]*arg1[r0,r1,s2,s3]

or

out[s0,s1,s2]=Σ_{r0,r1} arg0[r0,r1,s0,s1]*arg1[r0,r1,s2]

or

out[s0,s1]=Σ_{r0,r1} arg0[r0,r1,s0,s1]*arg1[r0,r1]

In the first case the first dimension of arg0 and the first dimension of arg1 must match and in the second case the two first dimensions of arg0 must match the two first dimensions of arg1.

The function call transposed_tensor_mult(arg0,arg1) is equivalent to tensor_mult(transpose(arg0),arg1).

Parameters:
  • arg0 (numpy.ndarray, escript.Data, Symbol) - first argument of rank 2 or 4
  • arg1 (numpy.ndarray, escript.Data, Symbol) - second argument of shape greater of 1 or 2 depending on the rank of arg0
Returns: numpy.ndarray, escript.Data, Symbol depending on the input
the tensor product of transpose of arg0 and arg1 at each data point

unitVector(i=0, d=3)

 

Returns a unit vector u of dimension d whose non-zero element is at index i.

Parameters:
Returns: numpy.ndarray or escript.Data of rank 1
the object u of rank 1 with u[j]=1 for j=index and u[j]=0 otherwise

vol(arg)

 

Returns the volume or area of the oject arg

Parameters:
Returns: float

whereNegative(arg)

 

Returns mask of negative values of argument arg.

Parameters:
Returns: float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
Raises:
  • TypeError - if the type of the argument is not expected

whereNonNegative(arg)

 

Returns mask of non-negative values of argument arg.

Parameters:
Returns: float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
Raises:
  • TypeError - if the type of the argument is not expected

whereNonPositive(arg)

 

Returns mask of non-positive values of argument arg.

Parameters:
Returns: float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
Raises:
  • TypeError - if the type of the argument is not expected

whereNonZero(arg, tol=0.0)

 

Returns mask of values different from zero of argument arg.

Parameters:
  • arg (float, escript.Data, Symbol, numpy.ndarray) - argument
  • tol (float) - absolute tolerance. Values with absolute value less than tol are accepted as zero. If tol is not present rtol*Lsup(arg) is used.
  • rtol (non-negative float) - relative tolerance used to define the absolute tolerance if tol is not present.
Returns: float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
Raises:
  • ValueError - if rtol is non-negative.
  • TypeError - if the type of the argument is not expected

wherePositive(arg)

 

Returns mask of positive values of argument arg.

Parameters:
Returns: float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
Raises:
  • TypeError - if the type of the argument is not expected

whereZero(arg, tol=None, adaptTol=True, rtol=1.49011611938e-08)

 

Returns mask of zero entries of argument arg.

Parameters:
  • arg (float, escript.Data, Symbol, numpy.ndarray) - argument
  • tol (float) - absolute tolerance. Values with absolute value less than tol are accepted as zero. If tol is not present rtol*Lsup(arg) is used.
  • rtol (non-negative float) - relative tolerance used to define the absolute tolerance if tol is not present.
Returns: float, escript.Data, Symbol, numpy.ndarray depending on the type of arg
Raises:
  • ValueError - if rtol is non-negative.
  • TypeError - if the type of the argument is not expected