DiscretizedSpace¶
- class odl.discr.discr_space.DiscretizedSpace(partition, tspace, **kwargs)[source]¶
Bases:
TensorSpaceDiscretization of a Lebesgue
space.- Attributes:
axis_labelsLabels for axes when displaying space elements.
byaxis_inObject to index along input (domain) dimensions.
cell_sidesSide lengths of a cell in an underlying uniform partition.
cell_volumeCell volume of an underlying uniform partition.
complex_dtypeThe complex dtype corresponding to this space's
dtype.complex_spaceThe space corresponding to this space's
complex_dtype.default_orderDefault storage order for new elements in this space.
domainSet on which functions are defined before discretization.
dtypeScalar data type of each entry in an element of this space.
element_typeexamplesReturn example random vectors.
exponentExponent of this space, the
pinL^p.fieldScalar field of numbers for this vector space.
gridSampling grid of the discretization mappings.
implName of the implementation back-end.
is_complexTrue if this is a space of complex tensors.
is_realTrue if this is a space of real tensors.
is_uniformTrueifpartitionis uniform.is_uniform_byaxisBoolean tuple showing uniformity of
self.partitionper axis.is_uniformly_weightedTrueif the weighting is the same for all space points.is_weightedTrueif thetspaceis weighted.itemsizeSize in bytes of one entry in an element of this space.
max_ptVector of maximal coordinates of the function domain.
meshgridAll sampling points in the partition as a sparse meshgrid.
min_ptVector of minimal coordinates of the function domain.
nbytesTotal number of bytes in memory used by an element of this space.
ndimNumber of dimensions (= number of axes).
partitionRectPartitionof the function domain.real_dtypeThe real dtype corresponding to this space's
dtype.real_spaceThe space corresponding to this space's
real_dtype.shapeShape of the underlying partition.
sizeTotal number of underlying partition cells.
tangent_bundletspaceSpace for the coefficients of the elements of this space.
tspace_typeTensor space type of this space.
weightingThis space's weighting scheme.
Methods
astype(dtype)Return a copy of this space with new
dtype.Available data types for new elements in this space.
contains_all(other)Test if all elements in
otherare contained in this set.contains_set(other)Test if
otheris a subset of this set.default_dtype([field])Default data type for new elements in this space.
dist(x1, x2)Return the distance between
x1andx2.divide(x1, x2[, out])Return the pointwise quotient of
x1andx2element([inp, order])Create an element from
inpor from scratch.inner(x1, x2)Return the inner product of
x1andx2.lincomb(a, x1[, b, x2, out])Implement
out[:] = a * x1 + b * x2.multiply(x1, x2[, out])Return the pointwise product of
x1andx2.norm(x)Return the norm of
x.one()Return the element of all ones.
points([order])All sampling points in the partition.
zero()Return the element of all zeros.
- __init__(partition, tspace, **kwargs)[source]¶
Initialize a new instance.
- Parameters:
- partition
RectPartition Partition of a rectangular spatial domain.
- tspace
TensorSpace Space of elements used for data storage. It must have the same
TensorSpace.shapeaspartition.- axis_labelssequence of str, optional
Names of the axes to use for plotting etc. Default:
1D:
['$x$']2D:
['$x$', '$y$']3D:
['$x$', '$y$', '$z$']nD:
['$x_1$', '$x_2$', ..., '$x_n$']
Note: The
$signs ensure rendering as LaTeX.
- partition