Assembling functionals that are not expressed as differential forms.
This issue refers to the QA
http://fenicsproject.org/qa/6580/spring-functionals-assembling-non-integral-functional?show=6604#c6604
Currently there is no way in UFL/Dolfin to assemble a form of the type:
f = u(x1)*v(x2)
where u
is a trial function, v
a test function, x1
and x2
two points in the mesh. I report below the comment by @martinal on QA that pinpoint the key issues:
[The problem is that] there is no 'apply' operator in UFL, so there's currently no way to represent u(x1). What's missing is not a purely UFL feature either, the fundamental issue is that apply is not a local operation so it doesn't fit into the "for each cell: compute local contribution && add to global value" assembly framework.
The problem is quite relevant in general for applications. All commercial FE packages provide specific elements for that. Think to all type of 'discrete' elements as springs in elastic solids or or discrete circuital elements in electromagnetism.
Comments (3)
-
-
Wouldn't be a better abstraction for
f = u(x1)*v(x2)
# pseudocode f = u(x)*v(x1+x2-x)*dP(sitting_at=x1, integration_variable=x)
i.e. usage of two features
- Dirac measure (which we currently support only at vertices, AFAIK)
- composition of terminal with something else (here
v
is composed with affine function (UFL expression)), which we don't have
-
Possibly. The challenge is still the global nature of evaluation of functions in arbitrary points.
Global evaluation of a Function in dolfin is somewhat supported by wrapping it in an Expression, however that looses information so differentiation becomes tricky. I can see ways to improve on that.
However test and trial functions are harder.
- Log in to comment
What you want involves a few different issues:
Where 2b is the hardest part.