I am looking to combine FEMExternalOperators with scifem Real Function Spaces so that I can use Python-defined energy functions related to extra degrees of freedom. However, currently, FEMExternalOperators only supports quadrature elements, and I believe that I would need the function space of the external operator also to be a Real function space (when I tried it with a normal quadrature element, too many values were being passed in).
Do you know if there is a workaround for this? Do you know if the external operators framework is compatible with Real function spaces in general, or am I trying something that doesn’t conceptually work?
Yup! That’s exactly what I’m after. This relates back to an earlier post (Adding Non-Nodal Degrees of Freedom to a Problem) where I described trying to couple rigid body degrees of freedom to an elastic model. Based on your suggestion, I have been attempting this by using real function space functions (r\in R) to good success. Now I am looking to create an external operator that takes in r so that I can define how those degrees of freedom couple using non-UFL code (basically, in my eventual problem, the coupling will depend on some geometry of the rigid body components that I need to account for that cannot be expressed in UFL).
If that is your aim, it should work out of the box, as a real_function_space is nothing but a “DG”-0 space with a special dofmap.
The operator will evaluate the real_function_space function at a set of points (quadrature points). It will evaluate the same function (which is a constant value) at these points, and it will then just give you the same value N times.