← Back to team overview

ufl team mailing list archive

Re: [noreply@xxxxxxxxxxxxx: [Branch ~ufl-core/ufl/main] Rev 1051: erge]

 

Thanks! I'll see if it works.

Have you thought about what should happen if say degree is given for a
mixed element but only one of the subelements has an undefined degree?

It might also be the case that we will completely miss such cases. I
think degree() for a mixed element returns the maximum degree of the
subelements and if one of them is None but not all, we will miss it
since max(None, q) = q.

--
Anders


On Fri, May 13, 2011 at 09:03:27AM +0200, Martin Sandve Alnæs wrote:
> Done, did a manual test and checking in now:
>
> In [5]: print FiniteElement("CG", triangle,
> 2).reconstruct(family="DG", cell=quadrilateral, degree=3)
> <DG3 on a <quadrilateral cell in R2>>
>
> In [8]: print VectorElement("CG", triangle,
> 2).reconstruct(family="DG", cell=quadrilateral, degree=3)
> <Discontinuous Lagrange vector element of degree 3 on a <quadrilateral
> cell in R2>: 2 x <DG3 on a <quadrilateral cell in R2>>>
>
> In [9]: print TensorElement("CG", triangle,
> 2).reconstruct(family="DG", cell=quadrilateral, degree=3)
> <Discontinuous Lagrange tensor element of degree 3 and shape (2, 2) on
> a <quadrilateral cell in R2>>
>
> In [10]: print MixedElement(VectorElement("CG", triangle, 2),
> FiniteElement("CG", triangle, 2)).reconstruct(family="DG",
> cell=quadrilateral, degree=3)
> <Mixed element: (<Discontinuous Lagrange vector element of degree 3 on
> a <quadrilateral cell in R2>: 2 x <DG3 on a <quadrilateral cell in
> R2>>>, <DG3 on a <quadrilateral cell in R2>>)>
>
> I'll move this into the unit tests, but don't have more time for this today.
>
> Martin
>
> On 13 May 2011 00:33, Anders Logg <logg@xxxxxxxxx> wrote:
> > It seems to work fine, but some unit tests are failing since
> > reconstruct is only implemented for FiniteElement (not for mixed
> > elements etc).
> >
> > Could you add a suitable reconstruct for mixed elements? I'm not sure
> > how it should be done, in particular how the input should be
> > propagated to the subelements.
> >
> >
> >
> >
> > On Thu, May 12, 2011 at 10:37:08PM +0200, Martin Sandve Alnæs wrote:
> >> Be aware that form_data.elements and friends are _after_ mapping, so
> >> if you get to the dolfin.FunctionSpaces through them something must be
> >> changed. If you get them from the original functions everything should
> >> be fine though.
> >>
> >> Martin
> >>
> >> On 12 May 2011 22:30, Anders Logg <logg@xxxxxxxxx> wrote:
> >> > On Thu, May 12, 2011 at 10:22:51PM +0200, Martin Sandve Alnæs wrote:
> >> >> On 12 May 2011 22:21, Anders Logg <logg@xxxxxxxxx> wrote:
> >> >> > On Thu, May 12, 2011 at 08:39:55PM +0200, Anders Logg wrote:
> >> >> >> On Thu, May 12, 2011 at 07:39:39PM +0200, Martin Sandve Alnæs wrote:
> >> >> >> > I've pushed some changes to lp:~martinal/ufl/reconstruction mostly
> >> >> >> > implementing the ufl side of taking an (optional) element_mapping
> >> >> >> > as input to preprocess, but I want to test it a bit more before pushing
> >> >> >> > to trunk.
> >> >> >>
> >> >> >> ok. I'm currently working on sorting out some remaining cache problems
> >> >> >> in the FFC JIT compiler. That should hopefully take care of the
> >> >> >> remaining tests that fail in DOLFIN. When that works, I can try out
> >> >> >> the reconstruction.
> >> >> >
> >> >> > Is it safe to try out the new element replacement now?
> >> >>
> >> >> Yes, I even checked it in. element_mapping is None by default, just
> >> >> try adding it.
> >> >
> >> > ok, will try.
> >> >
> >> >
> >



Follow ups

References