# esys.downunder.domainbuilder Package

Domain construction from survey data for inversions

class `esys.downunder.domainbuilder.``DomainBuilder`(dim=3, reference_system=None)

  Bases: `object`

  This class is responsible for constructing an escript Domain object with suitable extents and resolution for survey data (`DataSource` objects) that are added to it.

  The domain covers a region above and below the Earth surface. The East-West direction is used as the x- or longitudinal or x[0] direction, the North-South direction is used as the y- or latitudinal or x[1] direction, the vertical direction is denoted by z or radial or x[2] direction. The corresponding terms are used synonymously.

  `addSource`(source)

    Adds a survey data provider to the domain builder. An exception is raised if the domain has already been built. An exception is also reported if the reference system used is cartesian and the UTM zone of `source` does not match the UTM zone of sources already added to the domain builder (see Inversion Cookbook for more information). The dimensionality of the data source must be compatible with this domain builder. That is, the dimensionality of the data must be one less than the dimensionality of the domain (specified in the constructor).

    Parameters: | source (`DataSource`) – The data source to be added. Its reference system needs to match the reference system of the DomainBuilder.

  `fixDensityBelow`(depth=None)

    Defines the depth below which the density anomaly is set to a given value. If no value is given zero is assumed.

    Parameters: | depth (`float`) – depth below which the density is fixed. If not set, no constraint at depth is applied.

  `fixSusceptibilityBelow`(depth=None)

    Defines the depth below which the susceptibility anomaly is set to a given value. If no value is given zero is assumed.

    Parameters: | depth (`float`) – depth below which the susceptibility is fixed. If not set, no constraint at depth is applied.

  `fixVelocityBelow`(depth=None)

    Defines the depth below which the velocity and Q index is set to a given value. If no value is given zero is assumed.

    Parameters: | depth (`float`) – depth below which the velocity is fixed. If not set, no constraint at depth is applied.

  `getBackgroundMagneticFluxDensity`()

    Returns the background magnetic flux density.

  `getDomain`()

    Returns a domain that spans the data area plus padding.

    The domain is created the first time this method is called, subsequent calls return the same domain so anything that affects the domain (such as padding) needs to be set beforehand.

    Returns: | The escript domain for this data source
    Return type: | `esys.escript.Domain`

  `getGravitySurveys`()

    Returns a list of gravity surveys, see `getSurveys` for details.

  `getMagneticSurveys`()

    Returns a list of magnetic surveys, see `getSurveys` for details.

  `getReferenceSystem`()

    returns the reference coordinate system

    Return type: | `ReferenceSystem`

  `getSetDensityMask`()

    Returns the density mask data object which is non-zero for cells whose density value is fixed, zero otherwise.

  `getSetSusceptibilityMask`()

    Returns the susceptibility mask data object which is non-zero for cells whose susceptibility value is fixed, zero otherwise.

  `getSurveys`(datatype, tags=None)

    Returns a list of `Data` objects for all surveys of type `datatype` available to this domain builder. If a list of `tags` is given only data sources whose tag matches the tag list are returned.

    Returns: | List of surveys which are tuples (anomaly,error).
    Return type: | `list`

  `getTags`()

    returns a list of all tags in use by the attached data sources. The list may be empty.

  `setBackgroundMagneticFluxDensity`(B)

    Sets the background magnetic flux density B=(B_East, B_North, B_Vertical)

  `setElementPadding`(pad_x=None, pad_y=None, pad_lat=None, pad_lon=None)

    Sets the amount of padding around the dataset in number of elements (cells).

    When the domain is constructed `pad_x` (`pad_y`) elements are added on each side of the x- (y-) dimension. The arguments must be non-negative.

    Parameters:

    - pad_x (`int`) – Padding per side in x direction (default: no padding)
    - pad_y (`int`) – Padding per side in y direction (default: no padding)

    Note: | `pad_y` is ignored for 2-dimensional datasets.

  `setFractionalPadding`(pad_x=None, pad_y=None, pad_lat=None, pad_lon=None)

    Sets the amount of padding around the dataset as a fraction of the dataset side lengths.

    For example, calling `setFractionalPadding(0.2, 0.1)` with a data source of size 10x20 will result in the padded data set size 14x24 (10*(1+2*0.2), 20*(1+2*0.1))

    Parameters:

    - pad_x (`float`) – Padding per side in x direction (default: no padding)
    - pad_y (`float`) – Padding per side in y direction (default: no padding)
    - pad_lat (`float`) – Padding per side in latitudinal direction (default: no padding)
    - pad_lon (`float`) – Padding per side in longitudinal direction (default: no padding)

    Note: | `pad_y` is ignored for 2-dimensional domains.

  `setGeoPadding`(pad_lat=None, pad_lon=None)

    Sets the amount of padding around the dataset in longitude and latitude.

    The final domain size will be the extent in the latitudinal (in longitudinal) direction of the dataset plus twice the value of `pad_lat` (`pad_lon`). The arguments must be non-negative.

    Parameters:

    - pad_lat (`float` in units of degree) – Padding per side in latitudinal direction (default: 0)
    - pad_lon (`float` in units of degree) – Padding per side in longitudinal direction (default: 0)

    Note: | `pad_lon` is ignored for 2-dimensional domains.
    Note: | this function can only be used if the reference system is not Cartesian

  `setPadding`(pad_x=None, pad_y=None, pad_lat=None, pad_lon=None)

    Sets the amount of padding around the dataset in absolute length units.

    The final domain size will be the length in x (in y) of the dataset plus twice the value of `pad_x` (`pad_y`). The arguments must be non-negative.

    Parameters:

    - pad_x (`float` in units of length (meter)) – Padding per side in x direction (default: no padding)
    - pad_y (`float` in units of length (meter)) – Padding per side in y direction (default: no padding)

    Note: | `pad_y` is ignored for 2-dimensional domains.
    Note: | this function can only be used if the reference system is Cartesian

  `setVerticalExtents`(depth=40000.0, air_layer=10000.0, num_cells=25)

    This method sets the target domain parameters for the vertical dimension.

    Parameters:

    - depth (`float`) – Depth of the domain (in meters)
    - air_layer (`float`) – Depth of the layer above sea level (in meters)
    - num_cells (`int`) – Number of domain elements for the entire vertical dimension

## Classes

- `CartesianReferenceSystem`
- `Data`
- `DataSource`
- `DomainBuilder`
- `FileWriter`
- `ReferenceSystem`

class `esys.downunder.domainbuilder.``CartesianReferenceSystem`(name='CARTESIAN')

  Bases: `esys.downunder.coordinates.ReferenceSystem`

  Identifies the Cartesian coordinate system

  `__init__`(name='CARTESIAN')

    set up Cartesian coordinate system

  `createTransformation`(domain)

    creates an appropriate coordinate transformation on a given domain

    Parameters: | domain (`esys.escript.AbstractDomain`) – domain of transformation
    Return type: | `SpatialCoordinateTransformation`

  `getName`()

    returns the name of the reference system

  `isCartesian`()

    returns if the reference system is Cartesian

    Return type: | `bool`

  `isTheSame`(other)

    test if argument `other` defines the same reference system

    Parameters: | other (`ReferenceSystem`) – a second reference system
    Returns: | `True` if `other` is a `CartesianReferenceSystem` instance.
    Return type: | `bool`
    Note: | every two `CartesianReferenceSystem` instances are considered as being the same.

