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

Low-pass filter: create and integrate local supported function over domain

+2 votes

Hi!

I'm currently looking into explicit low-pass filtering for use with dynamic methods in LES (http://en.wikipedia.org/wiki/Filter_%28large_eddy_simulation%29). One method when implementing a generalized top hat box filter is to:

  • Define function G(dof) as such: $G(dof_0) = 1$ for $dof_0$ and all dofs on cells that have $dof_0$ as vertex. Zero else.
  • Integrate G times the function for filtering over the (local) domain.
  • Do this for all dofs in mesh.

Would it be possible to implement this in FEniCS in an "easy" and fast way?

Thanks!

asked Nov 27, 2014 by joakibo FEniCS User (1,140 points)

1 Answer

+1 vote

How about letting W be the finite element space that has the dofs you are referring to as all dofs in the mesh. Let f be the "function for filtering". Then do

v = TestFunction(W)
L =  f*v*dx
b = assemble(L)

Now b contains the value for each dof in the mesh.

answered Nov 28, 2014 by Marie E. Rognes FEniCS User (5,380 points)

Hi Marie!

Thank you for an instructive answer. I am not 100 percent sure that I fully understand your suggestion; but, let's say that G is defined similar to a CG1 function, 1 at a dof, 0 for all other dofs. Then your solution would be perfect! However, G is ( maybe somewhat unclear from my post) not only one in the main dof, but also one at all dofs in elements that contains dof as vertex. If $x_d$ is some dof:

$$G(x_d) = \cases{
1, & \text{for }x_d\text{ and for dofs in cells which have }x_d\text{ as vertex.}\cr
0, & \text{else}}$$

E.g. for this case http://bildr.no/image/UmZHT2xs.jpeg $G$ would be equal to one for all marked dofs, and zero else.

$G$ defined this way is specific for this specific approximation to the filter I found in some paper. It may be possible to utilize CG elements and integrate as you proposed Marie, that may yield some good results.

...