← Back to team overview

dolfin team mailing list archive

Re: No access any more to FiniteElement / ufc::finite_element from within UFC ?

 

On Mon, Jan 17, 2011 at 04:27:33PM +0100, Andre Massing wrote:
> Den 17.01.11 16.14, skrev Garth N. Wells:
> >
> >
> >On 17/01/11 15:11, Andre Massing wrote:
> >>Den 17.01.11 15.49, skrev Garth N. Wells:
> >>>
> >>>
> >>>On 17/01/11 14:46, Andre Massing wrote:
> >>>>Hi!
> >>>>
> >>>>I just realized that the previous member
> >>>>
> >>>>FiniteElement** coefficient_elements
> >>>>and
> >>>>std::vector<FiniteElement>   finite_elements
> >>>>, respectively were removed from the UFC class.
> >>>
> >>>The coefficient finite elements are still there.
> >>
> >>Yes, but I need the ones which correspond to the test and trial function
> >>spaces.
> >>
> >>>
> >>>>I need these ones or
> >>>>more precisely access to the underlying ufc::finite_element.
> >>>>
> >>>>Can anybody give me a quick hint how to achieve this in the newer DOLFIN
> >>>>versions? I already scanned through the code, but could not find a
> >>>>simple solution.
> >>>>
> >>>
> >>>> From a FunctionSpace, you can extract a dolfin::FiniteElement, followed
> >>>by a ufc::finite_element.
> >>
> >>But not from within the UFC class since the dolfin::Form form member is
> >>private. Since the UFC class takes a dolfin::Form argument in the
> >>constructor and a reference to the Form is stored in the UFC class,
> >>would it not be meanful to make it accessible  by having a
> >>const Form&  form() const;
> >>member function in the UFC class?
> >>
> >
> >Just pass the Form and don't use UFC.
> >
> >The UFC class is just a convenience class for assembly, and shouldn't
> >generally be used. The less that is in UFC, the easy things are to
> >maintain (as I know from having made some recent changes).
>
> Ok, I can changed that in my code, it was just convenient since I
> also need the UFCcell. To be honest, the code dependencies between
> UFC, ufc::form and dolfin::Form are sometimes a bit hard to follow
> and the overall reasoning/big picture behind the implementation is
> difficult to grasp for me :), so many thanks for the quick help!!

The big picture is that we designed UFC to be independent of DOLFIN
(and other external packages).

When using UFC code from within DOLFIN, we then need to translate
DOLFIN data into UFC data. That's the role of the UFCCell and UFCMesh
classes. The UFC class is just a convenience class that holds local
data and arrays that are used during assembly. The assembly functions
in Assembler.cpp would otherwise be very long with code for allocating
all the different arrays needed to communicate with ufc (coordinates,
dofs, etc) and we would need tons of arguments to be passed between
the different functions.

--
Anders



References