@@ -2453,6 +2453,49 @@ def refined(self):
24532453 def basis (self , name , * args , ** kwargs ):
24542454 return function .asarray ([1. ])
24552455
2456+ class WithIdentifierTopology (Topology ):
2457+ '''A topology that appends an :class:`nutils.transform.Identifier` to the ``transforms`` and ``opposites`` of another topology.
2458+
2459+ Parameters
2460+ ----------
2461+ parent : :class:`Topology`
2462+ The parent topology.
2463+ token : :class:`object`
2464+ An immutable token that will be used to create the
2465+ :class:`nutils.transform.Identifier`.
2466+ '''
2467+
2468+ __slots__ = '_parent' , '_root' , '_identifier'
2469+
2470+ @types .apply_annotations
2471+ def __init__ (self , parent :stricttopology , root :function .strictroot , identifier :transformseq .stricttransforms ):
2472+ assert len (identifier ) == 1 and sum (identifier .todims ) == 0
2473+ self ._parent = parent
2474+ self ._root = root
2475+ self ._identifier = identifier
2476+ super ().__init__ (parent .roots + (root ,),
2477+ parent .references ,
2478+ parent .transforms * identifier ,
2479+ parent .opposites * identifier )
2480+
2481+ def basis (self , * args , ** kwargs ):
2482+ return function .WithTransformsBasis (self ._parent .basis (* args , ** kwargs ), self .transforms , function .SelectChain (self .roots ))
2483+
2484+ @property
2485+ def refined (self ):
2486+ return WithIdentifierTopology (self ._parent .refined , self ._root , self ._identifier .refined (elementseq .asreferences ([element .PointReference ()], 0 )))
2487+
2488+ @property
2489+ def boundary (self ):
2490+ return WithIdentifierTopology (self ._parent .boundary , self ._root , self ._identifier )
2491+
2492+ @property
2493+ def interfaces (self ):
2494+ return WithIdentifierTopology (self ._parent .interfaces , self ._root , self ._identifier )
2495+
2496+ def getitem (self , item ):
2497+ return WithIdentifierTopology (self ._parent .getitem (item ), self ._root , self ._identifier )
2498+
24562499class PatchBoundary (types .Singleton ):
24572500
24582501 __slots__ = 'id' , 'dim' , 'side' , 'reverse' , 'transpose'
0 commit comments