# evaluate boundary integrals

Hi,

After obtaining my solution using dolfin through python

problem = VariationalProb

U = problem.solve()

is there any way to integrate the solution over a given boundary edge?

Lets say I set up subdomains, then if I want to integrate n dot u over subdomain 1, I tried

ds_in = Measure(

n_in = Constant((-1,0))

val = Integral(

It seems like when i do this, val is a not a number, but a Integral type. Is there any way to evaluate this integral and get a number out of it ?

Thanks

## Question information

- Language:
- English Edit question

- Status:
- Solved

- For:
- DOLFIN Edit question

- Assignee:
- No assignee Edit question

- Solved by:
- Johan Hake

- Solved:
- 2010-02-26

- Last query:
- 2010-02-26

- Last reply:
- 2010-02-26

Johan Hake (johan-hake) said : | #1 |

On Friday 26 February 2010 12:34:59 James Lai wrote:

> New question #102549 on DOLFIN:

> https:/

>

> Hi,

>

> After obtaining my solution using dolfin through python

>

> problem = VariationalProb

> U = problem.solve()

>

> is there any way to integrate the solution over a given boundary edge?

>

> Lets say I set up subdomains, then if I want to integrate n dot u over

> subdomain 1, I tried

>

> ds_in = Measure(

> n_in = Constant((-1,0))

> val = Integral(

>

> It seems like when i do this, val is a not a number, but a Integral type.

> Is there any way to evaluate this integral and get a number out of it ?

What you get there is an integral form, like a and L above, but scalar. You

need to assemble it to get the value. A slightly smaller example using

predefined Measures and Facet normals should also work:

val = assemble(

Here domain is a either an instance of SubDomain or a MeshFunction defining

the dumain for your exterior integral form. Note that you probably need to

pass the mesh as you are assembling a functional.

Johan

James Lai (jhlai2) said : | #2 |

Cool, thanks for response, it works