class `esys.downunder.domainbuilder.``Data`

  Bases: `Boost.Python.instance`

  Represents a collection of datapoints. It is used to store the values of a function. For more details please consult the c++ class documentation.

  `__init__`((object)arg1) → None

    __init__( (object)arg1, (object)value [, (object)p2 [, (object)p3 [, (object)p4]]]) -> None

  `conjugate`((Data)arg1) → Data
  `copy`((Data)arg1, (Data)other) → None :

    Make this object a copy of `other`

    > note: | The two objects will act independently from now on. That is, changing `other` after this call will not change this object and vice versa.

    copy( (Data)arg1) -> Data :

      note: | In the no argument form, a new object will be returned which is an independent copy of this object.

  `copyWithMask`((Data)arg1, (Data)other, (Data)mask) → None :

    Selectively copy values from `other` `Data`.Datapoints which correspond to positive values in `mask` will be copied from `other`

    Parameters:

    - other (`Data`) – source of values
    - mask (Scalar `Data`) –

  `delay`((Data)arg1) → Data :

    Convert this object into lazy representation

  `dump`((Data)arg1, (str)fileName) → None :

    Save the data as a netCDF file

    Parameters: | fileName (`string`) –

  `expand`((Data)arg1) → None :

    Convert the data to expanded representation if it is not expanded already.

  `getDomain`((Data)arg1) → Domain :

    Return type: | `Domain`

  `getFunctionSpace`((Data)arg1) → FunctionSpace :

    Return type: | `FunctionSpace`

  `getNumberOfDataPoints`((Data)arg1) → int :

    Return type: | `int`
    Returns: | Number of datapoints in the object

  `getRank`((Data)arg1) → int :

    Returns: | the number of indices required to address a component of a datapoint
    Return type: | positive `int`

  `getShape`((Data)arg1) → tuple :

    Returns the shape of the datapoints in this object as a python tuple. Scalar data has the shape `()`

    Return type: | `tuple`

  `getTagNumber`((Data)arg1, (int)dpno) → int :

    Return tag number for the specified datapoint

    Return type: | int
    Parameters: | dpno (int) – datapoint number

  `getTupleForDataPoint`((Data)arg1, (int)dataPointNo) → object :

    Returns: | Value of the specified datapoint
    Return type: | `tuple`
    Parameters: | dataPointNo (`int`) – datapoint to access

  `getTupleForGlobalDataPoint`((Data)arg1, (int)procNo, (int)dataPointNo) → object :

    Get a specific datapoint from a specific process

    Return type: | `tuple`

    Parameters:

    - procNo (positive `int`) – MPI rank of the process
    - dataPointNo (int) – datapoint to access

  `hasNaN`((Data)arg1) → bool :

    Returns return true if data contains NaN.

  `imag`((Data)arg1) → Data
  `internal_maxGlobalDataPoint`((Data)arg1) → tuple :

    Please consider using getSupLocator() from pdetools instead.

  `internal_minGlobalDataPoint`((Data)arg1) → tuple :

    Please consider using getInfLocator() from pdetools instead.

  `interpolate`((Data)arg1, (FunctionSpace)functionspace) → Data :

    Interpolate this object’s values into a new functionspace.

  `interpolateTable`((Data)arg1, (object)table, (float)Amin, (float)Astep, (Data)B, (float)Bmin, (float)Bstep[, (float)undef=1e+50[, (bool)check_boundaries=False]]) → Data :
    Creates a new Data object by interpolating using the source data (which are

      looked up in `table`) `A` must be the outer dimension on the table

      param table: | two dimensional collection of values
      param Amin: | The base of locations in table
      type Amin: | float
      param Astep: | size of gap between each item in the table
      type Astep: | float
      param undef: | upper bound on interpolated values
      type undef: | float
      param B: | Scalar representing the second coordinate to be mapped into the table
      type B: | `Data`
      param Bmin: | The base of locations in table for 2nd dimension
      type Bmin: | float
      param Bstep: | size of gap between each item in the table for 2nd dimension
      type Bstep: | float
      param check_boundaries:
      | if true, then values outside the boundaries will be rejected. If false, then boundary values will be used.
      raise RuntimeError(DataException):
      | if the coordinates do not map into the table or if the interpolated value is above `undef`
      rtype: | `Data`

    interpolateTable( (Data)arg1, (object)table, (float)Amin, (float)Astep [, (float)undef=1e+50 [, (bool)check_boundaries=False]]) -> Data

  `isComplex`((Data)arg1) → bool :

    Return type: | `bool`
    Returns: | True if this `Data` stores complex values.

  `isConstant`((Data)arg1) → bool :

    Return type: | `bool`
    Returns: | True if this `Data` is an instance of `DataConstant`
    Note: | This does not mean the data is immutable.

  `isEmpty`((Data)arg1) → bool :

    Is this object an instance of `DataEmpty`

    Return type: | `bool`
    Note: | This is not the same thing as asking if the object contains datapoints.

  `isExpanded`((Data)arg1) → bool :

    Return type: | `bool`
    Returns: | True if this `Data` is expanded.

  `isLazy`((Data)arg1) → bool :

    Return type: | `bool`
    Returns: | True if this `Data` is lazy.

  `isProtected`((Data)arg1) → bool :

    Can this instance be modified. :rtype: `bool`

  `isReady`((Data)arg1) → bool :

    Return type: | `bool`
    Returns: | True if this `Data` is not lazy.

  `isTagged`((Data)arg1) → bool :

    Return type: | `bool`
    Returns: | True if this `Data` is expanded.

  `nonuniformInterpolate`((Data)arg1, (object)in, (object)out, (bool)check_boundaries) → Data :

    1D interpolation with non equally spaced points

  `nonuniformSlope`((Data)arg1, (object)in, (object)out, (bool)check_boundaries) → Data :

    1D interpolation of slope with non equally spaced points

  `phase`((Data)arg1) → Data
  `promote`((Data)arg1) → None
  `real`((Data)arg1) → Data
  `replaceNaN`((Data)arg1, (object)value) → None :

    Replaces NaN values with value

  `resolve`((Data)arg1) → None :

    Convert the data to non-lazy representation.

  `setProtection`((Data)arg1) → None :

    Disallow modifications to this data object

    Note: | This method does not allow you to undo protection.

  `setTaggedValue`((Data)arg1, (int)tagKey, (object)value) → None :

    Set the value of tagged Data.

    > param tagKey: | tag to update
    > type tagKey: | `int`

    setTaggedValue( (Data)arg1, (str)name, (object)value) -> None :

      param name: | tag to update
      type name: | `string`
      param value: | value to set tagged data to
      type value: | `object` which acts like an array, `tuple` or `list`

  `setToZero`((Data)arg1) → None :

    After this call the object will store values of the same shape as before but all components will be zero.

  `setValueOfDataPoint`((Data)arg1, (int)dataPointNo, (object)value) → None

    setValueOfDataPoint( (Data)arg1, (int)arg2, (object)arg3) -> None

    setValueOfDataPoint( (Data)arg1, (int)arg2, (float)arg3) -> None :

    > Modify the value of a single datapoint.

    > param dataPointNo:
    > type dataPointNo:
    > | int
    > param value: |
    > type value: | `float` or an object which acts like an array, `tuple` or `list`
    > warning: | Use of this operation is discouraged. It prevents some optimisations from operating.

  `tag`((Data)arg1) → None :

    Convert data to tagged representation if it is not already tagged or expanded

  `toListOfTuples`((Data)arg1[, (bool)scalarastuple=False]) → object :

    Return the datapoints of this object in a list. Each datapoint is stored as a tuple.

    Parameters: | scalarastuple – if True, scalar data will be wrapped as a tuple. True => [(0), (1), (2)]; False => [0, 1, 2]

