On 18. juni 2010 16:23, Kristian Oelgaard wrote: > On 18 June 2010 15:25, Mehdi <m.nikba...@tudelft.nl> wrote: > >> >> If we want to address this issue, the same concept should be also >> considered for ElementRestriction. What would we expect if we enrich a >> vector element with a restricted vector element? >> >> V = VectorElement("CG", "triangle", 1) >> B = ElementRestriction(V, dc) >> >> W = V + B >> >> Since this restricted element is not vector element anymore. >> > Can't we just check, inside the '+' operator, if an element is an > ElementRestriction and then if the restricted element is a > VectorElement > BTW, shouldn't it be RestrictedElement (like EnrichedElement) rather > than ElementRestriction? > >
Yes, that would be more consistent. > Another possibility is to propagate the restriction to the subelements > when creating the restricted element and then return a VectorElement > with restricted sub elements. Did we try that and fail at some point? > I forgot. > > FFC does do this for its internal representation of restricted elements... -- Marie > Kristian > > >> Yours, >> Mehdi >> >> >> >>> Kristian >>> >>> >>>> Another advantages of using this approach is we don't need to define >>>> unnecessary scaler elements to just get mixed enriched element. The >>>> approach of defining scaler elements can be annoying, if we want to use >>>> both enriched and non-enriched vector elements(which is the case often >>>> for me). >>>> >>>> If we overload +, it is just enough to have: >>>> >>>> V = VectorElement("CG", "triangle", 1) >>>> B = VectorElement("B", "triangle", 3) >>>> M = V + B >>>> >>>> We can use M and V both to define our functions. >>>> >>>> >>>> This is definitely and advantage. >>>> >>>> >>>> >>>> If we want to extend VectorElement, this would be, >>>> >>>> V1 = FiniteElement("CG", "triangle", 1) >>>> B1 = FiniteElement("B", "triangle", 3) >>>> M = VectorElemnet(V1 + B1) >>>> >>>> >>>> But we can still extend the vector element to enable this it you think >>>> it will be useful, that was the essence of my earlier and confusing >>>> remark which should have been: >>>> >>>> 'We CAN of course still do this even if we decide on option 1)' >>>> >>>> >>>> Ok, sentence makes sense now! >>>> >>>> -- >>>> Marie >>>> >>>> >> >> _______________________________________________ Mailing list: https://launchpad.net/~ffc Post to : ffc@lists.launchpad.net Unsubscribe : https://launchpad.net/~ffc More help : https://help.launchpad.net/ListHelp