How to use Bubble Functions

Asked by Thomas Fraunholz

Hallo!

Is there an easy way to define and use a Bubble function b_K on every triangle, eg. u*b_K*v*dx, where u and v are trial and test functions and b_K can be expressed in barycentric coordinates like \lambda_1*\lambda_2*\lambda_3 ?

Thanks in advance,
Thomas

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Marie Rognes
Solved:
Last query:
Last reply:
Revision history for this message
Best Marie Rognes (meg-simula) said :
#1

Yes! Try this:

from dolfin import *

mesh = UnitSquare(1, 1)
dim = mesh.topology().dim()

# Define bubble function space (polynomials of degree dim+1 that are
# zero on cell boundary):
B = FunctionSpace(mesh, "B", dim+1)
print "B = ", B

# Set all degrees of freedom to 1 and there you have your bubble
b_K = Function(B)
b_K.vector()[:] = 1.0

--
Marie

On 01/31/2012 11:41 AM, Thomas Fraunholz wrote:
> New question #186388 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/186388
>
> Hallo!
>
> Is there an easy way to define and use a Bubble function b_K on every triangle, eg. u*b_K*v*dx, where u and v are trial and test functions and b_K can be expressed in barycentric coordinates like \lambda_1*\lambda_2*\lambda_3 ?
>
> Thanks in advance,
> Thomas
>

Revision history for this message
Thomas Fraunholz (sleater) said :
#2

Thanks Marie Rognes, that solved my question.

Revision history for this message
Thomas Fraunholz (sleater) said :
#3

Great. It seems that I missed the right dimension. Thanks Again!