class `esys.downunder.domainbuilder.``DataSource`(reference_system=None, tags=[])

  Bases: `object`

  A class that provides survey data for the inversion process. This is an abstract base class that implements common functionality. Methods to be overwritten by subclasses are marked as such. This class assumes 2D data which is mapped to a slice of a 3D domain. For other setups override the methods as required.

  `__init__`(reference_system=None, tags=[])

    Constructor. Sets some defaults and initializes logger.

    Parameters:

    - tags (`list` of almost any type (typically `str`)) – a list of tags associated with the data set.
    - reference_system (`None` or `ReferenceSystem`) – the reference coordinate system

  `ACOUSTIC` = 2
  `GRAVITY` = 0
  `MAGNETIC` = 1
  `MT` = 3
  `getDataExtents`()

    returns a tuple of tuples `( (x0, y0), (nx, ny), (dx, dy) )`, where

    - `x0`, `y0` = coordinates of data origin
    - `nx`, `ny` = number of data points in x and y
    - `dx`, `dy` = spacing of data points in x and y

    This method must be implemented in subclasses.

  `getDataType`()

    Returns the type of survey data managed by this source. Subclasses must return `GRAVITY` or `MAGNETIC` or `ACOUSTIC` as appropriate.

  `getHeightScale`()

    returns the height scale factor to convert from meters to the appropriate units of the reference system used.

    Return type: | `float`

  `getReferenceSystem`()

    returns the reference coordinate system

    Return type: | `ReferenceSystem`

  `getSubsamplingFactor`()

    Returns the subsampling factor that was set via `setSubsamplingFactor` (see there).

  `getSurveyData`(domain, origin, NE, spacing)

    This method is called by the `DomainBuilder` to retrieve the survey data as `Data` objects on the given domain.

    Subclasses should return one or more `Data` objects with survey data interpolated on the given `escript` domain. The exact return type depends on the type of data.

    Parameters:

    - domain (`esys.escript.Domain`) – the escript domain to use
    - origin (`tuple` or `list`) – the origin coordinates of the domain
    - NE (`tuple` or `list`) – the number of domain elements in each dimension
    - spacing (`tuple` or `list`) – the cell sizes (node spacing) in the domain

  `getTags`()

    returns the list of tags

    Return type: | `list`

  `getUtmZone`()

    All data source coordinates are converted to UTM (Universal Transverse Mercator) in order to have useful domain extents. Subclasses should implement this method and return the UTM zone number of the projected coordinates.

  `hasTag`(tag)

    returns true if the data set has tag `tag`

    Return type: | `bool`

  `setSubsamplingFactor`(f)

    Sets the data subsampling factor (default=1).

    The factor is applied in all dimensions. For example a 2D dataset with 300 x 150 data points will be reduced to 150 x 75 when a subsampling factor of 2 is used. This becomes important when adding data of varying resolution to a `DomainBuilder`.

class `esys.downunder.domainbuilder.``DomainBuilder`(dim=3, reference_system=None)

  Bases: `object`

  This class is responsible for constructing an escript Domain object with suitable extents and resolution for survey data (`DataSource` objects) that are added to it.

  The domain covers a region above and below the Earth surface. The East-West direction is used as the x- or longitudinal or x[0] direction, the North-South direction is used as the y- or latitudinal or x[1] direction, the vertical direction is denoted by z or radial or x[2] direction. The corresponding terms are used synonymously.

  `__init__`(dim=3, reference_system=None)

    Constructor.

    Parameters:

    - dim (`int`) – Dimensionality (2 or 3) of the target domain. This has implications for the survey data than can be added. By default a 3D domain is created.
    - reference_system (`ReferenceSystem`) – reference coordinate system. By default the Cartesian coordinate system is used.

  `addSource`(source)

    Adds a survey data provider to the domain builder. An exception is raised if the domain has already been built. An exception is also reported if the reference system used is cartesian and the UTM zone of `source` does not match the UTM zone of sources already added to the domain builder (see Inversion Cookbook for more information). The dimensionality of the data source must be compatible with this domain builder. That is, the dimensionality of the data must be one less than the dimensionality of the domain (specified in the constructor).

    Parameters: | source (`DataSource`) – The data source to be added. Its reference system needs to match the reference system of the DomainBuilder.

  `fixDensityBelow`(depth=None)

    Defines the depth below which the density anomaly is set to a given value. If no value is given zero is assumed.

    Parameters: | depth (`float`) – depth below which the density is fixed. If not set, no constraint at depth is applied.

  `fixSusceptibilityBelow`(depth=None)

    Defines the depth below which the susceptibility anomaly is set to a given value. If no value is given zero is assumed.

    Parameters: | depth (`float`) – depth below which the susceptibility is fixed. If not set, no constraint at depth is applied.

  `fixVelocityBelow`(depth=None)

    Defines the depth below which the velocity and Q index is set to a given value. If no value is given zero is assumed.

    Parameters: | depth (`float`) – depth below which the velocity is fixed. If not set, no constraint at depth is applied.

  `getBackgroundMagneticFluxDensity`()

    Returns the background magnetic flux density.

  `getDomain`()

    Returns a domain that spans the data area plus padding.

    The domain is created the first time this method is called, subsequent calls return the same domain so anything that affects the domain (such as padding) needs to be set beforehand.

    Returns: | The escript domain for this data source
    Return type: | `esys.escript.Domain`

  `getGravitySurveys`()

    Returns a list of gravity surveys, see `getSurveys` for details.

  `getMagneticSurveys`()

    Returns a list of magnetic surveys, see `getSurveys` for details.

  `getReferenceSystem`()

    returns the reference coordinate system

    Return type: | `ReferenceSystem`

  `getSetDensityMask`()

    Returns the density mask data object which is non-zero for cells whose density value is fixed, zero otherwise.

  `getSetSusceptibilityMask`()

    Returns the susceptibility mask data object which is non-zero for cells whose susceptibility value is fixed, zero otherwise.

  `getSurveys`(datatype, tags=None)

    Returns a list of `Data` objects for all surveys of type `datatype` available to this domain builder. If a list of `tags` is given only data sources whose tag matches the tag list are returned.

    Returns: | List of surveys which are tuples (anomaly,error).
    Return type: | `list`

  `getTags`()

    returns a list of all tags in use by the attached data sources. The list may be empty.

  `setBackgroundMagneticFluxDensity`(B)

    Sets the background magnetic flux density B=(B_East, B_North, B_Vertical)

  `setElementPadding`(pad_x=None, pad_y=None, pad_lat=None, pad_lon=None)

    Sets the amount of padding around the dataset in number of elements (cells).

    When the domain is constructed `pad_x` (`pad_y`) elements are added on each side of the x- (y-) dimension. The arguments must be non-negative.

    Parameters:

    - pad_x (`int`) – Padding per side in x direction (default: no padding)
    - pad_y (`int`) – Padding per side in y direction (default: no padding)

    Note: | `pad_y` is ignored for 2-dimensional datasets.

  `setFractionalPadding`(pad_x=None, pad_y=None, pad_lat=None, pad_lon=None)

    Sets the amount of padding around the dataset as a fraction of the dataset side lengths.

    For example, calling `setFractionalPadding(0.2, 0.1)` with a data source of size 10x20 will result in the padded data set size 14x24 (10*(1+2*0.2), 20*(1+2*0.1))

    Parameters:

    - pad_x (`float`) – Padding per side in x direction (default: no padding)
    - pad_y (`float`) – Padding per side in y direction (default: no padding)
    - pad_lat (`float`) – Padding per side in latitudinal direction (default: no padding)
    - pad_lon (`float`) – Padding per side in longitudinal direction (default: no padding)

    Note: | `pad_y` is ignored for 2-dimensional domains.

  `setGeoPadding`(pad_lat=None, pad_lon=None)

    Sets the amount of padding around the dataset in longitude and latitude.

    The final domain size will be the extent in the latitudinal (in longitudinal) direction of the dataset plus twice the value of `pad_lat` (`pad_lon`). The arguments must be non-negative.

    Parameters:

    - pad_lat (`float` in units of degree) – Padding per side in latitudinal direction (default: 0)
    - pad_lon (`float` in units of degree) – Padding per side in longitudinal direction (default: 0)

    Note: | `pad_lon` is ignored for 2-dimensional domains.
    Note: | this function can only be used if the reference system is not Cartesian

  `setPadding`(pad_x=None, pad_y=None, pad_lat=None, pad_lon=None)

    Sets the amount of padding around the dataset in absolute length units.

    The final domain size will be the length in x (in y) of the dataset plus twice the value of `pad_x` (`pad_y`). The arguments must be non-negative.

    Parameters:

    - pad_x (`float` in units of length (meter)) – Padding per side in x direction (default: no padding)
    - pad_y (`float` in units of length (meter)) – Padding per side in y direction (default: no padding)

    Note: | `pad_y` is ignored for 2-dimensional domains.
    Note: | this function can only be used if the reference system is Cartesian

  `setVerticalExtents`(depth=40000.0, air_layer=10000.0, num_cells=25)

    This method sets the target domain parameters for the vertical dimension.

    Parameters:

    - depth (`float`) – Depth of the domain (in meters)
    - air_layer (`float`) – Depth of the layer above sea level (in meters)
    - num_cells (`int`) – Number of domain elements for the entire vertical dimension

