Domain

class Domain(*args)

Domain.

Available constructors:
Domain(lowerBound, upperBound)
Parameters:

lowerBound, upperBound : sequence of float of dimension dim

Define a finite interval [lowerBound_0, upperBound_0]\times \dots \times [lowerBound_{dim-1}, upperBound_{dim-1}]. It is allowed to have lowerBound_i \geq upperBound_i for some i: it simply defines an empty interval. By default, an empty interval is created.

Notes

A Domain object can be created through its derived classes:

Examples

>>> import openturns as ot
>>> # Create the interval [a, b]
>>> a = 1
>>> b = 3
>>> print(ot.Domain([a], [b]))
[1, 3]
>>> print(ot.Domain(ot.Interval(a, b)))
[1, 3]

Methods

contains(point) Check if the given point is inside of the domain.
getClassName() Accessor to the object’s name.
getDimension() Get the dimension of the domain.
getId() Accessor to the object’s id.
getImplementation(*args) Accessor to the underlying implementation.
getLowerBound() Get the lower bound of the domain.
getName() Accessor to the object’s name.
getNumericalVolume() Get the volume of the domain.
getUpperBound() Get the upper bound of the domain.
getVolume() Get the geometric volume of the domain.
isEmpty() Test whether the domain is empty or not.
isNumericallyEmpty() Check if the domain is numerically empty.
numericallyContains(point) Check if the given point is inside of the discretization of the domain.
setName(name) Accessor to the object’s name.
__init__(*args)
contains(point)

Check if the given point is inside of the domain.

Parameters:

point : sequence of float

Point with the same dimension as the current domain’s dimension.

Returns:

isInside : bool

Flag telling whether the given point is inside of the domain.

getClassName()

Accessor to the object’s name.

Returns:

class_name : str

The object class name (object.__class__.__name__).

getDimension()

Get the dimension of the domain.

Returns:

dim : int

Dimension of the domain.

getId()

Accessor to the object’s id.

Returns:

id : int

Internal unique identifier.

getImplementation(*args)

Accessor to the underlying implementation.

Returns:

impl : Implementation

The implementation class.

getLowerBound()

Get the lower bound of the domain.

Returns:

lower : Point

The lower bound of an axes-aligned bounding box of the domain.

getName()

Accessor to the object’s name.

Returns:

name : str

The name of the object.

getNumericalVolume()

Get the volume of the domain.

Returns:

volume : float

Volume of the underlying mesh which is the discretization of the domain. For now, by default, it is equal to the geometrical volume.

getUpperBound()

Get the upper bound of the domain.

Returns:

upper : Point

The upper bound of an axes-aligned bounding box of the domain.

getVolume()

Get the geometric volume of the domain.

Returns:

volume : float

Geometrical volume of the domain.

isEmpty()

Test whether the domain is empty or not.

Returns:

isInside : bool

True if the interior of the geometric domain is empty.

isNumericallyEmpty()

Check if the domain is numerically empty.

Returns:

isInside : bool

Flag telling whether the domain is numerically empty, i.e. if its numerical volume is inferior or equal to \epsilon (defined in the ResourceMap: \epsilon = DomainImplementation-SmallVolume).

Examples

>>> import openturns as ot
>>> domain = ot.Domain([1.0, 2.0], [1.0, 2.0]) 
>>> print(domain.isNumericallyEmpty())
True
numericallyContains(point)

Check if the given point is inside of the discretization of the domain.

Parameters:

point : sequence of float

Point with the same dimension as the current domain’s dimension.

Returns:

isInside : bool

Flag telling whether the point is inside the discretized domain associated to the domain. For now, by default, the discretized domain is equal to the geometrical domain.

setName(name)

Accessor to the object’s name.

Parameters:

name : str

The name of the object.