I believe the only way you can handle this is by using separate programs linked with different PETSc configurations for the time domain solver and the frequency domain solver. Of course, this requires that both problems are somewhat "uncoupled" and that you use some MPI-2 features (dynamic process management) to make your two programs "chat" each other.
If you have some knowledge of Python, I can offer you a rather simple solution based on mpi4py (MPI for Python). You write a "master" Python script communicating with each of your programs and managing the interchange of data using MPI calls. With a bit of luck, you will not need to add too much to your current code. Of course, you can skip the Python way and code all the "master" part in C/C++/Fortran. Just let me know if you are interested in this approach. On Wed, Aug 20, 2008 at 9:19 AM, Zhifeng Sheng <z.sheng at ewi.tudelft.nl> wrote: > Dear all > > I am working on a FEM program, which can be used to solve time domain and > frequency domain EM problems. I finished the time domain solver part and now > I need to implement the frequency domain solver.... So I built Petsc with > --scalar-type = complex, and then my time domain solver can not be compiled, > it says " can not convert double to PetscScalar". > > Is there any way that I can handle both real matrix and complex matrix at > the same time? (without changing my old code too much?) > > Thanks > Best regards > Zhifeng Sheng > > -- Lisandro Dalc?n --------------- Centro Internacional de M?todos Computacionales en Ingenier?a (CIMEC) Instituto de Desarrollo Tecnol?gico para la Industria Qu?mica (INTEC) Consejo Nacional de Investigaciones Cient?ficas y T?cnicas (CONICET) PTLC - G?emes 3450, (3000) Santa Fe, Argentina Tel/Fax: +54-(0)342-451.1594
