← Back to team overview

ffc team mailing list archive

Re: [HG FFC] Delete a lot of old stuff.

 

On Tue, Apr 21, 2009 at 10:43:18AM +0200, Kristian Oelgaard wrote:
> Quoting Kristian Oelgaard <k.b.oelgaard@xxxxxxxxxx>:
> 
> > Quoting Anders Logg <logg@xxxxxxxxx>:
> >
> > > I've made a first attempt to remove the old stuff. It mostly works but
> > > there were some problems I couldn't figure out for the quadrature
> > > representation.
> > >
> > > The MixedPoisson demo fails for quadrature with the following error:
> > >
> > >   File
> > >
> > >
> >
> "/usr/lib/python2.5/site-packages/ffc/compiler/codegeneration/quadrature/uflquadraturegenerator_utils.py",
> > > line 842, in __create_mapping_basis
> > >     name, non_zeros, zeros, ones = self.name_map[name]
> > > KeyError: 'FE0_C3'
> > >
> > > Any clues what goes wrong?
> >
> > Yes, after some digging I discovered that it's because someone has changed
> >
> > if ffc_element.value_mapping(component) == Mapping.AFFINE:
> > to
> > if ffc_element.space_mapping(component) == Mapping.AFFINE:
> >
> > in many places.
> >
> > However, value_mapping produces the following error now:
> >
> >   File "/home/oelgaard/fenics/clone/ffc/ffc/fem/mixedelement.py", line 81, in
> > value_mapping
> >     i = Index(component)
> > NameError: global name 'Index' is not defined
> >
> > This is probably because Index has been removed from FFC? So we should use
> > space_mapping?
> >
> > The problem is that for:
> >
> > BDM = FiniteElement("Brezzi-Douglas-Marini", triangle, q)
> > DG  = FiniteElement("Discontinuous Lagrange", triangle, q - 1)
> >
> > mixed_element = BDM + DG
> >
> > (tau, w) = TestFunctions(mixed_element)
> > (sigma, u) = TrialFunctions(mixed_element)
> >
> > a = w*u*dx
> >
> > The FFC element for the mixed basis function is:
> > Mixed finite element: [FiniteElement('Brezzi-Douglas-Marini', 'triangle', 1),
> > FiniteElement('Discontinuous Lagrange', 'triangle', 0)]
> >
> > But when trying to get the mapping for component 2 (the DG element)
> >
> > ffc_element.space_mapping(2) =  1
> >
> > which is not equal to Mapping.AFFINE = 0
> >
> > Is there a simple way of fixing this using space_mapping, or should we fix
> > the
> > value_mapping?
> 
> I saw what appears to be a new function in mixedelement.py, component_element(),
> which I think will do the trick.

Yes! :-)

-- 
Anders

Attachment: signature.asc
Description: Digital signature


References