@@ -4379,6 +4379,41 @@ def get_support(self, dof):
43794379 supp2 = self ._basis2 .get_support (dof2 )
43804380 return (supp1 [:,_ ] * len (self ._basis2 .transforms ) + supp2 [_ ,:]).ravel ()
43814381
4382+ class WithTransformsBasis (Basis ):
4383+ '''Replace the transforms sequence of a basis.
4384+
4385+ Parameters
4386+ ----------
4387+ parent : :class:`Basis`
4388+ The basis to wrap.
4389+ transforms : :class:`nutils.transformseq.Transforms`
4390+ The new transforms sequence.
4391+ '''
4392+
4393+ @types .apply_annotations
4394+ def __init__ (self , parent :strictbasis , transforms :transformseq .stricttransforms , trans :types .strict [TransformChain ]):
4395+ self ._parent = parent
4396+ assert len (self ._parent .transforms ) == len (transforms )
4397+ super ().__init__ (ndofs = parent .ndofs , transforms = transforms , ndims = parent .ndimsdomain , trans = trans )
4398+
4399+ def get_support (self , dof ):
4400+ return self ._parent .get_support (dof )
4401+
4402+ def get_dofs (self , ielem ):
4403+ return self ._parent .get_dofs (ielem )
4404+
4405+ def get_coefficients (self , ielem ):
4406+ return self ._parent .get_coefficients (ielem )
4407+
4408+ def f_ndofs (self , index ):
4409+ return self ._parent .f_ndofs (index )
4410+
4411+ def f_dofs (self , index ):
4412+ return self ._parent .f_dofs (index )
4413+
4414+ def f_coefficients (self , index ):
4415+ return self ._parent .f_coefficients (index )
4416+
43824417class DisjointUnionBasis (Basis ):
43834418
43844419 __slots__ = '_bases' , '_dofsplits' , '_elemsplits'
0 commit comments