sfepy/sfepy — Issue #55: complex problems
Author: rc
Created: 2012-01-30 10:24:59+00:00
State: open

We need to be able to solve problems in complex numbers, as found, for
example, in acoustics.

Currently, all numerical data are typed as numpy.float64 - this will be
made configurable.

It is a high-priority issue for the team at our lab now.

Migrated from http://code.google.com/p/sfepy/issues/detail?id=51

earlier comments

robert.cimrman said, at 2008-07-30T18:02:42.000Z:

complex numbers: test problem implemented, see http://hg.sympy.org/sfepy/rev/b646769ce501

Verification is needed, but Newton converges for:

ebcs = {
'p_out' : ('Gamma_Right', {'p.0' : -2.0 + 1j}),
}
"""1.0 * dw_mass_scalar.i1.Omega( q, p ) - dw_laplace.i1.Omega( ac.one, q, p )
= 1550j * dw_surface_integrate.isurf.Gamma_Left( ac.v_n, q )"""

see 'input/complex.py'.

Several spots in code could be optimized. I will think how to re-design hierarchy of
*Term classes to make it easier.

lukes@kme.zcu.cz said, at 2009-02-04T13:02:51.000Z:

Already done and tested.

ondrej.certik said, at 2009-02-04T16:03:57.000Z:

Great job. So you don't have to recompile sfepy just to use complex numbers? Many
other libraries need to be recompiled for complex numbers.

robert.cimrman said, at 2009-02-04T16:11:40.000Z:

We use a trick here - for linear terms, you just have to call the same (real) C
function for the real and imaginary parts, and then assemble correctly. Anyway, there
is no native complex type and operator overloading in C, so for other terms you just
need to implement another function with different name.

Also only the terms we actually needed to work with complex numbers were modified.
But the "framework" is there.