pymor.vectorarrays.block¶
Classes
|
|
- class pymor.vectorarrays.block.BlockVectorArray(space, impl, base=None, ind=None, _len=None)[source]¶
Bases:
VectorArrayVectorArraywhere each vector is a direct sum of sub-vectors.Given a list of equal length
VectorArraysblocks, thisVectorArrayrepresents the direct sums of the vectors contained in the arrays. The associatedVectorSpaceisBlockVectorSpace.BlockVectorArraycan be used in conjunction withBlockOperator.Methods
amax,append,axpy,check_ind,check_ind_unique,conj,copy,dofs,empty,full,gramian,inner,len_ind,len_ind_unique,lincomb,norm,norm2,ones,pairwise_inner,random,scal,sup_norm,to_numpy,zerosAttributes
- impl_type[source]¶
alias of
BlockVectorArrayImpl
- class pymor.vectorarrays.block.BlockVectorArrayImpl(blocks, space)[source]¶
Bases:
VectorArrayImplMethods
amax,append,axpy,axpy_copy,conj,copy,delete,dofs,imag,inner,lincomb,norm2,pairwise_inner,real,scal,scal_copy,to_numpyAttributes
- class pymor.vectorarrays.block.BlockVectorSpace(subspaces)[source]¶
Bases:
VectorSpaceVectorSpaceofBlockVectorArrays.A
BlockVectorSpaceis defined by theVectorSpacesof the individual subblocks which constitute a given array. In particular for a given :class`BlockVectorArray`U, we have the identity(U.blocks[0].space, U.blocks[1].space, ..., U.blocks[-1].space) == U.space.
- Parameters:
subspaces – The tuple defined above.
Methods
Attributes
- from_numpy(data, ensure_copy=False)[source]¶
Create a
VectorArrayfrom aNumPy array.Note that this method will not be supported by all vector space implementations.
- Parameters:
data –
NumPyarray of shape(dim, len)wherelenis the number of vectors anddimtheir dimension.ensure_copy – If
False, modifying the returnedVectorArraymight alter the originalNumPy array. IfTruealways a copy of the array data is made.
- Returns:
A
VectorArraywithdataas data.
- make_array(obj)[source]¶
Create a
VectorArrayfrom raw data.This method is used in the implementation of
OperatorsandModelsto create newVectorArraysfrom raw data of the underlying solver backends. The ownership of the data is transferred to the newly created array.The exact signature of this method depends on the wrapped solver backend.
- zeros(count=1, reserve=0)[source]¶
Create a
VectorArrayof null vectors.- Parameters:
count – The number of vectors.
reserve – Hint for the backend to which length the array will grow.
- Returns:
A
VectorArraycontainingcountvectors with each component zero.