class `esys.downunder.domainbuilder.``FileWriter`(fn, append=False, createLocalFiles=False)

  Bases: `object`

  Interface to write data to a file. In essence this class wrappes the standard `file` object to write data that are global in MPI to a file. In fact, data are writen on the processor with MPI rank 0 only. It is recommended to use `FileWriter` rather than `open` in order to write code that is running with as well as with MPI. It is safe to use `open` onder MPI to read data which are global under MPI. :var name: name of file :var mode: access mode (=’w’ or =’a’) :var closed: True to indicate closed file :var newlines: line seperator

  `__init__`(fn, append=False, createLocalFiles=False)

    Opens a file of name `fn` for writing. If running under MPI only the first processor with rank==0 will open the file and write to it. If `createLocalFiles` each individual processor will create a file where for any processor with rank>0 the file name is extended by its rank. This option is normally only used for debug purposes.

    Parameters:

    - fn (`str`) – filename.
    - append (`bool`) – switches on the creation of local files.
    - createLocalFiles (`bool`) – switches on the creation of local files.

  `close`()

    Closes the file

  `flush`()

    Flush the internal I/O buffer.

  `write`(txt)

    Write string `txt` to file.

    Parameters: | txt (`str`) – string `txt` to be written to file

  `writelines`(txts)

    Write the list `txt` of strings to the file.

    Parameters: | txts (any iterable object producing strings) – sequense of strings to be written to file
    Note: | Note that newlines are not added. This method is equivalent to call write() for each string.

class `esys.downunder.domainbuilder.``ReferenceSystem`(name='none')

  Bases: `object`

  Generic identifier for coordinate systems.

  `__init__`(name='none')

    initialization of reference system

    Parameters: | name – name of the reference system

    :type name : `str`

  `createTransformation`(domain)

    creates an appropriate coordinate transformation on a given domain

    Note

    needs to be overwritten by a particular reference system

    Parameters: | domain (`esys.escript.AbstractDomain`) – domain of transformation
    Return type: | `SpatialCoordinateTransformation`

  `getName`()

    returns the name of the reference system

  `isCartesian`()

    returns if the reference system is Cartesian

    Note

    needs to be overwritten by a particular reference system

    Return type: | `bool`

  `isTheSame`(other)

    test if argument `other` defines the same reference system

    Parameters: | other (`ReferenceSystem`) – a second reference system
    Returns: | `True` if other defines the same reference system
    Return type: | `bool`

    Note

    needs to be overwritten by a particular reference system

## Functions

`esys.downunder.domainbuilder.``Abs`(arg)

  Returns the absolute value of argument `arg`.

  Parameters: | arg (`float`, `escript.Data`, `Symbol`, `numpy.ndarray`.) – argument
  Return type: | `float`, `escript.Data`, `Symbol`, `numpy.ndarray` depending on the type of `arg`
  Raises: | TypeError – if the type of the argument is not expected

`esys.downunder.domainbuilder.``Brick`((float)n0, (float)n1, (float)n2[, (object)l0=1.0[, (object)l1=1.0[, (object)l2=1.0[, (int)d0=-1[, (int)d1=-1[, (int)d2=-1[, (object)diracPoints=[][, (object)diracTags=[][, (SubWorld)escriptworld=None]]]]]]]]]) → Domain :

  Creates a hexagonal mesh with n0 x n1 x n2 elements over the brick [0,l0] x [0,l1] x [0,l2].

  Parameters:

  - n0 (`int`) – number of elements in direction 0
  - n1 (`int`) – number of elements in direction 1
  - n2 (`int`) – number of elements in direction 2
  - l0 (`float` or `tuple`) – length of side 0 or coordinate range of side 0
  - l1 (`float` or `tuple`) – length of side 1 or coordinate range of side 1
  - l2 (`float` or `tuple`) – length of side 2 or coordinate range of side 2
  - d0 (`int`) – number of subdivisions in direction 0
  - d1 (`int`) – number of subdivisions in direction 1
  - d2 (`int`) – number of subdivisions in direction 2

`esys.downunder.domainbuilder.``C_GeneralTensorProduct`((Data)arg0, (Data)arg1[, (int)axis_offset=0[, (int)transpose=0]]) → Data :

  Compute a tensor product of two Data objects.

  Return type: | `Data`

  Parameters:

  - arg0 –
  - arg1 –
  - axis_offset (`int`) –
  - transpose (int) – 0: transpose neither, 1: transpose arg0, 2: transpose arg1

`esys.downunder.domainbuilder.``L2`(arg)

  Returns the L2 norm of `arg` at `where`.

  Parameters: | arg (`escript.Data` or `Symbol`) – function of which the L2 norm is to be calculated
  Returns: | L2 norm of `arg`
  Return type: | `float` or `Symbol`
  Note: | L2(arg) is equivalent to `sqrt(integrate(inner(arg,arg)))`

`esys.downunder.domainbuilder.``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: | arg (`float`, `int`, `escript.Data`, `numpy.ndarray`) – argument
  Returns: | maximum value of the absolute value of `arg` over all components and all data points
  Return type: | `float`
  Raises: | TypeError – if type of `arg` cannot be processed

`esys.downunder.domainbuilder.``Rectangle`((float)n0, (float)n1[, (object)l0=1.0[, (object)l1=1.0[, (int)d0=-1[, (int)d1=-1[, (object)diracPoints=[][, (object)diracTags=[][, (SubWorld)escriptworld=None]]]]]]]) → Domain :

  Creates a rectangular mesh with n0 x n1 elements over the rectangle [0,l0] x [0,l1].

  Parameters:

  - n0 (`int`) – number of elements in direction 0
  - n1 (`int`) – number of elements in direction 1
  - l0 (`float` or `tuple`) – length of side 0 or coordinate range of side 0
  - l1 (`float` or `tuple`) – length of side 1 or coordinate range of side 1
  - d0 (`int`) – number of subdivisions in direction 0
  - d1 (`int`) – number of subdivisions in direction 1

`esys.downunder.domainbuilder.``acos`(arg)

  Returns the inverse cosine of argument `arg`.

  Parameters: | arg (`float`, `escript.Data`, `Symbol`, `numpy.ndarray`) – argument
  Return type: | `float`, `escript.Data`, `Symbol`, `numpy.ndarray` depending on the type of `arg`
  Raises: | TypeError – if the type of the argument is not expected

`esys.downunder.domainbuilder.``acosh`(arg)

  Returns the inverse hyperbolic cosine of argument `arg`.

  Parameters: | arg (`float`, `escript.Data`, `Symbol`, `numpy.ndarray`) – argument
  Return type: | `float`, `escript.Data`, `Symbol`, `numpy.ndarray` depending on the type of `arg`
  Raises: | TypeError – if the type of the argument is not expected

`esys.downunder.domainbuilder.``antihermitian`(arg)

  Returns the anti-hermitian part of the square matrix `arg`. That is, (arg-adjoint(arg))/2.

  Parameters: | arg (`numpy.ndarray`, `escript.Data`, `Symbol`) – input matrix. Must have rank 2 or 4 and be square.
  Returns: | anti-hermitian part of `arg`
  Return type: | `numpy.ndarray`, `escript.Data`, `Symbol` depending on the input

`esys.downunder.domainbuilder.``antisymmetric`(arg)

  Returns the anti-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: | anti-symmetric part of `arg`
  Return type: | `numpy.ndarray`, `escript.Data`, `Symbol` depending on the input

`esys.downunder.domainbuilder.``asin`(arg)

  Returns the inverse sine of argument `arg`.

  Parameters: | arg (`float`, `escript.Data`, `Symbol`, `numpy.ndarray`) – argument
  Return type: | `float`, `escript.Data`, `Symbol`, `numpy.ndarray` depending on the type of `arg`
  Raises: | TypeError – if the type of the argument is not expected

`esys.downunder.domainbuilder.``asinh`(arg)

  Returns the inverse hyperbolic sine of argument `arg`.

  Parameters: | arg (`float`, `escript.Data`, `Symbol`, `numpy.ndarray`) – argument
  Return type: | `float`, `escript.Data`, `Symbol`, `numpy.ndarray` depending on the type of `arg`
  Raises: | TypeError – if the type of the argument is not expected

`esys.downunder.domainbuilder.``atan`(arg)

  Returns inverse tangent of argument `arg`.

  Parameters: | arg (`float`, `escript.Data`, `Symbol`, `numpy.ndarray`) – argument
  Return type: | `float`, `escript.Data`, `Symbol`, `numpy.ndarray` depending on the type of `arg`
  Raises: | TypeError – if the type of the argument is not expected

`esys.downunder.domainbuilder.``atan2`(arg0, arg1)

  Returns inverse tangent of argument `arg0` over `arg1`

`esys.downunder.domainbuilder.``atanh`(arg)

  Returns the inverse hyperbolic tangent of argument `arg`.

  Parameters: | arg (`float`, `escript.Data`, `Symbol`, `numpy.ndarray`) – argument
  Return type: | `float`, `escript.Data`, `Symbol`, `numpy.ndarray` depending on the type of `arg`
  Raises: | TypeError – if the type of the argument is not expected

`esys.downunder.domainbuilder.``boundingBox`(domain)

  Returns the bounding box of a domain

  Parameters: | domain (`escript.Domain`) – a domain
  Returns: | bounding box of the domain
  Return type: | `list` of pairs of `float`

`esys.downunder.domainbuilder.``boundingBoxEdgeLengths`(domain)

  Returns the edge lengths of the bounding box of a domain

  Parameters: | domain (`escript.Domain`) – a domain
  Return type: | `list` of `float`

`esys.downunder.domainbuilder.``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: | an object that contains all values from `arg` between `minval` and `maxval`
  Return type: | `numpy.ndarray`, `escript.Data`, `Symbol`, `int` or `float` depending on the input
  Raises: | ValueError – if `minval>maxval`

