This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

local projections in bilinear forms

+4 votes

Suppose

  V = FunctionSpace(mesh, 'N1curl', 1)
  W = VectorFunctionSpace(mesh, 'Lagrange', 2)
  v = TrialFunction(V)
  w = TestFunction(W)

or vice versa (v the test function, w the trial). There are a number of circumstances where one wants to include a term like

  v * Pi_h(w) * dx

in the bilinear form, where Pi_h denote the projection into the N1curl space using the tangential integrals along the edges.

In 2d this can be done in FEniCS, by introducing a new test function in the N1curl space and using the dS measure to include edge integral terms. In this way, the MITC plate elements can be implemented, for example (details on request).

However in 3d we don't have a measure to integrate over the edges, which are no longer facets. This leads to two questions:

  1. Is it possible to add terms that are integrals over element edges
    in 3D?
  2. Is it possible to include a projection in the bilinear form by some
    other means?

This is crucial for some work we are doing now and we are willing to dig into the code and make modification or additions, but would need some direction on where to look and how to start. So we would be grateful for any suggestions, pointers to other work, or ideas.

For related questions see here and here.

asked Apr 22, 2014 by dnarnold FEniCS User (2,360 points)

1 Answer

0 votes

In answer to 1.: As you know, such terms are currently not supported. In order to proceed one would have to define a new measure and associated integral type in UFL, corresponding code generation in FFC/UFC and additions to the assembler in DOLFIN. However, the main difficulty lies with the fact that an element edge in 3D can be shared by an unknown amount of elements making matters different from the existing measures and implementation not immediate.

answered Apr 22, 2014 by Marie E. Rognes FEniCS User (5,380 points)

An important case, even for integration over facets, is when the quantity being integrated has the same value for all the elements meeting the facet. In that case it doesn't matter which element containing the facet is chosen. One can be picked "at random". This is the case needed to compute a projection, so this is probably what we will try to code.

Ok, so I would recommend the following route for starting to look at this (but with no guarantees...)

1) Start by using and modifying the C++ interface.

2) Look at the DOLFIN Assembler class: dolfin/fem/Assembler.cpp in particular the functions assemble and assemble_interior_facets (for inspiration). Search for calls for tabulate_tensor. These calls are calls to code generated by FFC for computing the element tensors. A new integral type and associated assembler function would need to be added for co-dimension 2 entities. Pay particular attention to the dimensions of the element tensors: the cell integral is related to a single cell, the interior facet integral is related to a macro cell. Get this to work first (with dummy tabulate_tensor calls for instance) for the new, say, 'assemble_edges' as a proof of concept.

3) The code for the tabulate_tensors needs to be generated by FFC and moreover, which code to generate needs to be specified in UFL. So, then you would need to
3a) Add the relevant measure to UFL (this should be easy)
3b) Add the relevant code generation in FFC (if you know what code to generate, cf point 2, this could be somewhat time consuming but not a show-stopper I think)

I'd be happy to provide further input if you get past point 2). And of course, there is the parallel aspect of everything but that is not my area of expertise...

Hope this helps.

...