← Back to team overview

dolfin team mailing list archive

Re: Breaking functionality

 

> So, the new UFC-based assembly seems to be mostly complete and I think
> we've reached a point where we need to break everything in order to
> finish up.
>
> This should be the last major rewrite we do for a while. We've done
> quite a few, but not needing to do another one soon is the whole point
> of the UFC interface.
>
> Where should we do this? We can do it in dolfin-dev (dolfin), or we
> can set up a separate branch. Doing it in dolfin-dev would be the most
> practical, since we will need to touch the code in quite a few places
> to get things done.
>
> Meanwhile, we have dolfin-stable for those who need something that
> works. (We should write something in the wiki about this!)
>
> Here's a summary of what we have and what we need to do:
>
> - The new UFC-based assembly has been implemented in the class
> Assembler and is mostly finished.
>
> - There is a small test program in src/sandbox/assembly.
>
> - We've been able to remove quite a lot of code. As mentioned before,
> Assembler.cpp is (still) considerably shorter than FEM.cpp.
>
> - A whole lot of code can be removed from the Function classes. For
> example, here is what the implementation of UserFunction looks like:
>
>   void UserFunction::interpolate(real* coefficients,
>                                  const ufc::cell& cell,
>                                  const ufc::finite_element&
> finite_element)
>   {
>     for (uint i = 0; i < finite_element.space_dimension(); i++)
>       coefficients[i] = finite_element.evaluate_dof(i, *this, cell);
>   }
>
> And here is what the implementation of DiscreteFunction looks like:
>
>   void NewDiscreteFunction::interpolate(real* coefficients,
>                                         const ufc::cell& cell,
>                                         const ufc::finite_element&
> finite_element)
>   {
>     dof_map->tabulate_dofs(dofs, cell);
>     x.get(coefficients, dof_map->local_dimension(), dofs);
>   }
>
> - The class NewDiscreteFunction will replace DiscreteFunction and I
> would like us to try hard to avoid trying to make too much of it. In
> particular, it owns all its data (except for the mesh which is a
> reference) so we don't need to mess with smart pointers or tracking
> who owns the vector etc.
>
> - A lot of classes will be removed: BilinearForm, LinearForm,
> Functional, FEM, FiniteElement, FiniteElementSpec, AffineMap.
>
> - A lot of classes will need to be updated: PDE, LinearPDE,
> NonlinearPDE, all the modules, most of the demos.
>
> - The new assembler has not been merged with Garth's parallel
> assembler, but now may be the time.
>
> - All help appreciated...
>
> Any last words before I start taking things apart?
>
> /Anders

Go for it! I agree that the Function classes should be kept simple, right
now they've become a bit too big. This work can definitely be done in
dolfin-dev, we have other repositories (branches) now which won't be
touched by this for a while.

  Johan




References