`esys.downunder.domainbuilder.``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: | the spatial dimension of the objects with identifiable dimension (see `pokeDim`). If none of the objects has a spatial dimension `None` is returned.
  Return type: | `int` or `None`
  Raises: | ValueError – if the objects with identifiable dimension don’t have the same spatial dimension.

`esys.downunder.domainbuilder.``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: | 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`
  Return type: | `tuple` of `int`
  Raises: | ValueError – if no shape can be found

`esys.downunder.domainbuilder.``condEval`(f, tval, fval)

  Wrapper to allow non-data objects to be used.

`esys.downunder.domainbuilder.``cos`(arg)

  Returns cosine of argument `arg`.

  Parameters: | arg (`float`, `escript.Data`, `Symbol`, `numpy.ndarray`) – argument
  Return type: | `float`, `escript.Data`, `Symbol`, `numpy.ndarray` depending on the type of `arg`
  Raises: | TypeError – if the type of the argument is not expected

`esys.downunder.domainbuilder.``cosh`(arg)

  Returns the hyperbolic cosine of argument `arg`.

  Parameters: | arg (`float`, `escript.Data`, `Symbol`, `numpy.ndarray`) – argument
  Return type: | `float`, `escript.Data`, `Symbol`, `numpy.ndarray` depending on the type of `arg`
  Raises: | TypeError – if the type of the argument is not expected

`esys.downunder.domainbuilder.``delay`(arg)

  Returns a lazy version of arg

`esys.downunder.domainbuilder.``deviatoric`(arg)

  Returns the deviatoric version of `arg`.

`esys.downunder.domainbuilder.``diameter`(domain)

  Returns the diameter of a domain.

  Parameters: | domain (`escript.Domain`) – a domain
  Return type: | `float`

`esys.downunder.domainbuilder.``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: | divergence of `arg`
  Return type: | `escript.Data` or `Symbol`

`esys.downunder.domainbuilder.``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: | the eigenvalues in increasing order
  Return type: | `numpy.ndarray`, `escript.Data`, `Symbol` depending on the input
  Note: | for `escript.Data` and `Symbol` objects the dimension is restricted to 3.

`esys.downunder.domainbuilder.``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: | 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.
  Return type: | `tuple` of `escript.Data`
  Note: | The dimension is restricted to 3.

`esys.downunder.domainbuilder.``erf`(arg)

  Returns the error function erf of argument `arg`.

  Parameters: | arg (`float`, `escript.Data`, `Symbol`, `numpy.ndarray`.) – argument
  Return type: | `float`, `escript.Data`, `Symbol`, `numpy.ndarray` depending on the type of `arg`
  Raises: | TypeError – if the type of the argument is not expected

`esys.downunder.domainbuilder.``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!!!

`esys.downunder.domainbuilder.``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!!!

`esys.downunder.domainbuilder.``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!!!

`esys.downunder.domainbuilder.``escript_inverse`(arg)

  arg is a Data object!

`esys.downunder.domainbuilder.``exp`(arg)

  Returns e to the power of argument `arg`.

  Parameters: | arg (`float`, `escript.Data`, `Symbol`, `numpy.ndarray`.) – argument
  Return type: | `float`, `escript.Data`, `Symbol`, `numpy.ndarray` depending on the type of arg
  Raises: | TypeError – if the type of the argument is not expected

`esys.downunder.domainbuilder.``generalTensorProduct`(arg0, arg1, axis_offset=0)

  Generalized tensor product.

  `out[s,t]=Sigma_r arg0[s,r]*arg1[r,t]`

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

  Parameters:

  - arg0 (`numpy.ndarray`, `escript.Data`, `Symbol`, `float`, `int`) – first argument
  - arg1 (`numpy.ndarray`, `escript.Data`, `Symbol`, `float`, `int`) – second argument

  Returns: | the general tensor product of `arg0` and `arg1` at each data point
  Return type: | `numpy.ndarray`, `escript.Data`, `Symbol` depending on the input

`esys.downunder.domainbuilder.``generalTensorTransposedProduct`(arg0, arg1, axis_offset=0)

  Generalized tensor product of `arg0` and transpose of `arg1`.

  `out[s,t]=Sigma_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:

  - arg0 (`numpy.ndarray`, `escript.Data`, `Symbol`, `float`, `int`) – first argument
  - arg1 (`numpy.ndarray`, `escript.Data`, `Symbol`, `float`, `int`) – second argument

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

`esys.downunder.domainbuilder.``generalTransposedTensorProduct`(arg0, arg1, axis_offset=0)

  Generalized tensor product of transposed of `arg0` and `arg1`.

  `out[s,t]=Sigma_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:

  - arg0 (`numpy.ndarray`, `escript.Data`, `Symbol`, `float`, `int`) – first argument
  - arg1 (`numpy.ndarray`, `escript.Data`, `Symbol`, `float`, `int`) – second argument

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

`esys.downunder.domainbuilder.``getClosestValue`(arg, origin=0)

  Returns the value in `arg` which is closest to origin.

  Parameters:

  - arg (`escript.Data`) – function
  - origin (`float` or `escript.Data`) – reference value

  Returns: | value in `arg` closest to origin
  Return type: | `numpy.ndarray`

`esys.downunder.domainbuilder.``getEpsilon`()

`esys.downunder.domainbuilder.``getMPIRankWorld`() → int :

  Return the rank of this process in the MPI World.

`esys.downunder.domainbuilder.``getMPIWorldMax`((int)arg1) → int :

  Each MPI process calls this function with a value for arg1. The maximum value is computed and returned.

  Return type: | int

`esys.downunder.domainbuilder.``getMaxFloat`()

`esys.downunder.domainbuilder.``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: | the rank of the argument
  Return type: | `int`
  Raises: | TypeError – if type of `arg` cannot be processed

