integrating Poisson Equation solution over its domain

Asked by Payman Tohidifar

Dear all,
I was wondering if I can compute integral of the solution for Poisson equation over an arbitrary domain. Dolfin is able to compute derivatives at each point by defining a vector function space but I don't know how to compute integral of solution function over the domain. I would be thankful if you help me out.

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
Christian Waluga (chris-1) said :
#1

Try assemble(uh*dx), where uh is your solution. Is that what you want?

Revision history for this message
Best Marie Rognes (meg-simula) said :
#2

If u is your solution, try

M = assemble(u*dx)

M is then the value of the integral of the solution over the mesh.

Revision history for this message
Payman Tohidifar (payman-che) said :
#3

Thank you very much guys. It worked pretty well.

Revision history for this message
Payman Tohidifar (payman-che) said :
#4

Thanks Marie Rognes, that solved my question.