This is already possible. You just camouflage free indices into
TestFunction of appropriate dimension.
Cool!
Thank you: I was not aware neither of the Real function space
nor of their possible use.
Is the attached patch correct? Would it be acceptable?
Would a patch modifying the lift-drag demo
be acceptable or should your example go to a different demo?
Marco
Test this:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
from dolfin import *
mesh = Mesh("../dolfin_fine.xml.gz")
Vp = FunctionSpace(mesh, "CG", 1)
p = Function(Vp, "../dolfin_fine_pressure.xml.gz")
class Fish(SubDomain):
def inside(self, x, on_boundary):
return x[0] > DOLFIN_EPS and x[0] < (1.0 - DOLFIN_EPS) and \
x[1] > DOLFIN_EPS and x[1] < (1.0 - DOLFIN_EPS)
n = FacetNormal(mesh)
R = VectorFunctionSpace(mesh, "R", 0)
j = TestFunction(R)
F = p*dot(n, j)*ds
A = derivative(F, p)
fish = Fish()
f = assemble(F, mesh=mesh, exterior_facet_domains=fish)
a = assemble(A, mesh=mesh, exterior_facet_domains=fish)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Jan
diff --git a/site-packages/dolfin/functions/functionspace.py
b/site-packages/dolfin/functions/functionspace.py
index 38c57de..9e0b0ab 100644
--- a/site-packages/dolfin/functions/functionspace.py
+++ b/site-packages/dolfin/functions/functionspace.py
@@ -346,6 +346,7 @@ class FunctionSpace(FunctionSpaceBase):
Nedelec 2nd kind H(curl) "N2curl"
Quadrature "Q"
Raviart-Thomas "RT"
+ Real "R"
================================= =========
*only partly supported.
@@ -371,6 +372,17 @@ class FunctionSpace(FunctionSpaceBase):
# Brezzi-Douglas-Marini element of degree 2
W = FunctionSpace(mesh, "BDM", 2)
+ The ``"R"`` (Real) function space deserves a comment on its own.
+ This code
+
+ .. code-block:: python
+
+ # Scalar unknown
+ V = FunctionSpace(mesh, "R", 0)
+
+ introduces a discrete real unknown that could be used e.g. as a
Lagrange
+ multiplier of a discrete constraint equation.
+
"""
# Check arguments
_______________________________________________
fenics mailing list
[email protected]
http://fenicsproject.org/mailman/listinfo/fenics