`esys.downunder.domainbuilder.``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: | the shape of the argument
  Return type: | `tuple` of `int`
  Raises: | TypeError – if type of `arg` cannot be processed

`esys.downunder.domainbuilder.``getTagNames`(domain)

  Returns a list of tag names used by the domain.

  Parameters: | domain (`escript.Domain`) – a domain object
  Returns: | a list of tag names used by the domain
  Return type: | `list` of `str`

`esys.downunder.domainbuilder.``getVersion`() → int :

  This method will only report accurate version numbers for clean checkouts.

`esys.downunder.domainbuilder.``gmshGeo2Msh`(geoFile, mshFile, numDim, order=1, verbosity=0)

  Runs gmsh to mesh input `geoFile`. Returns 0 on success.

`esys.downunder.domainbuilder.``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: | gradient of `arg`
  Return type: | `escript.Data` or `Symbol`

`esys.downunder.domainbuilder.``grad_n`(arg, n, where=None)

`esys.downunder.domainbuilder.``hermitian`(arg)

  Returns the hermitian part of the square matrix `arg`. That is, (arg+adjoint(arg))/2.

  Parameters: | arg (`numpy.ndarray`, `escript.Data`, `Symbol`) – input matrix. Must have rank 2 or 4 and be square.
  Returns: | hermitian part of `arg`
  Return type: | `numpy.ndarray`, `escript.Data`, `Symbol` depending on the input

`esys.downunder.domainbuilder.``identity`(shape=())

  Returns the `shape` x `shape` identity tensor.

  Parameters: | shape (`tuple` of `int`) – input shape for the identity tensor
  Returns: | 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.
  Return type: | `numpy.ndarray` of rank 1, rank 2 or rank 4
  Raises: | ValueError – if len(shape)>2

`esys.downunder.domainbuilder.``identityTensor`(d=3)

  Returns the `d` x `d` identity matrix.

  Parameters: | d (`int`, `escript.Domain` or `escript.FunctionSpace`) – dimension or an object that has the `getDim` method defining the dimension
  Returns: | the object u of rank 2 with u[i,j]=1 for i=j and u[i,j]=0 otherwise
  Return type: | `numpy.ndarray` or `escript.Data` of rank 2

`esys.downunder.domainbuilder.``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: | 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
  Return type: | `numpy.ndarray` or `escript.Data` of rank 4

`esys.downunder.domainbuilder.``inf`(arg)

  Returns the minimum value over all data points.

  Parameters: | arg (`float`, `int`, `escript.Data`, `numpy.ndarray`) – argument
  Returns: | minimum value of `arg` over all components and all data points
  Return type: | `float`
  Raises: | TypeError – if type of `arg` cannot be processed

`esys.downunder.domainbuilder.``inner`(arg0, arg1)

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

  `out=Sigma_s arg0[s]*arg1[s]`

  where s runs through `arg0.Shape`.

  `arg0` and `arg1` must have the same shape.

  Parameters:

  - arg0 (`numpy.ndarray`, `escript.Data`, `Symbol`, `float`, `int`) – first argument
  - arg1 (`numpy.ndarray`, `escript.Data`, `Symbol`, `float`, `int`) – second argument

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

`esys.downunder.domainbuilder.``insertTagNames`(domain, **kwargs)

  Inserts tag names into the domain.

  Parameters:

  - domain (`escript.Domain`) – a domain object
  - <tag_name> (`int`) – tag key assigned to <tag_name>

`esys.downunder.domainbuilder.``insertTaggedValues`(target, **kwargs)

  Inserts tagged values into the target using tag names.

  Parameters:

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

  Returns: | `target`
  Return type: | `escript.Data`

`esys.downunder.domainbuilder.``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: | integral of `arg`
  Return type: | `float`, `numpy.ndarray` or `Symbol`

`esys.downunder.domainbuilder.``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:

  - arg (`escript.Data` or `Symbol`) – interpolant
  - where (`escript.FunctionSpace`) – `FunctionSpace` to be interpolated to

  Returns: | interpolated argument
  Return type: | `escript.Data` or `Symbol`

`esys.downunder.domainbuilder.``interpolateTable`(tab, dat, start, step, undef=1e+50, check_boundaries=False)

`esys.downunder.domainbuilder.``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: | inverse of the argument. `matrix_mult(inverse(arg),arg)` will be almost equal to `kronecker(arg.getShape()[0])`
  Return type: | `numpy.ndarray`, `escript.Data`, `Symbol` depending on the input
  Note: | for `escript.Data` objects the dimension is restricted to 3.

