← Back to team overview

dolfin team mailing list archive

Re: [Question #96782]: using complex matrices

 

Question #96782 on DOLFIN changed:
https://answers.launchpad.net/dolfin/+question/96782

    Status: Open => Answered

Anders Logg proposed the following answer:
On Thu, Jan 14, 2010 at 08:47:05PM -0000, Lex wrote:
> Question #96782 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/96782
>
>     Status: Answered => Open
>
> Lex is still having a problem:
> Many thanks for your answer.
>
> So to interface the real part of a complex matrix only makes no sense?
> I'm thinking about assembling the imaginary part of the equation, shift it to the imaginary part of the matrix an then assembling the real part of the equation in the same matrix.
>
> Regards, Alex

I'm suggesting you forget about moving values around in the matrix and
just assemble everything as one big real-valued system.

Consider for example this equation

  (grad(v), c*grad(u)) = (v, f)

where v, u, c and f are complex-valued.

Now let

  v = v1 + v2*i

etc (for all variables appearing in the form) and carry out all the
algebra. Then identify the real and imaginary parts of LHS and RHS and
set them equal.

You'll end up with a system of two real-valued scalar equations. Then
just solve that as a system using mixed elements (V = P1 + P1) in
DOLFIN.

The solution will be a vector-valued function u where u[0] is the real
part and u[1] is the imaginary part.

--
Anders

-- 
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.