I have a function in fenics which is defined on product function space (for real and imaginary parts). Now I want to compute the integral of this function over the domain. I have no glue how this should work. And I am not able to find something in the documentation. I think the documentation has changed this week since non of the google links is working anymore. The Function space is defined as follows:
FuncSpace = FiniteElement( "CG" , mesh.ufl_cell() , 1 )
FuncSpace2 = FunctionSpace( mesh , MixedElement( [ FuncSpace , FuncSpace ] )
And the function is defined as:
Psi = Function( FuncSpace2 )
I am solving some partial integration problem and afterwards want to compute the integral of this function. Can anyone help me with this problem I am quite stuck?
Or can I convert the function to some python array because then I the integration would be straightforward
So I found the answer now. First I split the result function Psi into real and complex part
Real , Imag = split( Psi )
next I define the abs value of the function by:
absPsi = sqrt( Real * Real + Imag * Imag )
Now I have to define a measure on the used mesh:
ds = Measure( "dx" , domain = mesh )
where mesh contains a mesh defined by fenics. And last the integral is solved by:
norm = assemble( d * ds )