`esys.downunder.domainbuilder.``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.

  Returns: | jump of `arg`
  Return type: | `escript.Data` or `Symbol`

`esys.downunder.domainbuilder.``kronecker`(d=3)

  Returns the kronecker delta-symbol.

  Parameters: | d (`int`, `escript.Domain` or `escript.FunctionSpace`) – dimension or an object that has the `getDim` method defining the dimension
  Returns: | the object u of rank 2 with u[i,j]=1 for i=j and u[i,j]=0 otherwise
  Return type: | `numpy.ndarray` or `escript.Data` of rank 2

`esys.downunder.domainbuilder.``length`(arg)

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

  Parameters: | arg (`float`, `escript.Data`, `Symbol`, `numpy.ndarray`) – argument
  Return type: | `float`, `escript.Data`, `Symbol` depending on the type of `arg`

`esys.downunder.domainbuilder.``listEscriptParams`() → list :

  Returns: | A list of tuples (p,v,d) where p is the name of a parameter for escript, v is its current value, and d is a description.

`esys.downunder.domainbuilder.``log`(arg)

  Returns the natural logarithm of argument `arg`.

  Parameters: | arg (`float`, `escript.Data`, `Symbol`, `numpy.ndarray`.) – argument
  Return type: | `float`, `escript.Data`, `Symbol`, `numpy.ndarray` depending on the type of `arg`
  Raises: | TypeError – if the type of the argument is not expected

`esys.downunder.domainbuilder.``log10`(arg)

  Returns base-10 logarithm of argument `arg`.

  Parameters: | arg (`float`, `escript.Data`, `Symbol`, `numpy.ndarray`) – argument
  Return type: | `float`, `escript.Data`, `Symbol`, `numpy.ndarray` depending on the type of `arg`
  Raises: | TypeError – if the type of the argument is not expected

`esys.downunder.domainbuilder.``longestEdge`(domain)

  Returns the length of the longest edge of the domain

  Parameters: | domain (`escript.Domain`) – a domain
  Returns: | longest edge of the domain parallel to the Cartesian axis
  Return type: | `float`

`esys.downunder.domainbuilder.``matchShape`(arg0, arg1)

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

  Parameters:

  - arg0 (`numpy.ndarray`,`escript.Data`,``float``, `int`, `Symbol`) – first argument
  - arg1 (`numpy.ndarray`,`escript.Data`,``float``, `int`, `Symbol`) – second argument

  Returns: | `arg0` and `arg1` where copies are returned when the shape has to be changed
  Return type: | `tuple`

`esys.downunder.domainbuilder.``matchType`(arg0=0.0, arg1=0.0)

  Converts `arg0` and `arg1` both to the same 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: | a tuple representing `arg0` and `arg1` with the same type or with at least one of them being a `Symbol`
  Return type: | `tuple` of two `numpy.ndarray` or two `escript.Data`
  Raises: | TypeError – if type of `arg0` or `arg1` cannot be processed

`esys.downunder.domainbuilder.``matrix_mult`(arg0, arg1)

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

  `out[s0]=Sigma_{r0} arg0[s0,r0]*arg1[r0]`

  or

  `out[s0,s1]=Sigma_{r0} arg0[s0,r0]*arg1[r0,s1]`

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

  Parameters:

  - arg0 (`numpy.ndarray`, `escript.Data`, `Symbol`) – first argument of rank 2
  - arg1 (`numpy.ndarray`, `escript.Data`, `Symbol`) – second argument of at least rank 1

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

`esys.downunder.domainbuilder.``matrix_transposed_mult`(arg0, arg1)

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

  `out[s0,s1]=Sigma_{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:

  - arg0 (`numpy.ndarray`, `escript.Data`, `Symbol`) – first argument of rank 2
  - arg1 (`numpy.ndarray`, `escript.Data`, `Symbol`) – second argument of rank 1 or 2

  Returns: | the product of `arg0` and the transposed of `arg1` at each data point
  Return type: | `numpy.ndarray`, `escript.Data`, `Symbol` depending on the input
  Raises: | ValueError – if the shapes of the arguments are not appropriate

`esys.downunder.domainbuilder.``matrixmult`(arg0, arg1)

  See `matrix_mult`.

`esys.downunder.domainbuilder.``maximum`(*args)

  The maximum over arguments `args`.

  Parameters: | args (`numpy.ndarray`, `escript.Data`, `Symbol`, `int` or `float`) – arguments
  Returns: | an object which in each entry gives the maximum of the corresponding values in `args`
  Return type: | `numpy.ndarray`, `escript.Data`, `Symbol`, `int` or `float` depending on the input

`esys.downunder.domainbuilder.``maxval`(arg)

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

  Parameters: | arg (`float`, `escript.Data`, `Symbol`, `numpy.ndarray`) – argument
  Return type: | `float`, `escript.Data`, `Symbol` depending on the type of `arg`
  Raises: | TypeError – if the type of the argument is not expected

`esys.downunder.domainbuilder.``meanValue`(arg)

  return the mean value of the argument over its domain

  Parameters: | arg (`escript.Data`) – function
  Returns: | mean value
  Return type: | `float` or `numpy.ndarray`

`esys.downunder.domainbuilder.``minimum`(*args)

  The minimum over arguments `args`.

  Parameters: | args (`numpy.ndarray`, `escript.Data`, `Symbol`, `int` or `float`) – arguments
  Returns: | an object which gives in each entry the minimum of the corresponding values in `args`
  Return type: | `numpy.ndarray`, `escript.Data`, `Symbol`, `int` or `float` depending on the input

`esys.downunder.domainbuilder.``minval`(arg)

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

  Parameters: | arg (`float`, `escript.Data`, `Symbol`, `numpy.ndarray`) – argument
  Return type: | `float`, `escript.Data`, `Symbol` depending on the type of `arg`
  Raises: | TypeError – if the type of the argument is not expected

`esys.downunder.domainbuilder.``mkDir`(*pathname)

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

  Parameters: | pathname (`str` or `sequence of strings`) – valid path name
  Note: | The method is MPI safe.

`esys.downunder.domainbuilder.``mult`(arg0, arg1)

  Product of `arg0` and `arg1`.

  Parameters:

  - arg0 (`Symbol`, `float`, `int`, `escript.Data` or `numpy.ndarray`) – first term
  - arg1 (`Symbol`, `float`, `int`, `escript.Data` or `numpy.ndarray`) – second term

  Returns: | the product of `arg0` and `arg1`
  Return type: | `Symbol`, `float`, `int`, `escript.Data` or `numpy.ndarray`
  Note: | The shape of both arguments is matched according to the rules used in `matchShape`.

`esys.downunder.domainbuilder.``negative`(arg)

  returns the negative part of arg

`esys.downunder.domainbuilder.``nonsymmetric`(arg)

  Deprecated alias for antisymmetric

`esys.downunder.domainbuilder.``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: | normalized `arg` where `arg` is non-zero, and zero elsewhere
  Return type: | `escript.Data` or `Symbol`

`esys.downunder.domainbuilder.``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:

  - arg0 (`numpy.ndarray`, `escript.Data`, `Symbol`, `float`, `int`) – first argument
  - arg1 (`numpy.ndarray`, `escript.Data`, `Symbol`, `float`, `int`) – second argument

  Returns: | the outer product of `arg0` and `arg1` at each data point
  Return type: | `numpy.ndarray`, `escript.Data`, `Symbol` depending on the input

`esys.downunder.domainbuilder.``phase`(arg)

  return the “phase”/”arg”/”angle” of a number

`esys.downunder.domainbuilder.``pokeDim`(arg)

  Identifies the spatial dimension of the argument.

  Parameters: | arg (any) – an object whose spatial dimension is to be returned
  Returns: | the spatial dimension of the argument, if available, or `None`
  Return type: | `int` or `None`

`esys.downunder.domainbuilder.``polarToCart`(r, phase)

  conversion from cartesian to polar coordinates

  Parameters:

  - r (any float type object) – length
  - phase (any float type object) – the phase angle in rad

  Returns: | cartesian representation as complex number
  Return type: | appropriate complex

`esys.downunder.domainbuilder.``positive`(arg)

  returns the positive part of arg

`esys.downunder.domainbuilder.``printParallelThreadCounts`() → None

`esys.downunder.domainbuilder.``reorderComponents`(arg, index)

  Resorts the components of `arg` according to index.

`esys.downunder.domainbuilder.``resolve`(arg)

  Returns the value of arg resolved.

`esys.downunder.domainbuilder.``safeDiv`(arg0, arg1, rtol=None)

  returns arg0/arg1 but return 0 where arg1 is (almost) zero

`esys.downunder.domainbuilder.``saveDataCSV`(filename, append=False, sep=', ', csep='_', **data)

  Writes `Data` objects to a CSV file. These objects must have compatible FunctionSpaces, i.e. it must be possible to interpolate all data to one `FunctionSpace`. Note, that with more than one MPI rank this function will fail for some function spaces on some domains.

  Parameters:

  - filename (`string`) – file to save data to.
  - append (`bool`) – If `True`, then open file at end rather than beginning
  - sep (`string`) – separator between fields
  - csep – separator for components of rank 2 and above (e.g. ‘_’ -> c0_1)

  The keyword args are Data objects to save. If a scalar `Data` object is passed with the name `mask`, then only samples which correspond to positive values in `mask` will be output. Example:

      s=Scalar(..)
      v=Vector(..)
      t=Tensor(..)
      f=float()
      saveDataCSV("f.csv", a=s, b=v, c=t, d=f)

  Will result in a file

  a, b0, b1, c0_0, c0_1, .., c1_1, d 1.0, 1.5, 2.7, 3.1, 3.4, .., 0.89, 0.0 0.9, 8.7, 1.9, 3.4, 7.8, .., 1.21, 0.0

  The first line is a header, the remaining lines give the values.

`esys.downunder.domainbuilder.``saveESD`(datasetName, dataDir='.', domain=None, timeStep=0, deltaT=1, dynamicMesh=0, timeStepFormat='%04d', **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.
  - timeStepFormat (`str`) – timestep format string (defaults to “%04d”)
  - <name> (`Data` object) – writes the assigned value to the file using <name> as identifier

  Note: | The ESD concept is experimental and the file format likely to change so use this function with caution.
  Note: | The data objects have to be defined on the same domain (but not necessarily on the same `FunctionSpace`).
  Note: | 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.

`esys.downunder.domainbuilder.``showEscriptParams`()

  Displays the parameters escript recognises with an explanation and their current value.

`esys.downunder.domainbuilder.``sign`(arg)

  Returns the sign of argument `arg`.

  Parameters: | arg (`float`, `escript.Data`, `Symbol`, `numpy.ndarray`) – argument
  Return type: | `float`, `escript.Data`, `Symbol`, `numpy.ndarray` depending on the type of `arg`
  Raises: | TypeError – if the type of the argument is not expected

`esys.downunder.domainbuilder.``sin`(arg)

  Returns sine of argument `arg`.

  Parameters: | arg (`float`, `escript.Data`, `Symbol`, `numpy.ndarray`.) – argument
  Return type: | `float`, `escript.Data`, `Symbol`, `numpy.ndarray` depending on the type of `arg`
  Raises: | TypeError – if the type of the argument is not expected

`esys.downunder.domainbuilder.``sinh`(arg)

  Returns the hyperbolic sine of argument `arg`.

  Parameters: | arg (`float`, `escript.Data`, `Symbol`, `numpy.ndarray`) – argument
  Return type: | `float`, `escript.Data`, `Symbol`, `numpy.ndarray` depending on the type of `arg`
  Raises: | TypeError – if the type of the argument is not expected

`esys.downunder.domainbuilder.``sqrt`(arg)

  Returns the square root of argument `arg`.

  Parameters: | arg (`float`, `escript.Data`, `Symbol`, `numpy.ndarray`) – argument
  Return type: | `float`, `escript.Data`, `Symbol`, `numpy.ndarray` depending on the type of `arg`
  Raises: | TypeError – if the type of the argument is not expected

`esys.downunder.domainbuilder.``sup`(arg)

  Returns the maximum value over all data points.

  Parameters: | arg (`float`, `int`, `escript.Data`, `numpy.ndarray`) – argument
  Returns: | maximum value of `arg` over all components and all data points
  Return type: | `float`
  Raises: | TypeError – if type of `arg` cannot be processed

`esys.downunder.domainbuilder.``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: | `arg` with swapped components
  Return type: | `escript.Data`, `Symbol` or `numpy.ndarray` depending on the type of `arg`

`esys.downunder.domainbuilder.``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: | symmetric part of `arg`
  Return type: | `numpy.ndarray`, `escript.Data`, `Symbol` depending on the input

`esys.downunder.domainbuilder.``tan`(arg)

  Returns tangent of argument `arg`.

  Parameters: | arg (`float`, `escript.Data`, `Symbol`, `numpy.ndarray`) – argument
  Return type: | `float`, `escript.Data`, `Symbol`, `numpy.ndarray` depending on the type of `arg`
  Raises: | TypeError – if the type of the argument is not expected

`esys.downunder.domainbuilder.``tanh`(arg)

  Returns the hyperbolic tangent of argument `arg`.

  Parameters: | arg (`float`, `escript.Data`, `Symbol`, `numpy.ndarray`) – argument
  Return type: | `float`, `escript.Data`, `Symbol`, `numpy.ndarray` depending on the type of `arg`
  Raises: | TypeError – if the type of the argument is not expected

`esys.downunder.domainbuilder.``tensor_mult`(arg0, arg1)

  The tensor product of the two arguments.

  For `arg0` of rank 2 this is

  `out[s0]=Sigma_{r0} arg0[s0,r0]*arg1[r0]`

  or

  `out[s0,s1]=Sigma_{r0} arg0[s0,r0]*arg1[r0,s1]`

  and for `arg0` of rank 4 this is

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

  or

  `out[s0,s1,s2]=Sigma_{r0,r1} arg0[s0,s1,r0,r1]*arg1[r0,r1,s2]`

  or

  `out[s0,s1]=Sigma_{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: | the tensor product of `arg0` and `arg1` at each data point
  Return type: | `numpy.ndarray`, `escript.Data`, `Symbol` depending on the input

`esys.downunder.domainbuilder.``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]=Sigma_{r0} arg0[s0,r0]*arg1[s1,r0]`

  and for `arg0` of rank 4 this is

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

  or

  `out[s0,s1,s2]=Sigma_{r0,r1} arg0[s0,s1,r0,r1]*arg1[s2,r0,r1]`

  In the first case 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: | the tensor product of the transposed of `arg0` and `arg1` at each data point
  Return type: | `numpy.ndarray`, `escript.Data`, `Symbol` depending on the input

`esys.downunder.domainbuilder.``tensormult`(arg0, arg1)

  See `tensor_mult`.

`esys.downunder.domainbuilder.``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: | True if the argument is identical to zero, False otherwise
  Return type: | `bool`

`esys.downunder.domainbuilder.``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: | trace of arg. The rank of the returned object is rank of `arg` minus 2.
  Return type: | `escript.Data`, `Symbol` or `numpy.ndarray` depending on the type of `arg`

`esys.downunder.domainbuilder.``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: | transpose of `arg`
  Return type: | `escript.Data`, `Symbol`, `numpy.ndarray`, `float`, `int` depending on the type of `arg`

`esys.downunder.domainbuilder.``transposed_matrix_mult`(arg0, arg1)

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

  `out[s0]=Sigma_{r0} arg0[r0,s0]*arg1[r0]`

  or

  `out[s0,s1]=Sigma_{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:

  - arg0 (`numpy.ndarray`, `escript.Data`, `Symbol`) – first argument of rank 2
  - arg1 (`numpy.ndarray`, `escript.Data`, `Symbol`) – second argument of at least rank 1

  Returns: | the product of the transpose of `arg0` and `arg1` at each data point
  Return type: | `numpy.ndarray`, `escript.Data`, `Symbol` depending on the input
  Raises: | ValueError – if the shapes of the arguments are not appropriate

`esys.downunder.domainbuilder.``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]=Sigma_{r0} arg0[r0,s0]*arg1[r0]`

  or

  `out[s0,s1]=Sigma_{r0} arg0[r0,s0]*arg1[r0,s1]`

  and for `arg0` of rank 4 this is

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

  or

  `out[s0,s1,s2]=Sigma_{r0,r1} arg0[r0,r1,s0,s1]*arg1[r0,r1,s2]`

  or

  `out[s0,s1]=Sigma_{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: | the tensor product of transpose of arg0 and arg1 at each data point
  Return type: | `numpy.ndarray`, `escript.Data`, `Symbol` depending on the input

`esys.downunder.domainbuilder.``unitVector`(i=0, d=3)

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

  Parameters:

  - i (`int`) – index for non-zero element
  - d (`int`, `escript.Domain` or `escript.FunctionSpace`) – dimension or an object that has the `getDim` method defining the dimension

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

`esys.downunder.domainbuilder.``vol`(arg)

  Returns the volume or area of the oject `arg`

  Parameters: | arg (`escript.FunctionSpace` or `escript.Domain`) – a geometrical object
  Return type: | `float`

`esys.downunder.domainbuilder.``whereNegative`(arg)

  Returns mask of negative values of argument `arg`.

  Parameters: | arg (`float`, `escript.Data`, `Symbol`, `numpy.ndarray`) – argument
  Return type: | `float`, `escript.Data`, `Symbol`, `numpy.ndarray` depending on the type of `arg`
  Raises: | TypeError – if the type of the argument is not expected

`esys.downunder.domainbuilder.``whereNonNegative`(arg)

  Returns mask of non-negative values of argument `arg`.

  Parameters: | arg (`float`, `escript.Data`, `Symbol`, `numpy.ndarray`) – argument
  Return type: | `float`, `escript.Data`, `Symbol`, `numpy.ndarray` depending on the type of `arg`
  Raises: | TypeError – if the type of the argument is not expected

`esys.downunder.domainbuilder.``whereNonPositive`(arg)

  Returns mask of non-positive values of argument `arg`.

  Parameters: | arg (`float`, `escript.Data`, `Symbol`, `numpy.ndarray`) – argument
  Return type: | `float`, `escript.Data`, `Symbol`, `numpy.ndarray` depending on the type of `arg`
  Raises: | TypeError – if the type of the argument is not expected

`esys.downunder.domainbuilder.``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.

  Return type: | `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

`esys.downunder.domainbuilder.``wherePositive`(arg)

  Returns mask of positive values of argument `arg`.

  Parameters: | arg (`float`, `escript.Data`, `Symbol`, `numpy.ndarray`.) – argument
  Return type: | `float`, `escript.Data`, `Symbol`, `numpy.ndarray` depending on the type of `arg`
  Raises: | TypeError – if the type of the argument is not expected

`esys.downunder.domainbuilder.``whereZero`(arg, tol=None, rtol=1.4901161193847656e-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.

  Return type: | `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

`esys.downunder.domainbuilder.``zeros`(shape=())

  Returns the `shape` zero tensor.

  Parameters: | shape (`tuple` of `int`) – input shape for the identity tensor
  Returns: | array of shape filled with zeros
  Return type: | `numpy.ndarray`

## Others

- DBLE_MAX
- EPSILON
- HAVE_RIPLEY
- __all__
- __builtins__
- __copyright__
- __doc__
- __file__
- __license__
- __name__
- __package__
- __url__
- division
- print_function