assemble function

Asked by Houdong Hu on 2013-04-09

r_x = function(V)
rho = function(V)
V_rho = function(V)
v_ext =Expression(" ")

energy_T=assemble(inner(grad(r_x),grad(r_x))*dx)
energy_H=assemble(V_rho*rho*dx)
energy_ex=assemble(v_ext*rho*dx)
energy_xc=assemble((rho**(4/3))*dx)

Do you think these four integration are making sense, I feel all of them are smaller than they should be.

Question information

Language:
English Edit question
Status:
Answered
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Last query:
2013-04-09
Last reply:
2013-05-09
Kent-Andre Mardal (kent-and) said : #1

I would expect energy functionals to be greater or equal to 0, and
energy_H and energy_ex are therefore not sensible to me.

You should test with some known expressions, and you may
also change the order of the approximation (order of V) to
get higher accuracy.

Kent

On 9 April 2013 09:11, Houdong Hu <email address hidden>wrote:

> New question #226245 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/226245
>
> r_x = function(V)
> rho = function(V)
> V_rho = function(V)
> v_ext =Expression(" ")
>
> energy_T=assemble(inner(grad(r_x),grad(r_x))*dx)
> energy_H=assemble(V_rho*rho*dx)
> energy_ex=assemble(v_ext*rho*dx)
> energy_xc=assemble((rho**(4/3))*dx)
>
> Do you think these four integration are making sense, I feel all of them
> are smaller than they should be.
>
> --
> You received this question notification because you are a member of
> DOLFIN Team, which is an answer contact for DOLFIN.
>

Anders Logg (logg) said : #2

FEniCS no longer uses Launchapd for Questions & Answers. Please
consult the documentation on the FEniCS web page for where and
how to (re)post your question: http://fenicsproject.org/support/

Anders Logg (logg) said : #3

FEniCS no longer uses Launchapd for Questions & Answers. Please
consult the documentation on the FEniCS web page for where and
how to (re)post your question: http://fenicsproject.org/support/

Can you help with this problem?

Provide an answer of your own, or ask Houdong Hu for more information if necessary.

To post a message you must log in.