This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

obtain integrand from integral

0 votes

I try to generalize some methods. In one step I need to modify the integrand in a integral.

Can I obtain integrand from a integral Form in FEniCS?

v = (rho**2) *dx
integrand = v.??
new_v = integrand*sin(rho)*dx

Thx!

asked Aug 18, 2016 by truemerlin FEniCS Novice (410 points)

1 Answer

+1 vote

Hi, consider

from dolfin import *

mesh = UnitSquareMesh(10, 10)

f = Constant(10)
v = f*ds(domain=mesh) + (f**2)*ds(domain=mesh) + (f**3)*ds(domain=mesh)

for integral in v.integrals():
    integrand = integral.integrand()
    form = integrand*dx(domain=mesh)

    print form, assemble(form)
answered Aug 18, 2016 by MiroK FEniCS Expert (80,920 points)
...