Integral of basis functions of FEM ansatz space

Asked by André Bodendiek

Hi,

I would like to compute the integral \int_\Omega v dx, where \Omega is the computational domain and and v a test function of the space H(Curl). My first idea was to define a ufl-file in the form
  HCurl = FiniteElement("Nedelec 1st kind H(curl)", "tetrahedron", 1)
  phi = TestFunction(HCurl)
  DG = VectorElement("DG", tetrahedron, 0)
  e = Coefficient(DG)
  a = inner(e,phi)*dx
The problem is, that I don't know how to define the coefficient e exactly, in order to simply integrate over the ansatz function of the H(Curl) space. Maybe, someone has got a more simple idea?

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Anders Logg
Solved:
Last query:
Last reply:
Revision history for this message
Best Anders Logg (logg) said :
#1

On Thu, Nov 03, 2011 at 02:20:50PM -0000, André Bodendiek wrote:
> New question #177407 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/177407
>
> Hi,
>
> I would like to compute the integral \int_\Omega v dx, where \Omega is the computational domain and and v a test function of the space H(Curl). My first idea was to define a ufl-file in the form
> HCurl = FiniteElement("Nedelec 1st kind H(curl)", "tetrahedron", 1)
> phi = TestFunction(HCurl)
> DG = VectorElement("DG", tetrahedron, 0)
> e = Coefficient(DG)
> a = inner(e,phi)*dx
> The problem is, that I don't know how to define the coefficient e exactly, in order to simply integrate over the ansatz function of the H(Curl) space. Maybe, someone has got a more simple idea?

First, note that a Hcurl basis function is vector-valued so you need
to integrate its norm or a component of it.

Here's how to integrate component 0:

  L = v[0]*dx

Assemble this and you will get a vector that contains the integral of
each of the basis functions of your Hcurl space.

--
Anders

Revision history for this message
André Bodendiek (a-bodendiek) said :
#2

Thanks Anders Logg, that solved my question.